FFT of a time-valued signal, then IFFT doesn't return the same signal
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kevin Wittkowski
am 28 Mär. 2020
Beantwortet: Peng Li
am 28 Mär. 2020
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 Kommentare
Akzeptierte Antwort
Peng Li
am 28 Mär. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Transforms finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!