How to make a parabolic interpolation?

53 views (last 30 days)
Haythem ZOUABI
Haythem ZOUABI on 30 Oct 2019
Edited: Sulaymon Eshkabilov on 30 Oct 2019
Hello,
I have 3d graph as follow:
image1=imread('image.tif');
mu=[]
for i=1:30
for j=1:30
mu(i,j)=image1(i,j);
end
end
fmu=fft2(mu);
fmu(1,1)=0;
fmu2=fmu.*conj(fmu);
ps=ifft2(fmu2);
z=ps(1,1);
ps=real(fftshift(ps/z));
x=-15:1:14
y=-15:1:14
i=1:1:30
j=1:1:30
Z=ps(i,j)
[X,Y] = meshgrid(x,y);
surf(X,Y,Z)
set(gcf,'color','w') % pour les bordures.
xlabel('x (pixels)','FontSize',12, 'FontName','Times New Roman')
ylabel('y (pixels)', 'FontSize',12,'FontName','Times New Roman')
zlabel('Autocorrelation function', 'FontSize',12,'FontName','Times New Roman')
I want to make a prabolic interpolation in the vicinity of the maximum using the following equation :
Z=1-(a*x²+2b*x*y+c*y²)
How to make a parabolic interpolation? and how to get the parameters a, b and c?
Thank you for help.

Answers (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 30 Oct 2019
Hi,
An easy solution is to employ the toolbox: cftool of MATLAB.
  1. Launch it: >> cftool
  2. Select X data: X
  3. Select Y data: Y
  4. Select Z data Z
  5. Fir model type: Polynomial
  6. Degrees x: 2
  7. Degrees y: 2
  8. You will get the fit model
Good luck
  1 Comment
John D'Errico
John D'Errico on 30 Oct 2019
Actually, no. Selecting 2nd degree for both x and y there will NOT yield the model the OP has asked to get.

Sign in to comment.


Sulaymon Eshkabilov
Sulaymon Eshkabilov on 30 Oct 2019
Edited: Sulaymon Eshkabilov on 30 Oct 2019
Hi,
An exact custom equation as asked in the question can be attained on step 5 Fit Model Type selection via Custom Equation (from drop down options) and manual entry of:
1 -( a*x^2 + 2*b*x*y+c*y^2)
Good luck.

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!