Page 65 - Basics of MATLAB and Beyond
P. 65

fft        One-dimensional fast Fourier transform
                                  fft2       Two-dimensional fast Fourier transform
                                  fftn       N-dimensional fast Fourier transform
                                  fftshift   Move zeroth lag to centre of transform
                                  ifft       Inverse one-dimensional fast Fourier transform
                                  ifft2      Inverse two-dimensional fast Fourier transform
                                  ifftn      inverse N-dimensional fast Fourier transform
                                  abs        Absolute value (complex magnitude)
                                  angle      Phase angle
                                  cplxpair   Sort complex numbers into complex conjugate pairs
                                  nextpow2   Next power of two
                                  unwrap     Correct phase angles
                               The FFT of the column vector

                               y=[2010211 0]’;
                               is

                               >> Y = fft(y)
                               Y  =
                                  7.0000
                                 -0.7071+ 0.7071i
                                  2.0000- 1.0000i
                                  0.7071+ 0.7071i
                                  5.0000
                                  0.7071- 0.7071i
                                  2.0000+ 1.0000i
                                 -0.7071- 0.7071i

                               The first value of Y is the sum of the elements of y, and is the amplitude
                               of the “zero-frequency”, or constant, component of the Fourier series.
                               Terms 2 to 4 are the (complex) amplitudes of the positive frequency
                               Fourier components. Term 5 is the amplitude of the component at the
                               Nyquist frequency, which is half the sampling frequency. The last three
                               terms are the negative frequency components, which, for real signals, are
                               complex conjugates of the positive frequency components.
                                  The fftshift function rearranges a Fourier transform so that the
                               negative and positive frequencies lie either side of the zero frequency.
                                    Companion M-Files Feature 4 The function fftfreq gives
                                    you a two-sided frequency vector for use with fft and fftshift.
                                    For example, the frequency vector corresponding to an 8-point
                                    FFT assuming a Nyquist frequency of 0.5 is

                                    >> fftfreq(.5,8)’
                                    ans  =





                               c   2000 by CRC Press LLC
   60   61   62   63   64   65   66   67   68   69   70