Get time signal back after NFFT

조회 수: 4 (최근 30일)
So
So 2017년 9월 27일
댓글: Christoph F. 2017년 9월 28일
Hello,
I have the following code, which generate a complex chirp signal.
fs = 200e6
t=0:1/fs:1e-3;
f0=1;
f1=2e6;
t1 = 1e-3;
i = mychirp(t,f0,t1,f1);
q = mychirp_sine(t,f0,t1,f1);
x = complex(i,q);
L = length(x);
NFFT = 2^nextpow2(L)*4;
X = fftshift((fft(x,NFFT)));
f = fs*(-NFFT/2:NFFT/2-1)/NFFT;
Here is what I got in time domain and frequency domain :
Now I would like to go back in the Time domain after my FFT computed with the factor NFFT. Does anyone know how to compute the time vector in order to plot(timeVector,ifft(X)) ? I would like to plot my original signal after the IFFT.
Thank you.

답변 (1개)

Christoph F.
Christoph F. 2017년 9월 27일
The time vector as as many elements as X, and they are spaced 1/(f(2)-f(1)) apart.
And you will probably need to reverse the fftshift performed on X with ifftshift(X) before doing an ifft.
  댓글 수: 2
So
So 2017년 9월 27일
X has 1 048 576 elements. My original signal's duration is 1ms (from 0:1/fs:1e-3). So my original time vector has 2001 elements. When I perform an ifft on X, it still has the 1048576 elements compared to my orignal time vector of 2001 elements... If I create a new time vector 0:1/(f1-f0):1e-3 it will still has 2001 elements.
Christoph F.
Christoph F. 2017년 9월 28일
I see it now.
In that case, transforming back to the original time domain signal requires knowledge of the original sampling rate and the number of padding samples used in fft(). This information can no longer be determined from the vector f.
One approach would be:
1. Transform back to the zero-padded signal
xc = ifft(ifftshift(X))
2. Remove the padding zeros
xc = xc(1:length(x))

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by