필터 지우기
필터 지우기

FFT of a time-valued signal, then IFFT doesn't return the same signal

조회 수: 6 (최근 30일)
Kevin Wittkowski
Kevin Wittkowski 2020년 3월 28일
답변: Peng Li 2020년 3월 28일
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

채택된 답변

Peng Li
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개)

카테고리

Help CenterFile Exchange에서 Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by