1D Function into 2D Function Interpolation

Posted by Drazick on Stack Overflow See other posts from Stack Overflow or by Drazick
Published on 2010-03-29T00:57:20Z Indexed on 2010/03/29 1:03 UTC
Read the original article Hit count: 423

Filed under:

Hello. I have a 1D function which I want to interpolate into 2D function. I know the function should have "Polar Symmetry". Hence I use the following code (Matlab Syntax): Assuming the 1D function is LSF of the length 15.

[x, y] = meshgrid([-7:7]);
r = sqrt(x.^2 + y.^2);
PSF = interp1([-7:7], LSF, r(:)); % Sometimes using 'spline' option, same results.

PSF = reshape(PSF, [7, 7]);

I have few problems: 1. Got some overshoot at the edges (As there some Extrapolation). 2. Can't enforce some assumptions (Monotonic, Non Negative).

Is there a better Interpolation method for those circumstances? I couldn't find "Lanczos" based interpolation I can use the same way as interp1 (For a certain vector of points, in "imresize" you can only set the length). Is there such function anywhere? Has anyone encountered a function which allows enforcing some assumptions (Monotonically Decreasing, Non Negative, etc..). Thanks.

© Stack Overflow or respective owner

Related posts about interpolation