Interpolating 1D Gaussian into 2D Gaussian

Posted by Drazick on Stack Overflow See other posts from Stack Overflow or by Drazick
Published on 2010-03-14T17:32:13Z Indexed on 2010/03/14 17:35 UTC
Read the original article Hit count: 289

Filed under:
|

Let's say I have a 1D Gaussian function. Its length is 600 for that matter.

I want to Interpolate it into 2D Gaussian of the size 600 X 600.

This is the code I wrote (OTFx is the Gaussian Function, OTF - 2d Interpolated Function):

[x, y] = meshgrid([-300:299], [-300:299]);
r = sqrt((x .^ 2) + (y .^ 2));

OTF = interp1([-300:299], OTFx, r(:), 'spline');
OTF = reshape(OTF, [600, 600]);

The problem is I get Overshoot at the end: alt text

How can I prevent it? Is there better Interpolating algorithm for Monotonic Descending Functions?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about interpolation