by Barry Van Veen
Frequency is a pervasive concept in signal processing. New comers to signal processing are often comfortable with the idea of frequency for continuous-time signals. For example, they may know that frequency is measured in units of Hertz (Hz) or cycles per second. Many are aware that the range of human hearing is from 20 Hz at the very low end to as high as 20 kHz or that the AC (alternating current) power at the wall outlet is nominally 60 Hz - in the United States. However, processing signals in a computer involves sampling continuous-time signals to produce a sequence of numbers, or a discrete-time signal. Frequency for discrete-time signals is measured in different units and has several distinct attributes. Effectively working with discrete-time signals requires being able to convert between the two types of frequency.
Converting Between Continuous- and Discrete-Time Frequency
Sampling is the key factor in relating continuous- and discrete-time frequency. Suppose we take a continuous-time sinusoid of frequency Hz, , and sample it at intervals spaced by seconds to obtain a discrete-time sinusoid . It is typical to express a sinusoid of discrete-time frequency as . Note that in discrete time we almost always work with frequency in units of radians. The relationship between and is obtained by requiring samples of the continuous-time sinusoid to equal the discrete-time sinusoid, that is, . This reveals the golden relationship between continuous-time and discrete-time frequency :
This is a relationship worth permanently etching in your brain!
Let's run through a few examples. Suppose you have a continuous-time sinusoid with frequency 1000 Hz and sample it with a sampling frequency of 5000 Hz (so seconds). The frequency of the discrete-time signal is thus radians. If we change the sampling frequency to 4000 Hz, then the frequency of the discrete-time signal is radians. The discrete-time frequency of the sinusoid depends on both the frequency of the corresponding continuous-time sinusoid and the sampling interval .
Of course we can also use this relationship to convert from discrete-time to continuous-time frequency given the sampling interval . If the sampling frequency is 100 Hz ( seconds), then a discrete-time sinusoid with frequency radians corresponds to a continuous-time sinusoid of frequency Hz.
Non Uniqueness of Discrete-Time Sinusoids
Discrete-time sinusoids with different frequencies are only unique for frequencies within a interval. This is because sinusoids with a phase shift of are identical. Suppose we shift the frequency of a discrete-time sinusoid by radians: . The last equality follows from the fact that a cosine repeats every radians and is easy to verify by applying the formula for the cosine of a sum of angles. The important conclusion here is that shifting the frequency by radians produces the identical signal. This is also illustrated in the figure, which compares discrete-time sinusoids of frequency and radians.
The fact that discrete-time sinusoids are only unique for frequencies within a interval is the reason that discrete-time frequency in signal processing is usually assumed to be within the range to radians. When working with the discrete Fourier transform (DFT) we normally use the range to radians. The behavior within these ranges is repeated for all frequencies outside them - because the sinusoids are identical - so there is no need to consider other frequency ranges.
Indexing Discrete-Time Frequency by the DFT
We often need to know the frequency corresponding to a particular DFT coefficient. The DFT expresses a finite-length discrete-time signal as a sum of sinusoidal components whose frequencies are equally spaced on the interval to radians. If the length of the DFT is samples, then the DFT frequencies are spaced by radians. Thus, the DFT coefficient is associated with discrete-time frequency radians for .
We can easily convert the DFT frequency index to a corresponding continuous-time frequency using the formula or . This is particularly useful when performing spectral (or frequency) analysis of sampled signals. If , then the corresponding continuous-time frequencies are Hz.
For More Information
Check out the lesson on sinusoidal signals. We also have a free e-book Maintaining Harmonious Frequency Relationships available that goes into much greater detail on this topic. Mastering several simple relationships will keep you from making all-too-common mistakes when dealing with the different frequency types in signal processing.