0
$\begingroup$

I tried to implement Shannon interpolation on a 2D array.

First, implemented it on a 1D signal, just for sanity-check:

t = -7:7;
t2= -7:0.01:7;
figure
plot(t, sin(pi*t / 3))
upSamp = zeros(size(t2));
for iT = 1:length(t2)
    upSamp(iT) = sum(sinc(t2(iT) - t) .* sin(pi*t / 3));
end
hold
plot(t2, upSamp)

enter image description here

Looks ok.

Then, implementation on a 2D array. The reference array is:

figure
surf(sin(pi*T1 / 3).*sin(pi*T2 / 3))

enter image description here

Then the interpolation is done by a convolution with a Sombrero function:

[T12, T22] = meshgrid(t2, t2);
val = zeros(size(T12));
for iInterp=1:numel(T12)
    xdist = (T12(iInterp) - T1);
    ydist = (T22(iInterp) - T2);
    val(iInterp) = sum(sinc(sqrt(xdist.^2 + ydist.^2)) .* sin(pi*T1 / 3).*sin(pi*T2 / 3), 'all');
end
figure;surf(val, 'EdgeColor', 'none');

seems to work good only on the edges :(

Any suggestion?

enter image description here

$\endgroup$
1
$\begingroup$

The error source is the kernel function, which should be a multiplication of two 1D sincs (without rotational symmetry) instead of the Sombrero function, which is a sinc function with rotational symmetry.

enter image description here

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.