How to fourier transform a gaussian curve?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Antonio Sarusic
il 26 Feb 2020
Risposto: DISHANTKUMAR PATEL
il 1 Dic 2022
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
0 Commenti
Risposta accettata
Star Strider
il 26 Feb 2020
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 Commenti
Più risposte (1)
DISHANTKUMAR PATEL
il 1 Dic 2022
% 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;
0 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!