<< Chapter < Page | Chapter >> Page > |
To see how this works, consider the first few columns. is a vector of all ones; it is the zero frequency sinusoid, or DC. is more interesting. The element of is , which means that as goes from 0 to , the exponential assumes uniformly spaced points around the unit circle. This is clearer in polar coordinates, where the magnitude isalways unity and the angle is radians. Thus, is the lowest frequency sinusoid that can be represented (other than DC); it is the sinusoid that fitsexactly one period in the time interval , where is the distance in time between adjacent samples. is similar, except that the element is . Again, the magnitude is unity and the phase is radians. Thus, as goes from 0 to , the elements are uniformly spaced points which go around the circle twice.Thus, has frequency twice that of , and it represents a complex sinusoid that fits exactly two periods into thetime interval . Similarly, represents a complex sinusoid of frequency times that of ; it orbits the circle times and is the sinusoid that fits exactly periods in the time interval .
One subtlety that can cause confusion is that the sinusoids in are complex valued, yet, most signals of interest are real. Recall from Euler's identities [link] and [link] that the real-valued sine and cosine can each be written as a sum of two complex valued exponentials that have exponents with opposite signs.The DFT handles this elegantly. Consider . This is
which can be rewritten as
since . Thus, the elements of are identical to the elements of , except that the exponents have the opposite sign, implying that the angle of the entry in is radians. Thus, as goes from 0 to , the exponential assumes uniformly spaced points around the unit circle, in the opposite direction from . This is the meaning of what might be interpreted as “negative frequencies”that show up when taking the DFT. The complex exponential proceeds in a (negative) clockwise manner around the unit circle, ratherthan in a (positive) counterclockwise direction. But it takes both to make a real valued sine or cosine, as Euler's formula shows. For real valued sinusoids of frequency , both and are nonzero and equal in magnitude. Since by the discrete version of the symmetry property [link] , the magnitudes are equal but the phases have opposite signs.
Which column represents the highest possible frequency in the DFT? What do the elements of this column look like?Hint: Look at and think of a square wave. This “square wave” is the highest frequency that can be representedby the DFT, and occurs at exactly the Nyquist rate.
Fortunately, M
atlab makes it easy to do spectral analysis
with the DFT by providing a number of simple commandsthat carry out the required calculations and manipulations.
It is not necessary toprogram the sum
[link] or the matrix multiplication
[link] . The single line commands
W
=
fft
(
w
)
and
w
=
ifft
(
W
)
invoke efficient FFT (and IFFT)
routines when possible, and relatively inefficientDFT (and IDFT) calculations otherwise. The numerical idiosyncrasies
are completely transparent, with one annoying exception.In M
atlab , all vectors, including
W
and
w
, must
be indexed from 1 to
instead of from 0 to
.
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?