The algorithm for ifft(X) is the same as the algorithm
for fft(X), except for a sign change and a scale factor
of n = length(X). As for fft, the execution
time for ifft depends on the length of the transform.
It is fastest for powers of two. It is almost as fast for lengths that have
only small prime factors. It is typically several times slower for lengths
that are prime or which have large prime factors.
以上是matlab帮助中的一段话
下面是我看到一个ifft.m的代码,不知道是否是matlab自带的
- % IFFT.M
- % IFFT IFFT(X) is the inverse discrete Fourier transform of
- % vector X. IFFT(X,N) is the N-point IFFT, where N must
- % be a power of 2. See also FFT, FFT2, IFFT2.
- %
- % ---------------------------------------------------------------
- %
- % COPYRIGHT : (c) NUHAG, Dept.Math., University of Vienna, AUSTRIA
- % http://nuhag.eu/
- % Permission is granted to modify and re-distribute this
- % code in any manner as long as this notice is preserved.
- % All standard disclaimers apply.
- %
- function y = ifft(x,nfft)
- %IFFT IFFT(X) is the inverse discrete Fourier transform of
- % vector X. IFFT(X,N) is the N-point IFFT, where N must
- % be a power of 2. See also FFT, FFT2, IFFT2.
- % J.N. Little 4-21-85
- % Revised 6-11-88 JNL
- % Copyright (c) 1985-88 by the MathWorks, Inc.
- if nargin == 2
- y = conj(fft(conj(x),nfft));
- else
- y = conj(fft(conj(x)));
- end
- [m,n] = size(y);
- if m == 1
- m = n;
- end
- y = y/m;
复制代码 |