The Nyquist Sampling Theorem

The Nyquist
Sampling Theorem
Gary W. Hecht
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Benefits of Sampling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Examples of the use of Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
An Introduction to Fourier Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Multiplication of Two Sinusoids. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Time-domain and Frequency-domain Representations of Sampling. . . . . . 10
A More General Example of the Sampling/Reconstruction Process . . . . . . 15
Frequency-domain Representation of the Analog Input Signal . . . . . . . . . . 17
Frequency-domain Representation of the Sampling Switch. . . . . . . . . . . . . 17
Frequency-domain Representation of the Sampled Signal . . . . . . . . . . . . . 18
Using a Low-pass Filter to prevent Aliasing. . . . . . . . . . . . . . . . . . . . . . . . . . 25
Further discussion of the Sinusoids in the Sampled Signal. . . . . . . . . . . . . 25
Gary Hecht
The Nyquist Sampling Theorem
Introduction:
In 1841 the French mathematician, Augustin Cauchy, discussed the concept of recreating the
graph of a time-varying waveform using just periodic "samples" of the original graph. However, he
did not develop a complete theory that could be used to predict the limitations of using periodic
samples of a waveform to recreate the original waveform.
In 1928 Harry Nyquist of Bell Telephone Laboratories (“Bell Labs”) presented to the American
Institute of Electrical Engineers a paper entitled "Certain topics in telegraph transmission theory."
In this paper he laid the groundwork for how samples of a time-varying signal could be used to
exactly recreate the original signal, if certain conditions are met. In 1949 Claude Shannon, also of
Bell Labs, wrote a paper entitled "Communication in the presence of noise" where he presented
the first formal proof of the general concept presented by Nyquist. The conditions specified by
Nyquist for recovering the original signal from samples of the signal are now known as the Nyquist
Sampling Theorem, or as the Nyquist-Shannon Sampling Theorem.
The ability to recreate a signal from samples of the signal is quite useful in the field of electronics.
One of the first uses pertained to using a single communications channel for the sending/receiving
of multiple telegraph messages at the same time.
The Nyquist Sampling Theorem states:
If a time-varying signal is periodically sampled at a rate of at least
twice the frequency of the highest-frequency sinusoidal component
contained within the signal, then the original time-varying signal
can be exactly recovered from the periodic samples
This theorem presents a powerful and useful conclusion. Imagine a graph of a time-varying analog
quantity (e.g., an electronic ‘signal’). Further imagine that you write down the height (the "y" value)
of the graph at evenly spaced intervals along the time axis (i.e., "samples" of the graph). An
example of a time-varying analog quantity being sampled at evenly spaced intervals is shown
below.
●
●
●
●
●
●
●
●
●
0●
●
●
●
●
●
●
time
●
●
●
Figure 1. A time-varying analog signal being periodically sampled
It seems reasonable that an approximation of the original graph can be constructed from the list of
height values (samples). However, the ability to exactly recreate the original graph from the
1
samples is surprising. The key parameter for exact recreation of the original graph is the distance
(i.e., the amount of time) between samples in relation to the maximum rate at which the graph
changes through time. As such, if the appropriate conditions are met, the original time-varying
analog quantity illustrated in the previous graph can be exactly reproduced from the sequence of
samples illustrated below. The last sample shown in the illustration below has a scale applied to it
so as to emphasize that the height of the samples can be expressed, if desired, as numerical
values (represented by ‘###’ for the sample shown). Expressing the height of the samples as
numerical values is commonly done in the modern digital age (e.g., audio CDs store samples of the
microphone voltage for a recording as numerical values).
●
●
●
●
●
●
●
●
0●
●
●
●
●
●
●
●
###
time
●
●
●
Figure 2. The periodic samples of a time-varying analog signal (if desired, the
height of any sample can be expressed as a numerical value)
Benefits of Sampling:
There are two major benefits of being able to accurately communicate a time-varying analog signal
using only periodic samples of the signal:
1. If a communications channel supports rapid transmission of individual samples, then once a
sample has been transmitted for a given signal, the communications channel can be used to
transmit samples for other signals until it is time to again transmit a sample for the first signal
(this is called "time-division multiplexing" (TDM) and requires that the receiver be able to
separate the samples appropriately so as to reconstruct the various independent signals)
(the telephone system uses this technique to multiplex numerous calls onto one trunk line)
2. If a communications channel inherently transmits information in a digital manner (e.g., using
bits), then converting the individual samples for a given signal to numerical values for
transmission represents the most direct method for communicating the time-varying analog
signal using an inherently digital-type communications channel
(imagine that the height of each of the samples shown in the previous graphs is expressed as a
numerical value)
(examples of systems that communicate analog information in a digital manner include CDs as
well as computers when used for storage, recording, and/or playback of audio/video
information)
Examples of the use of Sampling:
When you have a conversation with someone using the telephone, the connection between you
and the other person appears to be continuous. That is, you do not hear "gaps", or "breaks", in the
voice of the other person. However, the telephone system is, in reality, only communicating
"samples" of each person's voice to the other person. There is no continuous connection between
the two parties.
2
With POTS (plain old telephone service), the telephone system receives the time-varying analog
voltage from the microphone in the handset of a caller. This analog voltage varies at the same
frequency as the callers voice during any given time frame and has an amplitude that varies in
proportion to the amplitude of the caller's voice.
The telephone system then "bandlimits" this time-varying voltage to 3.5 kHz using a low-pass filter.
This allows the majority of the frequency components in a typical human voice to pass through the
low-pass filter. The amplitude of the output signal of the low-pass filter is then "sampled" 8000
times a second. Because of the convenience of digital communication, each of these amplitude
samples is converted into an 8-bit numerical value to represent the amplitude. These 8-bit
samples (8000 per second) are then communicated to the receiving end.
At the receiving end, the 8-bit samples (8000 per second) are converted back into corresponding
analog voltages. The resulting sequence of analog voltages is then applied to a low-pass filter with
a bandwidth of 3.5 kHz. The output of the low-pass filter is a time-varying voltage that is equivalent
to the bandlimited version of the caller's voice (i.e., the output of the low-pass filter at the
transmitting end).
As noted at the beginning of this example, telephone connections appear to be continuous
connections. There is no direct evidence to the caller that "gaps" in the connection are occurring
8000 times a second. However, POTS does not yield a "high-fidelity" type connection.
The lack of high-fidelity with POTS is not due to the inherent nature of sampling, but rather the
specifics of the sampling process used by the telephone system. The human ear is generally
capable of hearing sounds up to a frequency of approximately 20 kHz. If it is desired to sample a
signal that can contain frequency components up to 20 kHz, then the sampling rate must be at
least 40,000 samples per second.
This is five times the number of samples per second as compared to the telephone system. To
implement this sampling rate, the telephone system would have to devote more network resources
to each call, thus reducing the number of calls the network can support at one time.
Also, the telephone system uses 8 bits to define the amplitude of each sample. This defines each
amplitude to a resolution of one part in 256. It is generally considered that at least 16 bits are
needed to define the amplitude of each sample for high-fidelity (which defines each amplitude to a
resolution of one part in 64k). This leads to the "CD quality" sampling specification of 44,100
samples per second with 16 bits per sample.
Note that the "data rate" for POTS is:
(8000 samples/sec) • (8 bits/sample) = 64,000 bits per second
And the "data rate" for CD quality sound is (one channel):
(44,100 samples/sec) • (16 bits/sample) = 705,600 bits per second (for stereo, the data rate is
twice this value –
1,411,200 bits per second)
An Introduction to Fourier Series:
The presentation of the Nyquist Sampling Theorem uses both the time-domain and frequencydomain to illustrate what occurs at the various points in the process of sampling a signal and then
recreating the signal from the samples.
3
The time-domain presentations give an excellent intuitive feel for the signals at various points in the
process. However, the correctness of the Nyquist Sampling Theorem can be illustrated only in the
frequency-domain presentations.
To follow the presentation, the reader must understand the concept that any periodic waveform can
be equivalently expressed as some collection of simultaneous sinusoidal waveforms (i.e., sines
and cosines) that, instant-by-instant, add-up to the periodic waveform. This concept was
developed in 1807 by Jean Baptiste Fourier, a well-known French mathematician.
Fourier presented a method for determining what sinusoids are required to represent any given
periodic waveform (i.e., a waveform that repeats). This method is now called "Fourier series" since
the method is used to determine the "series" of sinusoids required to represent a periodic
waveform. It is significant to note that Fourier determined that any periodic waveform with a given
repetition frequency will only require sinusoids with frequencies that are integer multiples of the
frequency of the periodic waveform.
Fourier developed the “Fourier series” concept to enable him to better analyze the flow of heat
through various bodies and the resulting temperatures. The method of Fourier series has become
very useful in the electronics field. In particular, electronic circuits and systems are frequently
characterized by their "frequency response" to sinusoidal sources. As such, if a complex source
can be expressed as a series of simultaneously present sinusoidal waveforms, the response of the
circuit or system to that complex source can be determined.
Perhaps the most common example of Fourier series is the series required to equivalently express
a squarewave waveform. Assume a squarewave with an arbitrary frequency of ‘f’ and a peak
amplitude of 1 centered about the time axis. Further assume that the squarewave has a duty cycle
of 50 percent and goes from -1 to +1 at t = 0. Fourier's method can be used to determine that the
squarewave can be expressed with an infinite series of “harmonically related” sine waves (no
cosines required) with frequencies and peak amplitudes according to the following pattern:
Frequency:
f
3•f
5•f
7•f
9•f
11•f
.
.
Peak amplitude:
Name:
4/‫ ≈ ח‬1.27
4/(3‫ ≈ )ח‬0.42
4/(5‫ ≈ )ח‬0.25
4/(7‫ ≈ )ח‬0.18
4/(9‫ ≈ )ח‬0.14
4/(11‫ ≈ )ח‬0.12
.
.
"First harmonic" or "Fundamental"
"Third harmonic"
"Fifth harmonic"
"Seventh harmonic"
"Ninth harmonic"
"Eleventh harmonic"
Note that the series of sinusoids required to express the squarewave consist only of "odd"
harmonics. Also note that the required amplitude for each harmonic decreases with increasing
harmonic number. As such, the higher harmonics are not as critical for creating a squarewave as
the lower harmonics since the specified amplitudes decrease with increasing frequency (i.e.,
increasing harmonic number).
The next graph illustrates each of the following waveforms:
1. A sine wave with a peak amplitude of +/-1.27 that will be the lowest frequency sine wave
illustrated and, therefore, is the 1st harmonic (also known as the “fundamental”)
(note that two complete cycles of the 1st harmonic are shown in the graph)
4
2. A sine wave with a frequency of three times the frequency of the 1st harmonic (i.e., the 3rd
harmonic) with a peak amplitude of +/-0.42
(note that three complete cycles of the 3rd harmonic occupy the same amount of time as one
cycle of the 1st harmonic)
3. A sine wave with a frequency of five times the frequency of the 1st harmonic (i.e., the 5th
harmonic) with a peak amplitude of +/-0.25
(note that five complete cycles of the 5th harmonic occupy the same amount of time as one
cycle of the 1st harmonic)
4. The instant-by-instant sum of the 1st harmonic, 3rd harmonic, and 5th harmonic
Three Sinusoidal Components and Their Sum
1.5
Amplitude
1
0.5
0
-0.5
-1
-1.5
3rd harmonic
5th harmonic
Time
1st harmonic
Sum of harmonics
Figure 3. First three sinusoidal components for a 50% duty-cycle squarewave
Note that the sum of the harmonics is a graph that is a rough approximation of a squarewave with
a frequency equal to the first harmonic and a peak amplitude of +/-1.0. As more and more odd
harmonics are included, each having the appropriate amplitude, the sum of the harmonics would
more closely resemble a squarewave.
The graph below more clearly shows the comparison between a squarewave and the sum of the
first, third, and fifth harmonics (each harmonic with an amplitude as previously indicated).
1.5
Squarewave vs. Sum of 1st, 3rd, and 5th Harmonics
Amplitude
1
0.5
0
-0.5
-1
-1.5
Time
Figure 4. Comparison of a squarewave to the summation of the first three sinusoids for a squarewave
5
If the squarewave has a duty cycle that is less than or greater than 50 percent, then even
harmonics, as well as odd harmonics, will be required to express the waveform.
The above presentation used the “time domain” (i.e., the horizontal axis represents the progression
of time) to show the harmonics and their instant-by-instant sum. Another method for presenting
this information is the “frequency domain”. In the frequency domain the horizontal axis represents
a progression of frequencies of sinusoidal waveforms (where each frequency may, or may not, be
present) and the vertical axis represents the amplitude of any given sinusoidal waveform that is
present. For a particular sinusoidal waveform that is to be shown in the frequency domain, a
vertical line is drawn upward from a point on the horizontal axis that corresponds to the frequency
of the sinusoid where the height of the vertical line corresponds to the amplitude of the sinusoid.
The following frequency domain graph shows the frequencies and amplitudes of the first five
sinusoidal waveforms required to create a 50-percent duty cycle squarewave with a frequency of
2kHz and an amplitude of +/-1.0 (as per the Fourier Series representation for a squarewave).
Frequency Domain for a 2kHz Squarewave (first five harmonics)
1.4
1.2
Amplitude
1
0.8
0.6
0.4
0.2
0
0
1
2
3
4
5
6
7
8
9 10 11 12 13 14 15 16 17 18 19 20
Frequency (kHz)
Figure 5. Frequency-domain representation of a 2kHz squarewave (50% duty cycle)
Note that the above graph indicates the presence of the following sinusoidal waveforms:
1.
2.
3.
4.
5.
A sinusoidal waveform at 2kHz (1st harmonic) with a peak amplitude of +/-1.27
A sinusoidal waveform at 6kHz (3rd harmonic) with a peak amplitude of +/-0.42
A sinusoidal waveform at 10kHz (5th harmonic) with a peak amplitude of +/-0.25
A sinusoidal waveform at 14kHz (7th harmonic) with a peak amplitude of +/-0.18
A sinusoidal waveform at 18kHz (9th harmonic) with a peak amplitude of +/-0.14
The previously shown time-domain graphs correspond to what would be displayed on an
instrument known as an “oscilloscope” for the indicated waveforms. In a similar fashion, the above
frequency-domain graph corresponds to what would be displayed on an instrument known as a
“spectrum analyzer” for a 2kHz squarewave with a peak amplitude of +/-1.0 and a duty cycle of 50
percent. A spectrum analyzer gets its name from the fact that it shows the ‘spectrum’ of sinusoidal
waveforms present on its input.
6
Multiplication of Two Sinusoids:
When two sinusoids are multiplied together, each with its own frequency, two new sinusoids are
created by the multiplication process – one at a frequency equal to the sum of the frequencies of
the two sinusoids that were multiplied together and another at the difference frequency. This
characteristic is extremely important in electronics. The basis for this result is developed below.
The following is a trigonometric identity that has important applications in electronics:
sin(x)•cos(y) = 0.5•[sin(x + y)] + 0.5•[sin(x - y)]
In electronics, both the ‘x’ and ‘y’ in the above trigonometric identity are usually not some fixed
angle (e.g., 25 degrees) but instead describe a time-varying angle so that the sin and cos
functions describe a sine wave, and a cosine wave, as time progresses. In this situation, the
‘x’ and ‘y’ values above represent the following (note that ‘f1’ and ‘f2’ are the ‘frequency’ values for
each of two sinusoids):
x = 2•‫•ח‬f1•t
where ‘f1’ is a specified value and ‘t’ is the time variable
y = 2•‫•ח‬f2•t
where ‘f2’ is a specified value and ‘t’ is the time variable
Substituting these expressions into the identity yields:
sin(2‫ח‬f1t)•cos(2‫ח‬f2t) = 0.5•[sin(2‫ח‬f1t + 2‫ח‬f2t)] + 0.5•[sin(2‫ח‬f1t - 2‫ח‬f2t)]
= 0.5•[sin(2‫{ח‬f1 + f2}t)] + 0.5•[sin(2‫{ח‬f1 - f2}t)]
This final form tells us the following: If a sine wave of a given frequency is multiplied by a
cosine wave of, in general, some other frequency, the result will be two, one-half amplitude,
sine waves where the frequency of one will be the sum of the frequencies of the original
sine waves and the other will have a frequency equal to the difference of the frequencies of
the original sine waves. An example of this is illustrated below:
Figure 6. The result of multiplying a sinusoid with another sinusoid
6kHz Sine wave
0.5
times
0
-0.5
0
-0.5
-1
Time
Amplitude
1
equals
0.5
7kHz Sine wave
1
0.5
plus
0
-0.5
-1
Time
Amplitude
-1
1kHz Cosine wave
1
Amplitude
Amplitude
1
0.5
0
-0.5
-1
Time
7
5kHz Sine wave
Time
5kHz Sine wave + 7kHz Sine wave
Amplitude
1
equals
This graph shows the instant-by-instant
sum of the 5kHz sine wave and the 7kHz
sine wave
0.5
0
-0.5
-1
Time
The above graphs illustrate the result of the process of multiplying one sinusoidal waveform by
another sinusoidal waveform. The result consists of two sinusoidal waveforms with ‘new’
frequencies. This process of multiplying one sinusoidal waveform with another sinusoidal
waveforms and creating new frequencies is, in general, called “modulation”. Specifically, the
above example is similar to what occurs in “amplitude modulation” (i.e., AM) (the above example
specifically illustrates “suppressed-carrier AM” – where the 1kHz sinusoid represents the
information signal, the 6kHz sinusoid is the “carrier” frequency, and the resulting 5kHz sinusoid is
known as the “lower sideband” and the 7kHz sinusoid is known as the “upper sideband”).
The following frequency-domain graphs illustrate the same situation as the above time-domain
graphs. Note that sine waves and cosine waves cannot be distinguished from each other in the
frequency domain since they are both sinusoids and only the frequency and amplitude of any given
sinusoid is indicated in the frequency domain.
Figure 7. Frequency-domain representation of multiplying two sinusoids together
6kHz Sine wave
1
0.5
times
0
1kHz Cosine wave
0.5
0
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10
Frequency (kHz)
Frequency (kHz)
5kHz Sine wave + 7kHz Sine wave
Amplitude
1
equals
Amplitude
Amplitude
1
0.5
0
0 1 2 3 4 5 6 7 8 9 10
Frequency (kHz)
8
The next example will illustrate a situation very similar to the previous situation. Recall that we
assumed a 6kHz sine wave (f1) is multiplied by a 1kHz cosine wave (f2). Now we will add a 1.0 volt
DC “offset” to the 1kHz cosine wave. The equations for this situation are shown below:
sin(2‫ח‬f1t)•[1.0 + cos(2‫ח‬f2t)] = sin(2‫ח‬f1t) + sin(2‫ח‬f1t)•cos(2‫ח‬f2t)
= sin(2‫ח‬f1t) + 0.5•[sin(2‫ח‬f1t + 2‫ח‬f2t)] + 0.5•[sin(2‫ח‬f1t - 2‫ח‬f2t)]
= sin(2‫ח‬f1t) + 0.5•[sin(2‫{ח‬f1 + f2}t)] + 0.5•[sin(2‫{ח‬f1 - f2}t)]
The result of the above equation is illustrated in the time-domain graphs below using the
assumption f1 = 6kHz and f2 = 1kHz (same as in previous example):
Figure 8. Time-domain representation of a sinusoid times another sinusoid that has a dc offset
6kHz Sine wave
0.5
times
0
DC + 1kHz Cosine wave
2
Amplitude
Amplitude
1
-0.5
-1
1
0
-1
-2
Time
Time
Amplitude
2
equals
This graph shows the instant-by-instant
sum of:
1. A 6kHz sine wave (amplitude = 1.0)
2. A 5kHz sine wave (amplitude = 0.5)
3. A 7kHz sine wave (amplitude = 0.5)
1
0
-1
-2
Time
This same situation is now presented in the frequency domain (note that the DC voltage is shown
in the frequency domain as a signal at zero frequency – which is indeed a constant amplitude
signal):
Figure 9. Frequency-domain representation of a sinusoid times another sinusoid that has a dc offset
6kHz Sine wave
0.5
1
times
0
Amplitude
Amplitude
1
DC + 1kHz Cosine wave
0.5
0
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10
Frequency (kHz)
Frequency (kHz)
9
Amplitude
1
equals
0.5
0
0 1 2 3 4 5 6 7 8 9 10
Frequency (kHz)
The above situation corresponds to a modulation method known as “amplitude modulation” (i.e.,
AM) where a DC voltage is added to an information signal (the 1kHz cosine wave in this example)
and then multiplied by a higher frequency “carrier” (the 6kHz sine wave in this example). The
result of the multiplication process is, in general, the following:
1. The carrier frequency (e.g., the 6kHz sine wave in this example)
2. A “lower sideband” sinusoid at a frequency equal to the carrier frequency minus
frequency of the information signal at one-half amplitude (e.g., the 5kHz sine wave in
example)
3. An “upper sideband” sinusoid at a frequency equal to the carrier frequency plus
frequency of the information signal at one-half amplitude (e.g., the 7kHz sine wave in
example)
the
this
the
this
Time-domain and Frequency-domain Representations of Sampling:
The next example directly corresponds to the process of sampling a signal (the prior examples
illustrated fundamental concepts that are needed for understanding the example that follows). As
with the prior examples, we begin with an illustration in the time domain.
The first time-domain graph (see below) illustrates an 8kHz pulse waveform with a DC offset such
that the waveform alternates, through time, between a value of 0 and a value of 1. Note that the
waveform illustrated has a relatively low “duty cycle” (i.e., the waveform is at the 1 level for a
relatively small percentage of a complete cycle of the pulse waveform). Specifically, the graph is
illustrating a duty cycle of approximately 25 percent for the pulse waveform.
The illustration shows the pulse waveform being multiplied with a 2kHz sine wave. For all the time
periods where the pulse waveform has a value of 0, the result of the multiplication process will be
0, regardless of the value of the 2kHz waveform during that period of time. Conversely, for all the
time periods where the pulse waveform has a value of 1, the result of the multiplication process will
be equal to the value of the 2kHz waveform during that period of time.
Figure 10. Sampling a 2kHz sinusoid using multiplication
1
1
times
0.5
0
Amplitude
Amplitude
8kHz Pulse waveform with Offset
2kHz Sine wave
0.5
0
-0.5
-1
Time
Time
10
Amplitude
1
equals
Samples of 2kHz Sine wave
0.5
0
-0.5
-1
Time
The result of the multiplication process (see above) shows short periods of time where the result of
the multiplication process is equal to the corresponding value of the 2kHz sine wave during each of
the short periods of time. These short periods of time where the result is equal to the 2kHz sine
wave correspond to the periods of time where the pulse waveform has a value of 1 (i.e., 1 times
any value equals the value). During all other periods of time, the result of the multiplication
process is a value of 0. These periods of time correspond to the periods of time when the pulse
waveform has a value of 0 (i.e., 0 times any non-infinite value equals 0).
It is important to note that the 8kHz pulse waveform is, in effect, causing the 2kHz sine wave to be
sampled at a rate of 8000 samples per second (i.e., the frequency of the pulse waveform
determines how many times per second that the pulse waveform is at a value of 1).
The time-domain graphs presented above illustrate a particular method for achieving the sampling
process. Specifically, the graphs illustrate the use of a carefully designed pulse waveform along
with the multiplication operator for creating a sampling process (i.e., the 2kHz sine wave is
periodically sampled by the 8kHz pulse waveform). An electronic circuit can be easily built that
emulates the above process.
The next series of graphs will illustrate the same situation presented above, but in the frequency
domain. The first graph shows the frequency spectrum for the 8kHz pulse waveform with DC
offset. Note that the graph shows the presence of a DC offset (i.e., a component at 0 frequency)
with a value of approximately 0.25. Without the DC offset, the instant-by-instant addition of all the
sinusoids required to create a 25-percent duty-cycle pulse waveform would result in a pulse
waveform that switches between –0.25 and +0.75. As such, a DC offset is required to ‘elevate’ the
pulse waveform such that it switches between the values 0 and 1. Next, note that the first sinusoid
required to express the 8kHz pulse waveform is at a frequency of 8kHz with an amplitude of 0.47.
The next sinusoid required is at a frequency of 16kHz with an amplitude of 0.32, and so on.
Figure 11. Frequency-domain representation of a 25% duty-cycle 8kHz squarewave with dc offset
Amplitude
1
Spectrum of 8kHz Pulse waveform with DC Offset
0.5
0
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
Frequency (kHz)
11
The method known as Fourier Series was used to determine the specific value for the DC offset as
well as the frequencies/amplitudes of the sinusoids required to express the 8kHz pulse waveform.
The Fourier Series method requires, in general, the use of integral calculus which is beyond the
scope of this document. As such, the results of the Fourier Series method for the 8kHz pulse
waveform are presented without the details as to their determination. Note that the graph shows
sinusoids present at all harmonics of 8kHz up to the maximum frequency shown in the graph. For
clarity, the graph stops at 60kHz. However, sinusoids beyond 56kHz, at 8kHz intervals, are
present but have relatively low amplitudes and are not as significant as the harmonics shown in the
graph for expressing the 8kHz pulse waveform.
The next graph (see below) shows the frequency-domain representation of the 2kHz sine wave
with an amplitude of 1. Note that the frequency spectrum shows just the one sinusoidal component
at 2kHz.
Figure 12. Frequency-domain representation of a 2kHz sinusoid
Amplitude
1
2kHz Sine wave
0.5
0
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
Frequency (kHz)
Recall that in the time-domain representations of the 8kHz pulse waveform (with offset) and the
2kHz sine wave, it was apparent that multiplying the two waveforms resulted in a sampled version
of the 2kHz sine wave. We now have the frequency-domain representations for each of these
signals and it stands to reason that we can multiply the two frequency-domain representations (for
the 8kHz pulse waveform and the 2kHz sine wave) and the result of the multiplication process will
be the frequency-domain representation for the sampled signal.
The frequency-domain
representation of the sampled signal is simply another way of expressing the time-domain
representation shown earlier (i.e., they illustrate the same signal, but in two different ways).
The multiplication of the frequency-domain representations for the 8kHz pulse waveform (with
offset) and the 2kHz sine wave is illustrated on the next page. Again, the result of the multiplication
process is the frequency-domain representation for the sampled 2kHz sine wave.
12
Figure 13. Multiplication in the frequency domain
Spectrum of 8kHz Pulse waveform with DC Offset
Amplitude
1
0.5
0
0
2
4
6
8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
Fre que ncy (kHz )
times
2kHz Sine wave
Amplitude
1
0.5
0
0
2
4
6
8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
Fre que ncy (kHz )
equals
1*
Amplitude
1
2*
* See numbered notes below
Spectrum of Samples of 2kHz Sine wave
3*
3*
0.5
0
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
Frequency (kHz)
The lines with arrowheads are indicating how some of the sinusoidal components in the sampled
signal are created. Specifically:
1. [0.26 DC] times [2kHz sine wave with an amplitude of 1] = 2kHz sine wave (amplitude: 0.26)
2. [ 8kHz sinusoid with an amplitude of 0.47] times [2kHz sine wave with an amplitude of 1] =
6kHz sinusoid (amplitude: 0.235) and 10kHz sinusoid (amplitude: 0.235)
3. [16kHz sinusoid with an amplitude of 0.32] times [2kHz sine wave with an amplitude of 1] =
14kHz sinusoid (amplitude: 0.16) and 18kHz sinusoid (amplitude: 0.16)
Note that the multiplication of the 8kHz pulse waveform with the 2kHz sine wave requires the
multiplication of the 2kHz sine wave, one-by-one, with each of the components of the 8kHz pulse
waveform. This is due to the distributive property of multiplication where the 8kHz pulse waveform
is a sum of components. Furthermore, it was noted earlier in this document that when a sinusoidal
waveform is multiplied by another sinusoidal waveform, the result is two sinusoids – one at a
frequency equal to the difference of the frequencies of the two sinusoids being multiplied
13
together and the other at a frequency equal to the sum of the frequencies of the two sinusoids
being multiplied together. You should be able to see this result in the graph of the spectrum of the
sampled signal shown above (see notes 2 and 3 above).
There is a very important observation to be made concerning the last graph shown (i.e., the
spectrum of the sampled 2kHz sine wave). When all of the sinusoids of the sampled signal are
added together (15 components are shown in the last graph), instant-by-instant through time, the
result is the sampled version of the 2kHz sine wave as shown below (repeated from earlier):
Amplitude
1
Samples of 2kHz Sine wave
0.5
0
-0.5
-1
Time
However, note that the spectrum shown in the last graph for the sampled 2kHz sine wave includes
a 2kHz sinusoid. This sinusoid was created by the multiplication of the DC offset with the original
2kHz sine wave that was sampled. As such, the result of the multiplication process between the
8kHz pulse waveform and the 2kHz sine wave creates numerous sinusoids but includes a
sinusoid at 2kHz which is, in effect, a ‘clone’ of the original signal being sampled.
In other words, among all of the sinusoids that create the sampled signal shown in the time-domain
graph above, one of those sinusoids is the original signal being sampled as shown below:
Amplitude
1
2kHz Sine wave
0.5
0
-0.5
-1
Time
The question arises – how can we ‘recover’ the original signal being sampled from the sampled
version of the signal? The answer lies in the frequency-domain representation of the sampled
signal. Note that the first sinusoidal component in the sampled signal is at 2kHz. This component
was created by the multiplication of the DC offset in the pulse waveform with the 2kHz sine wave
being sampled creating, in effect, a clone of the signal being sampled. The next sinusoidal
component is at 6kHz and all other sinusoidal components are at frequencies above 6kHz.
There exists an electronic circuit known as a low-pass filter. An ideal low-pass filter will allow all
sinusoidal components that are below some specified frequency to pass through the filter and all
sinusoidal components that are above this specified frequency will be rejected. The frequency
where the low-pass filter changes from allowing sinusoids to pass through versus rejecting the
sinusoids is known as the ‘cutoff’ frequency (also known as the ‘3db down’ frequency).
14
For the sampled 2kHz sine wave that we have been considering, if we apply the sampled signal to
a low-pass filter with a cutoff frequency that is greater than 2kHz, but less than 6kHz, only the
2kHz sinusoid will pass through (where the 2kHz sinusoid is a clone of the original signal being
sampled). The ideal cutoff frequency for the low-pass filter, according to the Nyquist Sampling
Theorem, is one-half the frequency of the pulse waveform. As such, the low-pass filter should
have a cutoff frequency of 4kHz for the above example. This process is shown below:
Figure 14. “Reconstruction” of the 2kHz sinusoid from the samples
Amplitude
1
“Reconstruction” Filter
Samples of 2kHz Sine wave
0.5
Low-pass filter
Input
0
Output
Cutoff = 4kHz
-0.5
-1
Time
Note: The 2kHz sine wave
has an amplitude of 0.26
(see the discussion of the
spectrum of the sampled
signal on page 13)
Amplitude
0.3
2kHz Sine wave
0.15
0
-0.15
-0.3
Time
The low-pass filter in the above application is known as a “reconstruction” filter. This terminology is
used since this low-pass filter ‘reconstructs’ the original signal (i.e., the 2kHz sine wave) from the
sampled version of the signal.
A More General Example of the Sampling/Reconstruction Process:
The diagram below illustrates the overall sampling/reconstruction process. An Analog Input Signal
is applied to a “sampling switch” on the left side of the diagram. The sampling switch connects
either the Analog Input Signal or ground (0 volts) to the line labeled “Sampled Signal”.
Figure 15. The sampling, transmission, and reconstruction process
15
Recall that the sampling process was mathematically modeled earlier as multiplication of the signal
to be sampled by either 1 or 0 (i.e., multiplication by 1 during the time that the signal is to be
sampled and multiplication by 0 during the time that the signal is not being sampled). The
Sampling Switch in the above diagram is, in effect, performing multiplication of the Analog Input
Signal by either 1 or 0 to create the “Sampled Signal”.
After the Analog Input Signal has been sampled, the diagram illustrates that the samples can travel
directly, as periodic samples (i.e., analog voltage spikes), to the “reconstruction” filter at the
receiving end of the sampling process. When the samples are transmitted as periodic voltage
spikes (samples) of the Analog Input Signal, it is known as “pulse-amplitude modulation” (PAM).
However, as noted earlier in this document, each sample’s height can be converted into a
numerical value using a component known as an “analog-to-digital converter” (ADC) where the
numerical value, for each sample, is expressed using some number of bits. The bits for each
sample are then transmitted to the receiving end of the sampling process where the bits for each
sample are applied to the input of a component known as a “digital-to-analog converter” (DAC).
The DAC, in effect, recreates the original samples (the PAM signal). When the samples are
converted to numerical values that are then transmitted to the receiving end of the sampling
process, it is called “pulse-code modulation” (PCM).
At the receiving end of the sampling process, the “Sampled Signal” (PAM) is applied to the input of
a low-pass filter so as to “reconstruct” the Analog Input Signal from the samples (the “Sampled
Signal”). If the criteria of the Nyquist Sampling Theorem has been met, the output of the low-pass
filter will be identical to the Analog Input Signal.
Using the diagram above for a sampling system, a more general Analog Input Signal will now be
considered. Our goal is to understand the specifics of the Nyquist Sampling Theorem. Below is a
diagram that illustrates three “time-aligned” signals – (1) an example Analog Input Signal (one
overall cycle shown), (2) a waveform that mathematically models the sampling process, and (3) the
resulting “Sampled Signal” which contains periodic samples of the Analog Input Signal. Note that
the “Sampled Signal” is created by multiplying the Analog Input Signal, instant-by-instant, by the
value of the waveform that models the sampling switch (where the value is either 0 or 1). We can
clearly see that the “Sampled Signal” at least resembles the Analog Input Signal.
Figure 16. Sampling illustrated in the time domain
16
The time domain often seems like the natural way to view what occurs in the physical world.
However, there are times when the frequency domain yields more information about occurrences
in the physical world. The frequency domain is necessary for understanding the proof of the
Nyquist Sampling Theorem. As such, the above three signals (in the time domain) are again
presented, in the diagram below, along with the frequency-domain representation for each signal.
Each of the three frequency-domain representations will be discussed in detail.
Figure 17. Sampling illustrated in both the time domain and frequency domain
Frequency-domain Representation of the Analog Input Signal:
The Analog Input Signal, when viewed in the time domain, is clearly not a perfect sinusoid. As
such, the frequency-domain representation of the Analog Input Signal must contain two or more
sinusoids. For this example Analog Input Signal, for which one cycle is shown in the time domain
(and then it repeats), we will assume the Fourier Series representation (i.e., the frequency domain)
consists of four sinusoids whose frequencies are f1, f2, f3, and f4. Note that the amplitudes of these
four sinusoids decrease (the height of the vertical lines) as the frequency of the sinusoids increase
from f1 to f2 to f3 to f4. This is typical for most real-world signals – the amplitudes of the sinusoids
that make-up the signal decrease with increasing frequency of the sinusoids. A good example of
the decreasing amplitude with increasing frequency pattern is the 50-percent duty-cycle
squarewave whose frequency-domain sinusoidal amplitudes are given on page 4 of this document.
Frequency-domain Representation of the Sampling Switch:
The action of the Sampling Switch is being modeled by a waveform in the time domain that can be
described as a very low duty-cycle squarewave that has a value of 0 when the waveform is ‘low’
and a value of 1 when the waveform is ‘high’. This waveform is at the ‘high’ value for only a
17
relatively short time, per cycle, and then it is at the ‘low’ value for the remainder of the cycle, and
then the cycle repeats.
On page 4 of this document it was noted that the Fourier Series for a 50-percent duty-cycle
squarewave consists of sinusoids at all odd harmonics (i.e., odd multiples) of the frequency of the
squarewave. Determining the Fourier Series for any given repetitive waveform requires the use of
integral calculus – which is beyond the scope of this document. As such, it will be simply stated
that when the duty cycle of a squarewave becomes non-50 percent, sinusoids at most all
harmonics (i.e., even and odd) of the frequency of the squarewave will be needed for the Fourier
Series representation. Furthermore, if the duty cycle approaches 0 percent (or approaches 100
percent), the amplitudes of these harmonic sinusoids will decrease very slowly as the frequency of
the needed sinusoids increases (unlike most real-world signals).
As such, the frequency-domain representation for the very low duty-cycle squarewave, with
frequency fs, consists of sinusoids at frequencies fs, 2•fs, 3•fs, 4•fs, 5•fs, etc. Also, note that
the amplitudes of these harmonic sinusoids, in the middle portion of the diagram above (fs, 2•fs,
and 3•fs), are all shown with vertical lines of the same height (i.e., the same amplitudes).
If you add, instant-by-instant in time, a group of harmonically related sinusoids, the resulting
waveform will have periods of time when it will have a negative value and periods of time when it
will have a positive value. In our case we want the very low duty-cycle squarewave to have a value
of 0 or 1 (we want the ‘low’ value to be 0 and not a negative value). As such, we will need to add
some “dc offset” to the sinusoids to make the squarewave alternate between 0 and 1 instead of
between some negative number and a positive value (that would be less than 1). DC offset, in the
frequency domain, is represented by having an amplitude at zero frequency (a zero-frequency
sinusoid never changes in value – so it is a constant). The value of the dc offset is noted as ‘K’
in the frequency-domain representation for the squarewave that models the Sampling
Switch (see middle portion of Figure 17 on page 17).
Frequency-domain Representation of the Sampled Signal:
The frequency-domain representation of the Sampled Signal (bottom portion of Figure 17 on page
17) shows numerous sinusoids being present in the Sampled Signal. In a moment it will be shown
why all these sinusoids are present. But at this time it might be helpful to make the observation
that Henry Nyquist made back in the 1920s. All the numerous sinusoids in the Sampled Signal, if
added together, instant-by-instant in time, would add-up to what we see in the time domain for the
Sampled Signal. That is, we would have a waveform that runs along the 0 volt line for awhile, then
‘jumps up’ to a value equal to the Analog Input Signal at that instant, then ‘jumps’ back to the 0 volt
line and runs along the 0 volt line for awhile, then ‘jumps up’ to a value equal to the Analog Input
Signal at that instant, etc.
So, in the time domain, it is clear that the Sampled Signal contains periodic ‘snapshots’ of the
original Analog Input Signal (but apparently we have missing information between the ‘snapshots’).
If we look at the frequency-domain representation for the Analog Input Signal we see that it is
composed, in our example diagram, of four sinusoids: f1, f2, f3, and f4. If we now look at the
frequency-domain representation of the Sampled Signal we see numerous sinusoids – but you
should notice that certain critical sinusoids that define the Analog Input Signal are present at their
original frequencies. As such, if we remove (at the receiving end of the Sampled Signal) all the
other sinusoids from the Sampled Signal, we would be left with only the sinusoids that define the
Analog Input Signal. This will be discussed in greater detail in a moment.
18
It will now be demonstrated why the Sampled Signal contains the sinusoids illustrated in the bottom
portion of Figure 17 on page 17. In the following analysis, for simplification and clarity, we will
concern ourselves only with what sinusoidal frequencies are present – we will not concern
ourselves with the amplitudes (or relative phase shifts) of the sinusoids. Note that the sinusoid at
frequency f1 in the Analog Input Signal is properly defined as A1•sin(2π f1t + Θ1) where A1 is the
peak amplitude of the sinusoid, f1 is the frequency of the sinusoid, Θ1 is the phase shift of the
sinusoid, and t is the variable time. However, because we are only concerned with what sinusoidal
frequencies are present, the following analysis will simply refer to f1 and not the proper definition of
A1•sin(2πf1t + Θ1). This will make the analysis less cumbersome.
As such, the Analog Input Signal, for the example situation illustrated in the upper portion of Figure
17 on page 17, is defined (in the frequency domain) as the summation of four sinusoids:
Analog Input Signal = f1 + f2 + f3 + f4
Next, the waveform that models the Sampling Switch is defined (in the frequency domain) as:
Sampling Switch multiplication value = K + fs + (2fs) + (3fs) + …
(where ‘K’ is a dc offset)
We know from the time domain that when the Analog Input Signal is multiplied by the “Sampling
Switch multiplication value”, the result is the “Sampled Signal” (see Figure 17 on page 17):
Sampled Signal = (Analog Input Signal)•(Sampling Switch multiplication value)
Because the frequency domain is an alternative, but equivalent, method for describing what occurs
in the time domain, we can substitute the frequency-domain representations for the Analog Input
Signal and the Sampling Switch multiplication value as follows:
Sampled Signal = (f1 + f2 + f3 + f4) • (K + (fs) + (2fs) + (3fs) + …)
Since multiplication is commutative, it is somewhat helpful to reverse the order of multiplication:
Sampled Signal = (K + (fs) + (2fs) + (3fs) + …) • (f1 + f2 + f3 + f4)
We will now apply the distributive property such that the ‘K’ is distributed first, then the fs, etc.:
Sampled Signal = K•(f1) + K•(f2) + K•(f3) + K•(f4) + (fs)•(f1) + (fs)•(f2) + (fs)•(f3) + (fs)•(f4) +
(2fs)•(f1) + (2fs)•(f2) + (2fs)•(f3) + (2fs)•(f4) + (3fs)•(f1) + (3fs)•(f2) + (3fs)•(f3) + (3fs)•(f4)
+…
Note that the ‘K’ above represents a dc offset and, as such, is simply a number. Recall that ‘f1’ is
being used to represent A1•sin(2πf1t + Θ1) so K•(f1) (from the equation just above) truly means
K•(A1•sin(2πf1t + Θ1)) and, therefore, the ‘K’ only modifies the amplitude of the sinusoid at
frequency f1 – it does not modify the frequency of the sinusoid. Since we are only concerned with
what sinusoidal frequencies exist in the Sampled Signal, and not their amplitudes, we can remove
the four ‘K’s above, thus yielding:
Sampled Signal = f1 + f2 + f3 + f4 + (fs)•(f1) + (fs)•(f2) + (fs)•(f3) + (fs)•(f4) +
(2fs)•(f1) + (2fs)•(f2) + (2fs)•(f3) + (2fs)•(f4) + (3fs)•(f1) + (3fs)•(f2) + (3fs)•(f3) + (3fs)•(f4)
19
The first four terms in the above equation represent four individual sinusoids (f1 + f2 + f3 + f4).
However, all of the other terms in the above equation represent a sinusoid being multiplied by
another sinusoid (e.g., (fs)•(f1) represents a sinusoid at frequency fs being multiplied by a sinusoid
at frequency f1). We know that when two sinusoids are multiplied, the result is two sinusoids – one
at the sum frequency and one at the difference frequency. As such (using our simplified notation):
(fs)•(f1) = [fs + f1] + [(fs) – f1]
where
[fs + f1] represents a sinusoid at frequency fs + f1 and
[fs – f1] represents a sinusoid at frequency fs – f1
The result demonstrated in the equation just above will now be applied to each of the terms in the
equation for the Sampled Signal that contain sinusoidal multiplication (all terms except for the first
four terms). The result is:
Sampled Signal = f1 + f2 + f3 + f4 +
[fs + f1] + [fs – f1] + [fs + f2] + [fs – f2] + [fs + f3] + [fs – f3] + [fs + f4] + [fs – f4]
+
[(2fs) + f1] + [(2fs) – f1] + [(2fs) + f2] + [(2fs) – f2] + [(2fs) + f3] + [(2fs) – f3] + [(2fs) + f4] + [(2fs) – f4]
+
[(3fs) + f1] + [(3fs) – f1] + [(3fs) + f2] + [(3fs) – f2] + …
The sinusoids in the Sampled Signal equation above (line-by-line) can be summarized into the
following groups:
Sampled Signal = The original sinusoids in the Analog Input Signal (f1 + f2 + f3 + f4)
+
the original sinusoids in the Analog Input Signal as sum and difference frequencies about fs
+
the original sinusoids in the Analog Input Signal as sum and difference frequencies about 2fs +
the original sinusoids in the Analog Input Signal as sum and difference frequencies about 3fs +
etc.
And it is equally correct to say:
Sampled Signal = The original sinusoids in the Analog Input Signal (f1 + f2 + f3 + f4)
+
the original sinusoids in the Analog Input Signal as upper and lower sidebands around fs
+
the original sinusoids in the Analog Input Signal as upper and lower sidebands around 2fs +
the original sinusoids in the Analog Input Signal as upper and lower sidebands around 3fs +
etc.
You should now be able to relate the descriptions above, as well as the detailed equation given for
the Sampled Signal, to the frequency-domain representation for the Sampled Signal shown in the
lower portion of Figure 17 on page 17. For example, note that the frequency-domain
representation for the Sampled Signal shown in the lower portion of Figure 17 on page 17 shows
sinusoids at the following frequencies: [fs – f4], [fs – f3], [fs – f2], [fs – f1], [fs + f1], [fs + f2], etc.
Each of these sinusoidal frequencies matches a term in the detailed equation for the Sampled
Signal given above.
20
The most important observation to make about the equations just above for the Sampled
Signal, is the following: Among all the sinusoids that make-up the Sampled Signal, all of
the original sinusoids in the Analog Input Signal are present in the Sampled Signal (i.e.,
frequencies f1, f2, f3, and f4 for our example). As such, when the Sampled Signal reaches its
destination, if we could simply ‘remove’ (or ‘reject’) all the sinusoids other than the sinusoids that
are in the original Analog Input Signal, we would then have, by definition, the Analog Input Signal.
This rejection process can be accomplished with a low-pass filter as will be discussed shortly.
The frequency-domain representation for the Sampled Signal shown in the lower portion of Figure
17 is reproduced below. In the diagram below, the sinusoids that make-up the Sampled Signal are
grouped into two groups – the ‘A’ sinusoids and the ‘X’ sinusoids. The ‘A’ sinusoids are at
frequencies f1, f2, f3, and f4, and are the sinusoids that make-up the Analog Input Signal. The ‘X’
sinusoids are created by the sampling process and, when viewed in the time domain, the ‘X’
sinusoids create the periods of 0 volts in the Sampled Signal that occur between the samples of
the Analog Input Signal (because without the ‘X’ sinusoids we would have only the sinusoids for
the Analog Input Signal – but with the ‘X’ sinusoids we have the Sampled Signal).
Notice that all the ‘X’ sinusoids are at frequencies that are higher than the highest frequency
sinusoid in the Analog Input Signal (f4). To recover the Analog Input Signal from the Sampled
Signal, we simply need to reject all sinusoids whose frequencies are greater than frequency f4. A
low-pass filter will accomplish this – and, in general, the “cutoff” frequency for the low-pass filter
(i.e., the frequency where the low-pass filter begins to reject sinusoids) should be one-half of the
sampling frequency (i.e., 0.5fs), according to the Nyquist Sampling Theorem. In the diagram
below, note that frequency 0.5fs would be a frequency that is one-half way between frequency 0 Hz
and frequency fs (and this frequency is also one-half way between frequency f4 and frequency fs –
f4 and it corresponds to the position of the left-side vertical dashed line for the ‘X’ sinusoids in the
diagram below).
Figure 18. Recovering the Analog Input Signal from the Sampled Signal
21
The low-pass filter at the receiving-end of the Sampled Signal (whose function is to reject the ‘X’
sinusoids shown in Figure 18) is known as a “reconstruction” filter since it ‘reconstructs’ the Analog
Input Signal from the Sampled Signal.
Figures 17 and 18 intentionally illustrate a situation where the sampling frequency (fs) is more than
two times the frequency of the highest frequency sinusoid in the Analog Input Signal (f4). As such,
Figures 17 and 18 illustrate a situation where the criterion of the Nyquist Sampling Theorem has
been more than met.
Next, we need to explore what occurs when the Nyquist Sampling Theorem’s criteria is just met
and when it is not met. To help contrast these situations, we will use an “envelope” of sinusoids
instead of specific sinusoids (e.g., sinusoids at frequencies f1, f2, f3, and f4 as was used previously).
Figure 19 below illustrates the previously used example for an Analog Input Signal which consisted
of four sinusoids and, in contrast, the more-commonly used diagram of an envelope of sinusoids.
The envelope diagram is intended to illustrate that the signal can contain any number of sinusoids
between the frequencies 0 Hz and fx, where the amplitudes of these potential sinusoids would, in
general, be relatively constant until a certain frequency where their amplitudes would become
lower and lower as their frequency becomes higher and higher. Note that it is not required that the
amplitudes of the sinusoids exactly fit within the ‘envelope’ shown – it is simply intended as a
representative example of a real-world signal.
Figure 19. Frequency-domain representation of specific sinusoids vs. an “envelope” of sinusoids
The diagram in Figure 20 (below) illustrates the frequency-domain representation of the Sampled
Signal when the criteria of the Nyquist Sampling Theorem is exactly met (fs = 2•fx). Note that
Figure 20 is based upon an envelope of sinusoids from 0 Hz to frequency fx for the Analog Input
Signal. To relate Figure 20 to Figure 18, note that the ‘A’ sinusoids in Figure 18 correspond to the
sinusoids within the envelope from frequency 0 Hz to fx in Figure 20 – and the ‘X’ sinusoids in
Figure 18 correspond to all the sinusoids above frequency fx in Figure 20.
Figure 20. Frequency-domain representation of the Sampled Signal with fs = 2•fx
To recover the Analog Input Signal from the Sampled Signal, a low-pass filter must be used that
will allow all of the ‘A’ sinusoids to pass through the filter while rejecting all the ‘X’ sinusoids. In the
situation depicted in Figure 20, the (reconstruction) low-pass filter must make an immediate
transition, at frequency fx, from allowing sinusoids to pass through the filter (the “passband” of the
filter) to rejecting sinusoids (the “stopband” of the filter) whose frequency is above fx. Real-world
22
low-pass filters cannot make an immediate transition from the passband to the stopband. As such,
when fs = 2•fx, the output of the reconstruction low-pass filter will contain the ‘A’ sinusoids, as
desired, but it will also contain some of the ‘X’ sinusoids whose frequencies are close to fx
(admittedly, the ‘X’ sinusoids that pass through the reconstruction filter will have their amplitudes
reduced). Because of the undesired sinusoids at the output of the reconstruction filter, the output
of the reconstruction filter will not be an exact copy of the Analog Input Signal – and it will be
considered to be a “distorted” version of the Analog Input Signal.
In Figure 20 note that there is a specific sinusoid shown at a frequency just below fx (with a low
amplitude). This sinusoid is an example sinusoid contained within the Analog Input Signal and it
roughly corresponds to the example sinusoid f4 contained within the Analog Input Signal used in
Figures 17 – 19. The purpose of this example sinusoid in the Analog Input Signal is to be able to
clearly see at what frequencies this sinusoid appears at in the Sampled Signal (i.e., look for the
small vertical line in the sidebands above and below fs and 2fs) in Figure 20.
The diagram in Figure 21 (below) illustrates the frequency-domain representation of the Sampled
Signal when the criteria of the Nyquist Sampling Theorem is more than met (fs > 2•fx). You should
compare Figures 20 and 21. The key observation to make in Figure 21 is that there is a range of
frequencies, just above frequency fx, where no sinusoids exist. This range of frequencies is known
as “guardband” and extends from frequency fx to frequency fs – fx. This guardband allows a realworld reconstruction filter to ‘transition’ from the passband to the stopband over a range of
frequencies where no sinusoids exist (if sinusoids did exist just above frequency fx, they would, to
some degree, pass through the reconstruction filter creating distortion in the reconstructed signal).
Figure 21. Frequency-domain representation of the Sampled Signal with fs > 2•fx
When designing a sampling system, an engineer will, in general, perform the following steps:
1. Determine the highest frequency sinusoid that will be present in the Analog Input Signal (fx)
2. Determine the minimum amount of guardband that can be accommodated
3. Calculate the sampling frequency using fs = 2•fx + Guardband
Note that adding larger amounts of guardband makes the reconstructed output more accurate (due
to the nature of real-world low-pass filters) – but it increases the required sampling frequency
(which is a disadvantage).
The diagram in Figure 22 (next page) illustrates the frequency-domain representation of the
Sampled Signal when the criteria of the Nyquist Sampling Theorem is not met (fs < 2•fx). The key
observation to make in Figure 22 is that there is a range of frequencies, just below frequency fx,
where a portion of the lower sideband of frequency fs overlaps the ‘A’ sinusoids (which are the
sinusoids in the Analog Input Signal). As such, when the reconstruction filter rejects all the
sinusoids above frequency fx, the resulting sinusoids will consist of the ‘A’ sinusoids (which are
23
desired) as well as some additional sinusoids that were created as part of the sampling process
(which are not desired). Therefore, the output of the reconstruction filter will not be an exact match
of the Analog Input Signal.
Figure 22. Frequency-domain representation of the Sampled Signal with fs < 2•fx
Figure 22 illustrates a situation called “aliasing”. Aliasing occurs when a sinusoidal component in
the original Analog Input Signal appears at the output of the reconstruction filter, not only at its
original frequency, but a second copy of the sinusoid is also present at a frequency that is below its
original frequency. Figure 22 illustrates a sinusoidal component in the ‘A’ sinusoids (which are a
copy of the sinusoids in the Analog Input Signal) at frequency fi (this is the same sinusoidal
component (just below fx) illustrated in Figures 20 and 21). Due to the sampling process, along
with the overlapping of sinusoids (because fs < 2•fx), note that the fi sinusoid also appears at a
lower frequency (equal to fs – fi).
In Figure 22 a numerical example is given to further illustrate this situation. Specifically, the
sampling frequency (fs) is given as 10kHz and fi is 6kHz. As such, the aliased version of fi will be at
a frequency of fs – fi = 10kHz – 6kHz = 4kHz. Therefore, the original sinusoidal component in the
Analog Input Signal at 6kHz will appear in the reconstructed output at both 6kHz and 4kHz. In
general, aliasing results in a sinusoidal component at a relatively high frequency in the signal to be
sampled, to appear in the reconstructed output at both its original frequency as well as at a lower
frequency.
It is very likely that you have witnessed an example of aliasing. Video cameras take some number
of “frames” per second to capture the motion of a subject being recorded where each frame is an
individual photograph of the scene. Most video cameras have a “frame rate” of 24fps (frames per
second). As such, video cameras with a frame rate of 24fps are taking 24 photographs per second
of the scene and this frame rate is also describing the ‘sampling frequency’ of the scene (i.e., fs =
24fps = 24 photographs per second = 24 samples per second = 24Hz). Based upon the Nyquist
Sampling Theorem, we can conclude that the highest frequency sinusoid (motion) that can exist in
the scene and be reconstructed properly (i.e., without aliasing) would be 12Hz (i.e., if fs = 2•fx and fs
= 24Hz then fx = fs/2 = 24Hz/2 = 12Hz).
As such, any sinusoidal motion within the scene being recorded that has a frequency above 12Hz
will have the frequency of that motion aliased to a lower frequency. An excellent example of this
situation is when a video camera records the motion of an automobile traveling at a moderately
high speed. It is common to see the wheels of the automobile rotating (a sinusoidal motion) at a
speed that is clearly too slow relative to the perceived speed of the vehicle (in fact, sometimes you
will see the wheels appearing to be stopped when the vehicle is clearly in motion – or even see the
wheels rotating slowly backwards). When it is obvious that the wheel rotation of a vehicle is being
24
aliased, you can conclude that the rotational speed of the wheels must be greater than 12 rotations
per second (i.e., 12Hz), assuming that the sampling rate of the scene is 24fps.
At this point it would be constructive for you to re-examine Figures 20 – 22 to see how the value of
the sampling frequency (fs), relative to the highest frequency sinusoid in the Analog Input Signal
(fx), affects the groups of sinusoids that make-up the Sampled Signal.
Using a Low-pass Filter to prevent Aliasing:
When aliasing occurs, the output of the reconstruction filter is not an exact copy of the Analog Input
Signal – which is obviously not a desirable situation. If one knows the highest frequency sinusoid
that can ever occur in the Analog Input Signal, then the sampling system can be designed to
sample at a frequency that is at least two times that highest input frequency and aliasing will never
occur.
However, if one does not know the highest frequency sinusoid that can occur in the Analog Input
Signal, then the only way to prevent the possibility of aliasing is to use a low-pass filter just prior to
the sampling switch. The purpose of the low-pass filter is to prevent any sinusoids in the Analog
Input Signal whose frequency is higher than one-half the sampling frequency (assuming guardband
= 0Hz), from reaching the sampling switch. A low-pass filter used in this situation is known as an
“anti-aliasing” filter. Figure 23 illustrates a sampling system that includes an anti-aliasing filter.
Note that the anti-aliasing filter should have the same cutoff frequency as the reconstruction filter.
Figure 23. A sampling system that includes an anti-aliasing filter
Further discussion of the Sinusoids in the Sampled Signal:
In Figure 18 (page 21) the sinusoids that make-up the Sampled Signal were grouped into the ‘A’
sinusoids and the ‘X’ sinusoids. The ‘A’ sinusoids are copies of the sinusoids in the Analog Input
Signal and the ‘X’ sinusoids are created by the sampling process. The fact that the ‘A’ sinusoids
are present in the Sampled Signal, without any other sinusoids intermixed within them, is what
allows the original Analog Input Signal to be recovered from the Sampled Signal. On page 19 of
this presentation, the mathematics describing the creation of the Sampled Signal is presented.
One line from that presentation is reproduced at the top of the next page:
25
Sampled Signal = K•(f1) + K•(f2) + K•(f3) + K•(f4) + (fs)•(f1) + (fs)•(f2) + (fs)•(f3) + (fs)•(f4) +
(2fs)•(f1) + (2fs)•(f2) + (2fs)•(f3) + (2fs)•(f4) + (3fs)•(f1) + (3fs)•(f2) + (3fs)•(f3) + (3fs)•(f4)
+…
The first four terms are the ‘A’ sinusoids (i.e., copies of the sinusoids f1, f2, f3, and f4 in the Analog
Input Signal). All the terms after the first four terms consist of a sinusoid multiplied by another
sinusoid which results in sum and difference sinusoids about fs, 2fs, 3fs, etc., which are the ‘X’
sinusoids.
The ‘K’ factor on the first four sinusoids is the dc offset needed for the Fourier Series
representation of the ‘multiplying’ action of the sampling switch (see page 19). The K factor on the
first four sinusoids only affects the amplitude of these sinusoids – not their frequency. In the
previous mathematical discussion of the sampling process (page 19) we were only concerned with
what sinusoidal frequencies exist in the Sampled Signal and, therefore, we ignored the K factor. It
is important to note that the dc offset (K) in the representation of the sampling switch’s multiplying
value (0 or 1) is what is responsible for making a copy of the sinusoids in the Analog Input
Signal into the Sampled Signal. And it is this copy of the Analog Input Signal’s sinusoids within the
Sampled Signal that get selected by the reconstruction filter for the final output.
The value of K is determined by the following equation:
K = (Amount of time, per cycle, that the multiplying waveform is at ‘1’) / (Time per cycle)
As such, as the duty cycle of the multiplying waveform becomes lower (i.e., the sampling switch
allows the Analog Input Signal to pass through for a shorter amount of time per cycle), the value of
K decreases. As an example, if the duty cycle of the multiplying waveform is 10 percent, then the
value of K will be 0.1.
The consequence of this is that the amplitude of the ‘A’ sinusoids will, in reality, be lower than what
has been presented in the frequency-domain diagrams. As an example, a more truthful version of
Figure 21 is presented below. Because of the reduced amplitude of the ‘A’ sinusoids, it is even
more imperative that the reconstruction filter does a good job of rejecting the ‘X’ sinusoids.
Figure 24. The ‘A’ sinusoids are created by a low-valued dc offset in the multiplication waveform
It should be noted that many PAM-based (pulse-amplitude modulation) sampling systems, and all
PCM-based (pulse-code modulation) sampling systems, bypass the above noted situation by
performing the following action: Each time a sample is received, the voltage of that sample is ‘held’
until the next sample arrives at which time the voltage is updated to the value of the new sample.
This creates a “stair-stepping” voltage waveform that is the input to the reconstruction filter (in this
situation, the filter is usually called a “smoothing” filter). This, in effect, increases the energy in the
‘A’ sinusoids to their original value in the Analog Input Signal. The diagram on the next page
summarizes the sampling process in a PCM environment.
26
27