How to do ifft to data derived in frequency domain
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello everybody,
I have some signal values derived in the frequency domain and I would like to derive also the corresponding values in time domain. Which is the best way to do it using the ifft matlab function?
Thanks in advance. Pete
댓글 수: 1
Dishant Arora
2014년 11월 10일
Please elaborate what you want to do, what do you mean by best way? There's a one to one correspondence between fft and it's inverse, so just take inverse using ifft.
채택된 답변
Eric
2014년 11월 10일
편집: Eric
2014년 11월 10일
I'm going to assume you have a vector f which is the frequency sampling vector and a signal s. Assuming s is in a centered coordinate system you can use the following:
assert(length(f)==length(s),'Lengths are not the same!');
delta_t = 1/(max(f)-min(f));
N = length(f);
t = (-fix(N/2):fix((N-1)/2)) * delta_t;%Works whether N is odd or even
g = fftshift(ifft(ifftshift(s)))*sqrt(numel(s));
The idea with the temporal sampling vector t is that the sampling width in the temporal domain is equal to the reciprocal of the length of the signal in the frequency domain. You then need to construct a vector t with that sampling such that the appropriate element is zero. When N is odd then the zero element is in the middle. When N is even the N/2 + 1 element is zero (i.e., there is one more negative value than positive).
The multiplication by sqrt(numel(s)) ensures that energy is conserved (see Parseval's Theorem). This normalization factor is dependent upon the particular definition Matlab uses for ifft. Other software platforms will require different normalization factors.
See my answer at http://www.mathworks.com/matlabcentral/answers/158434-about-frequency-in-fft for why I use the fftshift and ifftshift in this manner. The short answer is that, for the case where you're working in centered coordinate systems, it provides the correct phase.
Good luck,
Eric
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
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!