|
|||||||||||||||||||
|
|
Understanding digital signal processing's frequency domain Nov 1, 2001 12:00 PM, By Richard Lyons RF engineers face many obstacles when learning digital signal processing (DSP). One major challenge is understanding how spectral components are defined and illustrated in the discrete frequency domain. When RF folk begin to read DSP literature, they encounter strange new terminology describing discrete spectra such as folding frequency, aliasing, orthogonal images, and Nyquist frequency. It's confusingTypical DSP spectral diagrams initially seem peculiar because they often show negative-frequency spectral components and what appear to be replicated spectral components. Making matters worse for the inquisitive RF engineer, various DSP authors use different, and sometimes puzzling, notation in labeling frequency axes in their spectral plots — the frequency dimension of hertz is often not used at all in discrete spectral diagrams. For example, many university DSP textbooks actually label the discrete frequency axis from p to +p. This perplexing frequency-domain terminology and notation originate from a kind of frequency ambiguity inherent in discrete (sampled) systems and the fact that in DSP, all signals are generally described as if they were complex (with real and imaginary parts). Understanding the differences between analog and discrete spectra is one of the reasons DSP has the reputation for being difficult to learn. Fortunately, several books have been published that ease the RF engineer's burden of learning DSP The short journey to understanding the math and notation of discrete spectra begins by discussing the frequency-domain ambiguity associated with discrete signals. It ends at the point of understanding all the subtle aspects, notations, and language of the DSP's discrete frequency domain. Briefs stops will be made along the way to review complex signals, negative frequency, and discrete spectrum analysis using Fast Fourier transforms (FFT). Frequency-domain ambiguityBegin by reviewing a source of one difficulty: the frequency-domain ambiguity that exists when digitizing a continuous (analog) signal x(t) with an analog-to-digital (A/D) converter (see Figure 1). This process samples the continuous x(t) signal to produce the x(n) sequence of binary words stored in the computer for follow-on processing. (Variable ‘n’ is a dimensionless integer used as the independent time-domain index in DSP, just as the letter ‘t’ is used in continuous-time equations.) The x(n) sequence represents the voltage of x(t) at periodically spaced instants in time. This process is called periodic sampling. The time period between samples is designated as t Looking at an example (see Figure 2), consider the effect of sampling a 400 Hz sinusoidal x(t) waveform at a sampling frequency f The frequency-domain ambiguity under review here is illustrated in Figure 2(b), where the x(n) samples would be unchanged if the A/D's x(t) input was a 1400 Hz continuous sinusoid. Another example is shown in Figure 2(c), where the continuous x(t) is a -600 Hz sinusoid, again resulting in identical x(n) samples. This means that, given the x(n) samples alone, it cannot be determined whether the continuous x(t) sinewave's frequency was 400 Hz, 1400 Hz, or -600 Hz. That uncertainty is the frequency-domain ambiguity. (The concept of negative frequency will be justified later. For now, the definition of the -600 Hz sinewave is one whose phase is shifted by 180° relative to a +600 Hz sinewave.) Based on the previous discussion, it is reasonable to assume that there are an infinite number of other frequencies that a sinusoidal x(t) could have, and still result in the same x(n) samples of Figure 2. Those other frequencies, defined as images with frequencies f where k is an integer, and the ‘i’ subscript means image. Equation(1) indicates that any continuous sinewave whose frequency differs from 400 Hz by an integer multiple of f When the pioneers of DSP discovered and understood this frequency-domain ambiguity they were faced with the questions of what terminology to use in its description and how discrete spectral diagrams should be drawn. One reasonable frequency-domain depiction of this situation is shown in Figure 3(b), where it can be said that the spectrum of our discrete x(n) sequence is an infinite set of spectral impulses periodically spaced in the frequency domain. (Mathematical proofs justifying Figure 3(b) are available Keep three thoughts in mind: First, the notion that the spectrum of the discrete x(n) sequence is an infinite set of spectral impulses does not imply that x(n) has infinite energy. Those multiple impulses in Figure 3(b) merely indicate that x(n) could be a sampled (discrete-time) version of any one of infinitely many continuous sinewaves. Second, resist the temptation to call those spectral impulses harmonics. The word harmonic has a specific meaning in the analog world — related to spurious tones generated by nonlinear hardware components — that is not implied by Figure 3(b). For now, define those frequency-domain impulses as spectral replications. Third, notice that the spacing between the spectral replications is the sampling rate f The next step is to make the discrete spectral diagram more accurate and consistent with real-world signals by tackling the concepts of complex (quadrature) signals and negative frequency. This issue is critical because so much of DSP deals with complex numbers such as the complex-valued (magnitude and phase) spectra of discrete time-domain sequences, the complex-valued frequency responses a digital filters, and the complex signals needed to build modern digital communications systems. Complex signals and road mapsFor this discussion, the focus is on a complex signal having a real and an imaginary part that is a function time. Recall, as Karl Gauss first recommended, a single complex number can be represented by a point on the two-dimensional complex plane with its two axes (real and imaginary) orthogonal to one another. This means there is a 90° difference in the axes' orientations. Consider a complex number whose magnitude is one, and whose phase angle increases with time. That complex number is the e Because complex numbers can be represented in both polar and rectangular notation, the polar e Equation (2) indicates that as e The attributes of our two-dimensional e That e Next, coax cables labeled ‘cosine’ for the cosine signal and ‘sine’ for the sinewave signal are connected to the generators' output connectors and ran down the hall to their destination. At the receiving end in the other lab, connect the real signals to the horizontal and vertical input channels of an oscilloscope (see Figure 6). The signals would show as rotating counterclockwise in a circle on the scope's display. (Remembering, of course, to set the scope's horizontal sweep control to the ‘external’ position.) This oscilloscope example helps us answer the important question, “When working with quadrature signals, how is the j-operator implemented in hardware?” The answer is that the j-operator is implemented by how the two real signals are treated in relation to one another. They must be treated orthogonally such that the cosine signal represents the real (east-west) value, and the sinewave signal represents the imaginary (north-south) value. So in the oscilloscope example, the j-operator is implemented merely by how the connections are made to the scope. The result is a two-dimensional quadrature signal represented by the instantaneous position of the dot on the scope's display. (If the instantaneous phase of the e OK, back to business — at this point the question may arise, “Where does the idea of negative frequency come in here?” Well, there's a “negative frequency” signpost up ahead, and the answer lies just up the road. Don't negate negative frequenciesThe notion of negative frequency is often troubling to RF engineers who have spent so much time examining the spectra displayed on analog spectrum analyzers. Some RF engineers think of frequency, by its very nature, as something that cannot be negative — such as getting into a car and driving minus ten miles. Negative frequency can be given a solid physical meaning by defining it properly in the context of complex, or quadrature, signals. Referring again to Figure 4, notice another complex exponential, e -j2pfot, the white dot, orbiting in a clockwise direction. This occurs because its phase angle, f= -2pfot, gets more negative as time increases. Again, if the frequency fo= 2 Hz, then the white dot would rotate around the circle two times, or two cycles, per second in the clockwise direction. By definition, it is the rotational frequency minus two cycles per second. The two complex exponentials in Figure 4 are of great interest because of what is obtained when they are combined algebraically. For example, what is the sum of the positive-frequency counterclockwise rotating e Equation (3) provides the ability to represent a real cosine wave as the sum of positive-frequency and negative-frequency complex exponentials. By previous definitions, a positive-frequency complex exponential's exponent is positive, and a negative-frequency complex exponential is one whose exponent is negative. Another Euler identity, Equation. (4), gives the relationship of a real sinewave as the sum of positive-frequency and negative-frequency complex exponentials. The j-operators in Equation (4) merely explain the relative phase of the complex exponentials at time t= 0 as illustrated in Figure 7. At time t= 0, Equation (4) becomes: complying with our knowledge that a sinewave's amplitude is zero at time t= 0. Don't worry if these concepts of the j-operator and complex exponentials seem a little perplexing at this point. They take some time to get used to. (Even the great Karl Gauss struggled with these ideas at first. He called the j-operator “the shadow of shadows.”) Back on trackRemember that the ultimate goal is to understand the nature of the spectral diagrams used in DSP. In doing so, it was necessary to define the notion of negative frequency. That definition is inherent in the complex-valued (real and imaginary) representation used for discrete spectra in DSP. Unlike the amplitude-only results seen when using an analog spectrum analyzer, in the DSP world spectrum analysis provides complex-valued results. That is, discrete spectra show the relative phase shift between spectral components. Yet more complexitiesFor the following discussion, refer to the complex spectra of a few simple sinusoids, from the viewpoint of Euler's identities, as shown in Figure 8. The time-domain waveform and the complex spectra of a sinewave defined by sin(2pf Remember now, the positive and negative-frequency spectral components of the sinewave rotated counterclockwise and clockwise, respectively, by 90° in going from Figure 8(a) to Figure 8(b). If those cosine waves' spectral components continued their rotation by f°, the result will be the situation shown in Figure 8(c). These three-dimensional frequency-domain spectra are shown replete with phase information because, in the world of DSP, interest in spectral phase relationships should be observed. The FFT algorithm is used to measure spectral magnitude and phase the way an RF engineer uses a network (vector) analyzer. (Note that Figure 8 illustrates an important signal processing principle. A time-domain shift of a periodic signal results only in phase shifts in the frequency domain; spectral magnitudes do not change.) The top portion of Figure 8 illustrates Equation (3) and the center portion is a graphical description of Equation (4). The goal is now looming on the horizon. Figure 8 is a reminder that one legitimate, and useful, way to show the spectrum of a real cosine wave — one that could be transmitted using a 50W coax cable — is to include both positive and negative-frequency spectral components. With this thought in mind, refer to the drawing of the spectral magnitude (ignoring any phase information) of a continuous 400 Hz sinusoid as shown in Figure 9(a). This figure shows the inherent spectral symmetry at about 0 Hz when representing real signal spectra with complex exponentials. In this case, “real signal” is defined by an x(t) signal having a non-zero real part but whose imaginary part is always zero. (Convention developed in this article treats all signals as complex and regards real signals as a special case of complex signals.) Figure 9(a) is another graphical representation of Euler's identity in Equation (3). Applying this convention of “spectral replications due to periodic sampling,” to this analysis illustrates the spectral magnitude of discrete samples of a 400 Hz sinusoid, sampled at an f Finally, closing the loop, Figure 9(b) is typical of the spectral magnitude representations used in the DSP literature. It combines the spectral replications (centered about integer multiples of f To further cement the concept, a review of the spectrum of another discrete sequence is presented. Figure 10(a) shows the spectral magnitude of a continuous x(t) signal having four components in the range of 100 Hz to 700 Hz . Dark and light squares distinguish the positive- and negative-frequency spectral components. Figure 10(b) shows the spectral replication for a discrete x(n) sequence that's x(t) sampled at 2 kHz. The sole purpose of this article is to provide the meaning, relevance, and validity of Figure 10(b) in representing the spectrum of discrete samples of a real sinusoid in the complex-valued world of DSP. This figure is a reminder of the following important properties: Continuous real signals have spectral symmetry of about 0 Hz, and discrete real signals have spectral symmetry of about 0 Hz and f Figure 10 illustrates the reason that Nyquist Criterion for lowpass signals — signals whose spectral components are centered about 0 Hz — states that the f This situation is typically called aliasing, and it results in x(n) sample values that contain amplitude errors. Unfortunately, for meaningful, information-carrying signals, there is no way to correct for those errors. It can be seen that the spectral overlap is centered about f The purpose for showing replicated spectra, as in Figure 10, is not to cause complication or confusion, but to provide a straightforward explanation for the effects of overlapped spectra due to aliasing. Drawing replicated spectra is useful in illustrating the spectral translation that takes place in bandpass sampling, and describing the result of frequency translation operations such digital downconversion. With that said, this article concludes with an explanation of the various, and sometimes puzzling, notation used in frequency-axis labeling encountered.
For convenience, frequency-domain drawings in the DSP world are often labeled using the f Another example of referencing discrete frequency-domain plots to the f DSP authors have several choices in labeling the frequency axis of their frequency-domain plots. Some reference their frequency-axis to the f A common scheme for labeling the discrete frequency axis normalizes all frequencies to the f then, with the factors 2pf where q While it takes DSP beginners some time to become comfortable with these various frequency-axis notations, commercial signal processing modeling software packages, like SystemView, Mathcad, and MATLAB, allow for convenient labeling of the frequency-domain plots in hertz. This discussion has reviewed the graphical depictions and terminology of DSP to explain the differences between continuous (analog) and discrete spectrum analysis with regard to spectral replications and the idea of negative frequency. The use of spectral replications in DSP diagrams is a way of accounting for the inherent frequency-domain ambiguity when performing periodic sampling of a continuous signal. These replications provided a consistent explanation for errors due to aliasing, and illustrated that the spectral replications should not be interpreted as harmonics. The use of Euler's identities relating real-only signals and complex exponentials lead to a definition of negative frequency that allows the representation of all signals in complex notation. (Thankfully, the developed definition for negative frequency did not violate past experience in analog RF signal processing.) However, three-dimensional time and frequency domain drawings were required to give a solid physical meaning to those complex signals in the time domain and to show the relative phase of their spectral components. Finally, the relationship between four popular methods for labeling the frequency axis in the world of DSP were defined and reviewed. References
Pop quiz:
Q. What would be seen on the scope's display if the cables were mislabeled and the two real signals were inadvertently swapped? A. Another circle orbiting in a clockwise direction.
About the author
Richard Lyons is a consulting systems engineer and lecturer with Besser Associates in Mt. View, CA. He has been the lead hardware engineer for numerous multimillion dollar signal processing systems for both the National Security Agency (NSA) and TRW. An experienced lecturer and instructor at the University of California Santa Cruz Extension, Lyons has delivered signal processing seminars and training courses throughout the United States and Europe. He has written numerous articles on DSP topics, and wrote the best-selling DSP book “Understanding Digital Signal Processing.” Lyons is a member of the IEEE, Eta Kappa Nu, the electrical engineering honor society, and rides a 1981 Harley Davidson. He can be contacted at: |
|
|||||||||||||||||||||||||||
| Back to Top |