next Spectrogram Computation
previous DFT Bin Response
up The DFT   Contents   Global Contents
global_index Global Index   Index   Search


DFT Matrix

The following example reinforces the discussion of the DFT matrix in §6.10. We can simply create the DFT matrix in Matlab by taking the FFT of the identity matrix. Then we show that multiplying by the DFT matrix is equivalent to the FFT:

>> eye(4)
ans =
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1

>> S4 = fft(eye(4))
ans =
   1.0000       1.0000               1.0000       1.0000          
   1.0000       0.0000 - 1.0000i    -1.0000       0.0000 + 1.0000i
   1.0000      -1.0000               1.0000      -1.0000          
   1.0000       0.0000 + 1.0000i    -1.0000       0.0000 - 1.0000i

>> S4' * S4          % Show that S4' = inverse DFT (times N=4)
ans =
    4.0000    0.0000         0    0.0000
    0.0000    4.0000    0.0000    0.0000
         0    0.0000    4.0000    0.0000
    0.0000    0.0000    0.0000    4.0000

>> x = [1; 2; 3; 4]
x =
     1
     2
     3
     4
>> fft(x)
ans =
  10.0000          
  -2.0000 + 2.0000i
  -2.0000          
  -2.0000 - 2.0000i

>> S4 * x
ans =
  10.0000          
  -2.0000 + 2.0000i
  -2.0000          
  -2.0000 - 2.0000i


next Spectrogram Computation
previous DFT Bin Response
up The DFT   Contents   Global Contents
global_index Global Index   Index   Search

``Mathematics of the Discrete Fourier Transform (DFT)'', by Julius O. Smith III, W3K Publishing, 2003, ISBN 0-9745607-0-7.

(Browser settings for best viewing results)
(How to cite this work)
(Order a printed hardcopy)

Copyright © 2003-10-09 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  (automatic links disclaimer)