FFT of a time-valued signal, then IFFT doesn't return the same signal
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kevin Wittkowski
le 28 Mar 2020
Réponse apportée : Peng Li
le 28 Mar 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 commentaires
Réponse acceptée
Peng Li
le 28 Mar 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Transforms dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!