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--');
0 个评论
采纳的回答
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')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!