How to fourier transform a gaussian curve?

6 ビュー (過去 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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by