FFT of a time-valued signal, then IFFT doesn't return the same signal
2 次查看(过去 30 天)
显示 更早的评论
Hello everybody,
I've got a problem using matlab fft/ifft: I have a .dat file from which I read the first two columns (data).
I make the fft of the signal and then the ifft to see if they correspond. They do not. Does anyone know why?
My code:
fs=200000;
time=0:1/fs:2-1/fs;
data=load(['S09H4R2.dat']);
Ffrapp=2*fft(data(:,1))./length(data(:,1));
Fsarf=2*fft(data(:,2))./length(data(:,2));
antiFfrapp=ifft(FFTfrappF./2.*length(data(:,1)),'symmetric');
antiFsarf=ifft(FFTfrappF./2.*length(data(:,2)),'symmetric');
figure
plot(time,data(:,1),'b');hold on;
plot(time,data(:,2),'c');
plot(time,antiFfrapp,'r -s');
plot(time,antiFsarf,'g -*');
xlim([0 0.02]);
THANK YOU in advance
0 个评论
采纳的回答
Peng Li
2020-3-28
fs=200000;
time=0:1/fs:2-1/fs;
data=load(['S09H4R2.dat']);
Ffrapp=2*fft(data(:,1))./length(data(:,1));
Fsarf=2*fft(data(:,2))./length(data(:,2));
antiFfrapp=ifft(FFTfrappF./2.*length(data(:,1)),'symmetric'); % what is your FFTfrappF? you were using Ffrapp in above lines.
antiFsarf=ifft(FFTfrappF./2.*length(data(:,2)),'symmetric');
figure
plot(time,data(:,1),'b');hold on;
plot(time,data(:,2),'c');
plot(time,antiFfrapp,'r -s');
plot(time,antiFsarf,'g -*');
xlim([0 0.02]);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!