The Software Oscilloscope in Lab 3∗
J. S. Freudenberg
EECS 461, Fall 2014
1
Introduction
As part of Lab 3, students use the eQADC on the MPC5553 or the ADC on the MPC5643L to periodically
sample sine waves of various frequencies that are produced by a signal generator. The results are then
displayed on a software oscilloscope. Depending on the frequency of the sine wave relative to the sampling
frequency, the sampled signal can be a very good representation of the analog signal, or a very poor one.
Even when the frequency of the sampled signal lies below the Nyquist frequency, it may happen that the
signal displayed on the oscilloscope appears to be considerably distorted compared to the original analog
signal. In particular, the sampled signal may exhibit a phenomenon termed beats, a type of low frequency
behavior that may appear to be present in a signal even though the signal does not, in fact, contain this
frequency.
In this set of notes we use MATLAB to simulate the plots will see on the software oscilloscope, and
explain why they have the appearance that they do. It is important that students examine the plots, so
that they will know what to expect in the lab. Those so interested are encouraged to study the mathematics
behind the phenomena.
Suppose we sample a sine of frequency f0 Hz,
f (t) = sin(2πf0 t),
(1)
f (kT ) = sin(2πf0 kT ).
(2)
with a sample period T seconds:
Define the sampling frequency fs = 1/T Hz, the Nyquist frequency fN = 1/2T Hz, and the baseband or
Nyquist range ΩN = (−fN , fN ). It follows from the Shannon sampling theorem that if f0 ∈ ΩN , then in
principle it is possible to perfectly reconstruct the signal (1) from its samples. Otherwise, the sine wave will
appear, after sampling, to have a lower frequency than did the original analog signal. This is the phenomenon
known as aliasing.
Perfect reconstruction is not feasible in practice because it replaces requires all past and future values
of the sampled signal. Instead, an approximate reconstruction scheme must be implemented. The software
oscilloscope used in Lab 3 simply interpolates straight lines between successive sample points. Intuition
suggests that if the sampling frequency is sufficiently larger than that of the sampled signal, then the
reconstructed signal should closely resemble the original sine wave. If sampling is not sufficiently fast,
then the reconstructed signal may be considerably distorted with respect to the original signal, even if the
conditions of the Shannon sampling theorem are satisfied. As we shall see, the reason for the distortion lies
with the reconstruction scheme used.
The remainder of these notes are outlined as follows. In Section 2, we shall see several examples illustrating
what you will see in Lab 3, including the beating phenomenon alluded to above. In Section 3, we shall review
the concept of continuous-time beats familiar from acoustics. We will then examine the frequency spectrum
of the sampled signal to see how beats arise when imperfect reconstruction is applied to a signal that satisfies
the Shannon sampling theorem.
∗ Revised
September 13, 2014.
1
2
Examples
The phenomena we study will depend on the relative values of the signal frequency and the sampling
frequency, and the examples in this section will be stated that way. The samples collected in Lab 3 will use
a 50kHz sampling frequency.
2.1
Signal Frequency Much Less Than the Nyquist Frequency
If the Nyquist frequency is large, say 10 times the signal frequency, then the samples displayed on the
oscilloscope should look much like the original signal. If the Nyquist frequency is closer, say 5 times the
signal frequency, some distortion will occur but the signal will have the same basic shape.
Example 1 Let the signal (1) have frequency f0 = 0.2fs Hz (period 5T seconds). The original signal,
together with the samples, is displayed in the top plot of Figure 1, and the middle plot of Figure 1 contains
the samples interpolated with straight lines1 . These plots show that the samples represent the signal with
some distortion; for example, the samples miss the peaks in the signal. However, even with the distortion, the
signal clearly has period 5T seconds and frequency 0.2fs Hz. The discrete time Fourier transform (DTFT)
of the sampled signal, displayed in the bottom plot of Figure 1, shows peaks at ±0.2fs Hz, as expected. f = 0.2 f
0
s
1
0
−1
0
5
10
15
20
25
30
normalized time, t/T
35
40
45
50
0
5
10
15
20
25
30
normalized time, t/T
35
40
45
50
0
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
normalized frequency, f/fs
0.2
0.3
0.4
0.5
1
0
−1
DTFT
600
400
200
Figure 1: (Top) Plots of sin(2πf0 t) and sin(2πf0 kT ) for f0 = 0.2fs Hz; (Middle) Plots of sin(2πf0 kT ) with
straight lines interpolated between samples; (Bottom) Discrete time Fourier transform of sin(2πf0 kT ).
1 Figures
1-5 are generated with Matlab file plots Lab3 notes.m.
2
2.2
Signal Frequency Greater Than the Nyquist Frequency
If the signal frequency is greater than the Nyquist frequency, then after sampling the signal will appear as
a lower frequency signal with frequency f0 − kfs , where k is chosen so that f0 − kfs ∈ ΩN .
Example 2 Suppose that the signal (1) has frequency f0 = 1.1fs Hz (period 0.909T seconds). Then setting
k = 1 shows that the sampled signal should appear to have frequency 1.1fs − 1.0fs = 0.1fs Hz (period 10T
seconds). The top two plots in Figure 2 show that the signal has been aliased and now appears as a 0.1fs Hz
signal, as expected. The DTFT of the sampled signal in the bottom plot of Figure 2 shows peaks at ±0.1fs
Hz.
f = 1.1 f
0
s
1
0
−1
0
5
10
15
normalized time, t/T
20
25
0
5
10
15
normalized time, t/T
20
25
1
0
−1
DTFT
600
400
200
0
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
normalized frequency, f/fs
0.2
0.3
0.4
0.5
Figure 2: (Top) Plots of sin(2πf0 t) and sin(2πf0 kT ) for f0 = 1.1fs Hz; (Middle) Plots of sin(2πf0 kT ) with
straight lines interpolated between samples; (Bottom) Discrete time Fourier transform of sin(2πf0 kT ).
3
2.3
Signal Frequency Close to the Nyquist Frequency
Suppose that the signal frequency satisfies f0 ∈ ΩN , but is close to the Nyquist frequency. Then one may
expect considerable distortion when comparing the sampled and analog signals. In fact, as we shall see in
Example 3, the signal may appear to have a low frequency component. Before we present the example, let’s
see the reasons for this.
To study signals whose frequency lies close to the Nyquist frequency, it is convenient to denote the
frequency difference by ∆ = fN − f0 . Then applying the trigonometric identity2 sin(α − β) = sin(α) cos(β) −
cos(α) sin(β) yields
sin(2πf0 kT ) = sin(2π(fN − ∆)kT )
= sin(2πfN kT ) cos(2π∆kT ) − cos(2πfN kT ) sin(2π∆kT ).
(3)
Since fN = 1/2T , it follows that sin(2πfN kT ) = sin(πk) = 0, and thus
sin(2πf0 kT ) = − cos(2πfN kT ) sin(2π∆kT ).
(4)
We see that, after sampling, the signal looks like samples of a sine with frequency ∆ that are multiplied by
samples of a cosine with frequency fN . When ∆ is small, this produces a phenomenon similar to that of
beats, familiar in the field of acoustics.
Finally, since cos(2πfN kT ) = cos(πk) = (−1)k , we have that
sin(2πf0 kT ) = (−1)k+1 sin(2π∆kT ),
(5)
and we see that the samples oscillate between positive and negative values.
Example 3 Suppose that f0 = 0.48fs Hz, only slightly below the Nyquist frequency fN = 0.5fs Hz. Then
∆ = 0.02fs Hz, corresponding to a sine with period 1/∆ = 50T seconds. Figure 3 shows that the sampled
signal appears to have a 0.5fs Hz component (due to the oscillations between positive and negative values)
that lies within an envelope of period 25T seconds (frequency 0.04fs Hz). The DTFT of the sampled signal
shows that the sampled signal has only a 0.48fs Hz frequency component.
Each of the four segments of the middle plot in Figure 3 is referred to as a beat. Note that the beats are
periodic with period 25T seconds. Hence the beat frequency is given by fbeat = 2∆.
2 http://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities
4
f0 = 0.48 fs
1
0
−1
0
10
20
30
40
50
60
normalized time, t/T
70
80
90
100
0
10
20
30
40
50
60
normalized time, t/T
70
80
90
100
0
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
normalized frequency, f/fs
0.2
0.3
0.4
0.5
1
0
−1
DTFT
400
200
Figure 3: (Top) Plots of sin(2πf0 t) and sin(2πf0 kT ) for f0 = 0.48fs Hz; (Middle) Plots of sin(2πf0 kT ) with
straight lines interpolated between samples; (Bottom) Discrete time Fourier transform of sin(2πf0 kT ).
5
2.4
Signal Frequency Close to the Half the Nyquist Frequency
You may also see a beat-like phenomenon when sampling a signal whose frequency is nearly half the Nyquist
frequency. Denote the difference between the frequency of the signal and half the Nyquist frequency by
∆2 = fN /2 − f0 Hz. Then
sin(2πf0 kT ) = sin(2π(fN /2 − ∆2 )kT )
= sin(2π(fN /2)kT ) cos(2π∆2 kT ) − cos(2π(fN /2)kT ) sin(2π∆2 kT ),
(6)
and we see that the sampled signal is the sum of two signals with frequency ∆2 Hz, each of whose amplitude
is multiplied by a signal with frequency fN /2 Hz. Since fN /2 = 1/2T , the coefficients sin(2π(fN /2)kT )
and cos(2π(fN /2)kT ) alternate between 0 and ±1: for k = 0, 1, 2, 3, . . ., we have that sin(2π(fN /2)kT ) =
0, 1, 0, −1, . . . and cos(2π(fN /2)kT ) = 1, 0, −1, 0, . . ..
Example 4 Suppose that f0 = 0.248fs Hz. Since fN /2 = 0.25fs Hz, it follows that ∆2 = 0.002fs Hz, or
period 500T seconds. The top two plots in Figure 4 show that the sampled signal looks like overlapping
versions of two signals that exhibit beats but are 90◦ out of phase. The DTFT shows that the signal has
frequency 0.248fs Hz.
f0 = 0.248 fs
1
0
−1
0
50
100
150
200
250
300
normalized time, t/T
350
400
450
500
0
50
100
150
200
250
300
normalized time, t/T
350
400
450
500
0
−0.5
−0.4
−0.3
−0.2
−0.1
0
0.1
normalized frequency, f/fs
0.2
0.3
0.4
0.5
1
0
−1
DTFT
600
400
200
Figure 4: (Top) Plots of sin(2πf0 t) and sin(2πf0 kT ) for f0 = 0.252fs Hz; (Middle) Plots of sin(2πf0 kT )
with straight lines interpolated between samples; (Bottom) Discrete time Fourier transform of sin(2πf0 kT ).
6
3
Why Do We See Beats?
We now explain why we sometimes see beats when we observe a signal on the virtual oscilloscope. To do
so, we must first review the phenomenon of beats that is studied in the field of acoustics3 , where it occurs
with continuous time signals, and no sampling is involved. We then review the frequency spectrum of a
continuous time signal, and how that spectrum influences our ability to reconstruct the signal from only a
subset of its samples, according to the Shannon sampling theorem. Finally, we show how use of an imperfect
reconstruction scheme can result in the appearance of beats in the reconstructed signal.
3.1
Acoustic Beats
Beats occur when two analog time sine waves whose frequencies differ by only a small amount are added
or subtracted. To illustrate, consider two sine waves with different frequencies: sin(2πf1 t) and sin(2πf2 t).
Using the trigonometric identity4 sin α ± sin β = 2 cos(0.5(α ∓ β)) sin(0.5(α ± β)), the difference between the
sine waves may be written as
f1 + f2
f1 − f2
1
(sin(2πf1 t) − sin(2πf2 t)) = cos 2π
t sin 2π
t
2
2
2
f1 + f2
f2 − f1
= − cos 2π
t sin 2π
t .
(7)
2
2
When f1 and f2 are approximately equal, the second term on the right of (7) is a low frequency sine wave,
with frequency (f1 − f2 )/2, that is multiplied by a cosine wave whose frequency is equal to the average of
the two original sine wave frequencies, (f1 + f2 )/2, and is thus much higher than the frequency of the sine
wave. The frequency of the low frequency sine wave is equal to half the beat frequency, fbeat = f2 − f1 .
Example 5 A plot of (7) for the values f1 = 0.48 Hz and f2 = 0.52 Hz is found in the top plot of Figure 5.
With these values of f1 and f2 , the beat frequency is fbeat = 0.04 Hz (period 25 seconds); the beat envelope
sin (2π ((f2 − f1 )/2) t) is found in the middle plot of Figure 5. The bottom plot of Figure 5 shows plots
of the individual sine waves sin(2πf1 t) and − sin(2πf2 t), together with their sum. Note how the size of
the latter waxes and wanes corresponding to whether the individual sine waves are interfering more or less
constructively or destructively.
The preceding analysis shows that adding two sine waves together may produce an interference pattern
that appears to be a low frequency sine wave, even though a Fourier analysis of the resulting signal will
reveal that only the frequencies of the two original sine waves are present.
To produce the phenomenon of beats, it is not necessary to work with the difference between the two
sine waves on the left hand side of (7). Indeed, it is easy to verify that
1
f1 − f2
f1 + f2
(sin(2πf1 t) + sin(2πf2 t)) = cos 2π
t sin 2π
t .
(8)
2
2
2
We see from (8) that the sum of two sine waves results in a low frequency cosine wave multiplied by a
frequency cosine wave. We can also, of course obtain beats using cosine waves. For later reference, we
that
f1 + f2
f1 − f2
1
(cos(2πf1 t) + cos(2πf2 t)) = cos 2π
t cos 2π
t ,
2
2
2
1
f1 + f2
f1 − f2
(cos(2πf1 t) − cos(2πf2 t)) = − sin 2π
t sin 2π
t .
2
2
2
high
note
(9)
(10)
3 http://en.wikipedia.org/wiki/Beat_(acoustics)
4 http://en.wikipedia.org/wiki/List_of_trigonometric_identities#Product-to-sum_and_sum-to-product_identities
7
f1 = 0.48 Hz, f2 = 0.52 Hz, fbeat = 0.04 Hz
1
0
−1
0
10
20
30
40
50
60
time, seconds
70
80
90
100
0
10
20
30
40
50
60
time, seconds
70
80
90
100
1
0
−1
0.5sin(2πf t)
1
−0.5sin(2πf t)
1
2
0.5(sin(2πf1t)−sin(2πf2t))
0
−1
0
5
10
15
20
25
time, seconds
Figure 5: (Top) Plot of 0.5(sin(2πf1 t) − sin(2πf2 t)) for f1 = 0.48 Hz and f2 = 0.52 Hz, yielding beat period
25 seconds; (Middle) The beat envelope sin(2π(fbeat /2)t); (Bottom) Plots of the sine waves 0.5 sin(2πf1 t)
and −0.5 sin(2πf2 t), together with their sum.
8
3.2
Background Theory
Suppose that f (t) is an analog signal (not necessarily a sine function) with Fourier transform F (ω) = F{f (t)}
defined by
Z
∞
f (t)e−jωt dt.
F (ω) =
(11)
−∞
For later reference, the time function f (t) can be recovered from its transform using the inverse Fourier
transform f (t) = F −1 {F (ω)} defined by
Z ∞
1
f (t) =
F (ω)ejωt dω.
(12)
2π −∞
Let us sample the analog signal f (t) with sample period T seconds, corresponding to sampling frequency
ωs = 2π/T radians/second (fs = 1/T Hz) and Nyquist frequency ωN = π/T radians/second (fN = 1/2T
Hz). Doing so results in a sequence of samples {f (kT )}, k = . . . , −1, 0, 1, . . ..
The Shannon Sampling Theorem
The Shannon sampling theorem states conditions under which the time function f (t) may be completely
recovered from its samples, implying that the sampling operation entails no loss of information. To be
specific, suppose that the spectrum of f (t) is bandlimited to frequencies below the Nyquist frequency; i.e.,
suppose that
F (ω) = 0, |ω| ≥ ωN .
(13)
Then in principle f (t) may be perfectly reconstructed from its samples using the formula
f (t) =
∞
X
f (kT ) sinc
k=−∞
t − kT
T
,
(14)
where sinc(x) , sin(πx)/πx. A plot of sinc(t/T ) vs t/T is shown in Figure 6.5
1
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−5
−4
−3
−2
−1
0
1
normalized time, t/T
2
3
4
Figure 6: A plot of sinc(t/T ) = sin(πt/T )/(πt/T ) vs t/T .
5 Figure
6 is plotted with Matlab file sinc plot.m.
9
5
Approximate Reconstruction
We see from (14) that perfect reconstruction at time t requires all samples of the signal, both past and
future, and hence cannot be implemented in real time. Instead, practical D/A converters approximate the
analog signal using finitely many samples. For example, one may use a staircase, or zero order hold (ZOH)
approximation6 , defined by
fZOH (t) , f (kT ),
kT ≤ t < (k + 1)T.
(15)
The virtual oscilloscope used in Lab 3 uses a trapezoidal, or first order hold (FOH) approximation7 ,
t − kT
(k + 1)T − t
+ f ((k + 1)T )
,
kT ≤ t < (k + 1)T,
fF OH (t) , f (kT )
T
T
(16)
that simply interpolates a straight line between successive sample points. Note that, unlike (15), the approximation (16) cannot be computed in real time, because the approximation at time t ∈ (kT, (k + 1)T )
depends upon the future sample to be taken sample at time (k + 1)T .
The Frequency Spectrum of a Sampled Signal
To understand what happens when the conditions of the sampling theorem are satisfied, but perfect reconstruction is not available, it is necessary to consider the frequency spectrum of a sampled signal. The discrete
time Fourier transform (DTFT) of such a signal is defined as
Fd (ω) =
∞
X
f (kT )e−jωkT .
(17)
k=−∞
It is easy to see from (17) that the DTFT is periodic with period ωs : if ` is an integer, then Fd (ω + `ωs ) =
Fd (ω). Furthermore, the Poisson summation formula 8 states that the frequency spectrum of a sampled
signal is equal to (1/T ) times the sum of infinitely many copies of the frequency spectrum (11) of the
original analog signal, with each copy shifted by an integer multiple of the sampling frequency:
Fd (ω) =
∞
1 X
F (ω − kωs ).
T
(18)
k=−∞
Example 6 The formula (18) is illustrated in Figure 7, for the time function f (t) = 0.5e−0.5t 1(t), where
1(t) denotes the unit step function.9 The resulting frequency response is F (ω) = 0.5/(jω + 0.5). Note that
the spectrum of the sampled signal is periodic with period ωs , and that there is overlap between the various
shifted copies of the analog frequency spectrum.
Consider a hypothetical analog signal (11) whose frequency spectrum is bandlimited as in (13). Then
the resulting discrete frequency spectrum may have the form illustrated in Figure 8. Note that there is no
longer any overlap between the shifted copies of the analog frequency response.
A Proof of the Shannon Sampling Theorem
The expression (18) for the frequency spectrum of a sampled signal may be used to obtain a proof of the
Shannon sampling theorem. The proof is instructive as it yields insight into the difference between ideal and
approximate reconstruction. Before providing the proof, we first provide a rigorous statement of the result.
6 http://en.wikipedia.org/wiki/Zero-order_hold
7 http://en.wikipedia.org/wiki/First-order_hold
8 J. Braslavsky, G. Meinsma, R. Middleton, and J. Freudenberg, “On a key sampling formula relating the Laplace and z
transforms”, Systems & Control Letters, 29 (1997), pp. 181-190.
9 Figures 7-11 are plotted with Matlab file Poisson.m.
10
(1/T)|F(ω)|
(1/T)|F(ω−ωs)|
(1/T)|F(ω+ωs)|
1
|Fd(ω)|
0.8
0.6
0.4
0.2
0
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
ω/ωs
Figure 7: The magnitude of the frequency response of a sampled signal (cf. (18)).
(1/T)|F(ω)|
(1/T)|F(ω−ωs)|
(1/T)|F(ω+ωs)|
1
0.8
0.6
0.4
0.2
0
−1.5
−1
−0.5
0
0.5
1
1.5
ω/ωs
Figure 8: The magnitude of the frequency response of a sampled bandlimited analog signal satisfying (13).
11
Theorem 7 Consider an analog signal f (t) and let this signal be sampled with period T seconds, yielding
the sample sequence {f (kT )}, k = . . . , −1, 0, 1, . . .. Define the signal fr (t) using the reconstruction formula
∞
X
fr (t) ,
f (kT ) sinc
k=−∞
t − kT
T
.
(19)
Assume that the Fourier transform of f (t) is bandlimited to the Nyquist range, and thus satisfies (13). Then
fr (t) defined by (19) is identical to the original analog signal: fr (t) = f (t).
Proof:
Consulting a table of Fourier transforms10 , we see that
t − kT
= F −1 {H(ω)e−jωkT },
sinc
T
(20)
where H(ω) is the frequency response of an ideal lowpass filter defined using the rectangular function 11
H(ω) , T rect(ω/ωs )
(
T, |ω| < ωN ,
=
0, |ω| > ωN .
(21)
It follows from (20) and definition (17) of the DTFT that
fr (t) =
∞
X
f (kT ) sinc
k=−∞
∞
(20) X
t − kT
T
,
f (kT )F −1 {H(ω)e−jωkT }
=
k=−∞
= F −1 {
∞
X
f (kT )H(ω)e−jωkT }
k=−∞
=F
−1
{H(ω)
∞
X
f (kT )e−jωkT }
k=−∞
(17)
= F
−1
{H(ω)Fd (ω)}.
(22)
Invoking assumption (13) in the summation (18), we see that
Fd (ω) =
1
F (ω),
T
ω ∈ ΩN .
(23)
This fact, together with (21), implies that H(ω)Fd (ω) = F (ω), ∀ω. Substituting into (22) yields the result:
fr (t) = F −1 {H(ω)Fd (ω)} = F −1 {F (ω)} = f (t).
It follows from the proof of Theorem 7 that if condition (13) is not satisfied, then the product H(ω)Fd (ω)
will contain contributions from the shifted copies of F (ω) in the summation (18), and thus reconstruction
cannot be perfect. Moreover, suppose that (13) is satisfied but that the ideal lowpass filter (21) is replaced
by one that has a nonzero frequency response outside the Nyquist range. Then the frequency response of
the filter may overlap with one or more of the shifted copies of F (ω) in the summation (18). Once again,
reconstruction will not be perfect.
10 http://en.wikipedia.org/wiki/Fourier_transform
11 http://en.wikipedia.org/wiki/Rectangular_function
12
Approximate Reconstruction: The Frequency Domain
We have seen that perfect reconstruction of a bandlimited signal according to the Shannon formula (14)
requires the use of an ideal lowpass filter (21). It is instructive to compare the frequency response of such a
filter to those of the approximate reconstruction schemes (15) and (16). These are given by
1 − e−jωT
,
jω
2
ejωT 1 − e−jωT
HF OH (ω) =
.
T
jω
(24)
HZOH (ω) =
(25)
The magnitudes of the frequency responses (21), (24), and (25) are plotted in Figure 9. Note that both the
ZOH filter (24) and the FOH filter (25) have a nonzero frequency response outside the Nyquist range. This
fact is significant because, as we have seen, the frequency spectrum of a sampled signal is periodic, and thus
nonzero outside the Nyquist range even if the original analog signal satisfies (13).
(1/T)|H(ω)|
(1/T)|HZOH(ω)|
(1/T)|HFOH(ω)|
1
0.8
0.6
0.4
0.2
0
−1.5
−1
−0.5
0
0.5
1
1.5
ω/ωs
Figure 9: The frequency response of the ideal lowpass filter (21), the zero order hold (24), and the first order
hold (25), each normalized by (1/T ) to have unity height.
Application to a Sine Wave
Let us now see how the preceding ideas may be applied to the problem of approximately reconstructing a
sine wave. The Fourier transform of the f0 Hz sine wave, f (t) = sin(2πf0 t) = sin(ω0 t), is given by
F (ω) = jπ (δ(ω + ω0 ) − δ(ω − ω0 )) ,
(26)
where ω0 = 2πf0 radians/second and δ(ω) is the delta function.12 For the remainder of this section, we work
with frequency in radians/second to simplify the formulas.
The Poisson summation formula (18) implies that the DTFT of the sampled sine wave f (kT ) = sin(ω0 kT )
satisfies
∞
1 X
F{sin((ω0 − kωs )t)}.
(27)
Fd (ω) =
T
k=−∞
12 To
see why the Fourier transform of a sine wave with frequency ω0 has components at both ±ω0 , recall that ejθ =
(1/2)(cos θ + j sin θ), from which it follows that sin θ = (1/2j)(ejθ − e−jθ ). This identity, together with the fact that F {ejωt } =
δ(ω − ω0 ), yields (26).
13
It is convenient to rewrite (27) as a sum of sinusoids whose frequencies will be nonnegative provided that
0 ≤ ω0 < ωs . To do so, we note that
0
∞
1 X
1X
F{sin((ω0 − kωs )t)} =
F{sin((ω0 + `ωs )t)},
T
T
k=−∞
∞
X
1
T
F{sin((ω0 − kωs )t)} =
k=1
`=0
∞
X
−1
T
(28)
F{sin((−ω0 + kωs )t)}.
(29)
k=1
Substituting the identities (28)-(29) into (27) yields
∞
∞
1X
1 X
Fd (ω) =
F{sin((ω0 + `ωs )t)} −
F{sin((−ω0 + kωs )t)},
T
T
`=0
(30)
k=1
and we see that the frequency spectrum of the sampled sine wave is the weighted sum of the frequency
spectra of sine waves with frequencies ω0 , ω0 + `ωs , ` = 1, . . . ∞, and kωs − ω0 , k = 1, . . . ∞. A partial plot
of the frequency spectrum given by (30) is shown in Figure 10 for a sine wave with ω0 /ωs = 0.1; note we
only plot the terms in (30) corresponding to ` = 0, 1 and k = 1, 2.
3.5
3
2.5
2
1.5
1
f0/fs
1−f /f
0 s
0.5
1+f0/fs
2−f /f
0 s
0
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
ω/ω
s
Figure 10: The normalized frequency spectrum of a sampled sine wave with frequency ω0 /ωs = 0.1 showing
the terms due to ω0 /ωs = 0.1, (ωs − ω0 )/ωs = 0.9, (ωs + ω0 )/ωs = 1.1, and (2ωs − ω0 )/ωs = 1.9.
In the example illustrated in Figure 10, the signal frequency lies well below the Nyquist frequency. Our
next example illustrates what happens when this condition is not satisfied. Before proceeding, let us recall
a fundamental property of linear time-invariant systems: the response of such a system to a sinusoid with
specified frequency is a sinusoid of the same frequency whose magnitude and phase are modified by the gain
and phase of the system transfer function evaluated at the frequency of the input sinusoid. Furthermore,
the superposition property of linear systems implies that the response to a sum of sinusoids is the sum of
the responses to the individual sinusoids.
In our case, we are interested in the response of the reconstruction filters (21), (24), and (25) to the
signal sin(ωkT ), which has frequency spectrum Fd (ω) given by (30). The inverse Fourier transform of (30)
is given by the time function fd (t) , F −1 {Fd (ω)}, where
∞
∞
1X
1 X
sin((ω0 + `ωs )t) −
sin((−ω0 + kωs )t).
fd (t) =
T
T
`=0
k=1
14
(31)
Note that all the sinusoids in (31) have positive frequencies, and that only one of them (` = 0) has a frequency
lying below the Nyquist frequency.
Example 8 Let us return to Example 3, in which we saw the phenomenon of beats. In that example,
f0 = 0.48 Hz and fN = 0.5 Hz, so that the signal frequency lies just below the Nyquist frequency. According
to (30), the DTFT of the sampled signal will have a term for ` = 0 that corresponds to sin(2π(0.48)t and
a term for k = 1 that corresponds to sin(2π(0.52)t). The former results in Fd (ω) having delta functions at
±0.48 and the latter to delta functions at ±0.52, as shown in Figure 11.
3.5
|(1/T)H(ω)|
|(1/T)HZOH(ω)|
3
|(1/T)HFOH(ω)|
|TFd(ω)|
2.5
2
1.5
1
0.5
0
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
ω/ωs
Figure 11: The DTFT of sin(2π(0.48)t) together with the frequency responses of the ideal lowpass filter (21),
the ZOH (24), and the FOH (25).
Let us now consider the result of reconstructing the original signal f (t) = sin(2πf0 t) using three different
lowpass filters: H(ω) given by (21), HZOH (ω) given by (24), and HF OH (ω) given by (25). Denote the three
reconstructed signals by fr (t), frZOH (t), and frF OH (t), respectively.
First, since the summation (31) has only one term lying within below the Nyquist frequency, and since
the frequency response of the ideal lowpass filter (21) is zero above the Nyquist frequency, reconstruction
with this filter will be perfect: fr (t) = f (t). (This also follows directly from Theorem 7.)
The other two reconstruction filters each have a frequency response that is nonzero above the Nyquist
frequency. As a result, the response of one of these filters to the signal (31) will have infinitely many
components. To illustrate, output of the first order hold in response to (31) is given by
frF OH (t) =
∞
1X
|HF OH (ω0 + `ωs )| sin ((ω0 + `ωs )t − ∠(HF OH (ω0 + `ωs ))
T
`=0
∞
1 X
−
|HF OH (−ω0 + kωs )| sin((−ω0 + kωs )t − ∠(HF OH (−ω0 + kωs )).
T
(32)
k=1
The term corresponding to ` = 0 in (32) is a sinusoid of frequency ω0 ,
1
|HF OH (ω0 )| sin (ω0 t − ∠(HF OH (ω0 ))) ,
T
and the term corresponding to k = 1 is a sinusoid of frequency (ωs − ω0 )
F OH
f`=0
(t) =
F OH
fk=1
(t) =
−1
|HF OH ((ωs − ω0 ))| sin ((ωs − ω0 )t − ∠(HF OH (ωs − ω0 ))) .
T
15
(33)
(34)
For our example, (33) and (34) have frequencies ω0 = 2π × 0.48 and ωs − ω0 = 2π × 0.52 radians/second,
respectively. Hence, the sum of these two signals should yield a beat frequency of 2π × 2(ωN − ω0 ) = 2π × 0.4
radians/second, as shown in Figure 12. By comparing Figure 12 with the middle plot in Figure 3, we see
that the reconstructed signal is reasonably well approximated by the sum of the first two sinusoids in (32);
adding more terms in (32) would make the two plots identical.
1
f ℓF=O0H( t ) + f kF=O1H( t )
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
0
10
20
30
40
50
60
time, seconds
70
80
90
100
Figure 12: The sum of sinusoids (33) and (34) approximates samples of sin(2π(0.48)t reconstructed using a
first order hold.
4
Summary
In this set of notes, we have considered distortion that may occur when reconstruction a signal from its
samples, even if the signal satisfies the hypotheses of the Shannon sampling theorem. The reason for the
distortion, which manifests itself as beats, is that the signal is not reconstructed using an ideal lowpass
filter. Use of a non-ideal filter, such as a zero order or first order hold, does not cause much distortion if the
frequency of the sampled signal is well below the Nyquist frequency. One the other hand, if the frequency
of the signal is just below the Nyquist frequency, then the observed distortion may be significant.
As usual in engineering, the perceptive question to ask is not “what happens when the hypotheses of
a theorem are satisfied”, but rather “what happens if the hypotheses are almost violated”. In the present
case, we see that our sampling frequency should be significantly greater than the frequency content of our
sampled signal, which is consistent with the recommendation in digital control textbooks that the sampling
frequency should be 10-20 times the bandwidth of the signal.
16
© Copyright 2026 Paperzz