How to fourier transform a gaussian curve?

조회 수: 5 (최근 30일)
Antonio Sarusic
Antonio Sarusic 2020년 2월 26일
답변: DISHANTKUMAR PATEL 2022년 12월 1일
Hello,
I have the following function:
x_fit_func(x) = a1*exp(-((x-b1)/c1).^2);
a1, b1 and c1 are all constants and the function represents a gaussian curve.
Now I want to fourier transform this function and in theory i should again get a gaussian curve.
I tried it like this
x_F = fft(x_fit_func(x));
or like this
x_F = fft(x_fit_func);
But it always calculates something that is not a gaussian curve.
Does anyone know what I do wrong?
Thanks
Antonio

채택된 답변

Star Strider
Star Strider 2020년 2월 26일
The ‘x_fit_fcn’ is not syntax that MATLAB recognises (except in the Symbolic Math Toolbox), as a function.
Try this versiion instead:
x_fit_func = @(x) a1*exp(-((x-b1)/c1).^2);
I also calculated the fft of the result tthat produced. It works.
  댓글 수: 4
Antonio Sarusic
Antonio Sarusic 2020년 2월 27일
Thank you very much!
Star Strider
Star Strider 2020년 2월 27일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

DISHANTKUMAR PATEL
DISHANTKUMAR PATEL 2022년 12월 1일
% isotropic Gaussian parameters n = 65; % resolution s = 2; % width x = linspace(-5,5,n); [X,Y] = meshgrid(x); gaus2d = exp( -(X.^2 + Y.^2 )/(2*s^2)); figure(1), clf surf(x,x,gaus2d) rotate3d on hold on % adjusting the radius of sphere x1 = x1*s; y1 = y1*s; z1 = z1; % add a constant to sphere, so that it is on top of gauss addi = max(gaus2d(:)) - min(z1(:)); z1 = z1 + addi; surf(x1,y1,z1) realCenter = [8,15,25]; [X,Y,Z] = sphere; XYZ = bsxfun(@plus,r*[X(:),Y(:),Z(:)], realCenter) % Label axes. xlabel('X', 'FontSize', 8); ylabel('Y', 'FontSize', 8); zlabel('Z', 'FontSize', 8); title('3D Sphere'); axis equal;

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by