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

4 次查看(过去 30 天)
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--');

采纳的回答

Matt J
Matt J 2022-9-22
编辑:Matt J 2022-9-22
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 个评论
Jiali
Jiali 2022-9-24
Thank you for your clarification! I do have misunderstanding between discrete Fourier transform and continuous Fourier transform although the concepts were taught before.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by