How to fourier transform a gaussian curve?

6 visualizaciones (últimos 30 días)
Antonio Sarusic
Antonio Sarusic el 26 de Feb. de 2020
Respondida: DISHANTKUMAR PATEL el 1 de Dic. de 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

Respuesta aceptada

Star Strider
Star Strider el 26 de Feb. de 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 comentarios
Antonio Sarusic
Antonio Sarusic el 27 de Feb. de 2020
Thank you very much!
Star Strider
Star Strider el 27 de Feb. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

DISHANTKUMAR PATEL
DISHANTKUMAR PATEL el 1 de Dic. de 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;

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by