Why ifft results of analytic signal spectrum don't match with theoretical time formula?

4 visualizaciones (últimos 30 días)
Dear all,
I need to convert a spectrum data back to time domain. Before it, I use a simple Gaussian pulse as a test. However, I found that results computed by ifft don't match with theoretical time equation. Why it happened? How to resolve it?
Fs=200;
T=1/Fs;
L=1200;
tau=0.4;
t0=2.8;
mag=10;
t=(0:L-1)*T;
f=Fs*(-L/2:L/2-1)/L;
Xf=@(x)sqrt(pi).*mag.*tau.*exp(-(2.*pi.*tau.*x).^2).*exp(-1i.*2.*pi.*x.*t0);
figure;
plot(f,real(Xf(f)));
% shift spectrum starting from 0 frequency
signal_comp=ifft(fftshift(Xf(f)).*L);
signal_theoretical=mag.*exp(-(t-t0).^2/tau^2);
figure;
plot(t,signal_theoretical);
hold on;
plot(t,real(signal_comp),'r--');

Respuesta aceptada

Matt J
Matt J el 22 de Sept. de 2022
Editada: Matt J el 22 de Sept. de 2022
The IFFT and the continuous inverse Fourier transform are not the same thing.
tau=0.4;
t0=2.8;
mag=10;
Fs=200;
dT=1/Fs;
L=2000;
dF=1/dT/L;
f=dF*(-L/2:L/2-1);
t=dT*(-L/2:L/2-1);
Xf=@(x)sqrt(pi).*mag.*tau.*exp(-(2.*pi.*tau.*x).^2).*exp(-1i.*2.*pi.*x.*t0);
% shift spectrum starting from 0 frequency
signal_comp= fftshift(ifft(ifftshift(Xf(f))) ) /dT; %note factor of 1/dT
signal_theoretical=mag.*exp(-((t-t0)/2).^2/tau^2)/2; %fix the theoretical formula
figure;
plot(t(1:20:end),signal_theoretical(1:20:end),'o',...
t,real(signal_comp),'r--');
legend('Theoretical','Computed',location='northwest')
  1 comentario
Jiali
Jiali el 24 de Sept. de 2022
Thank you for your clarification! I do have misunderstanding between discrete Fourier transform and continuous Fourier transform although the concepts were taught before.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by