0% found this document useful (0 votes)
12 views

1 - Signal Sampling and Quantization - MP

d

Uploaded by

mozartmichael52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

1 - Signal Sampling and Quantization - MP

d

Uploaded by

mozartmichael52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

CHAPTER

Signal Sampling and Quantization

CHAPTER OUTLINE
2
2.1 Sampling of Continuous Signal........................................................................................................ 15
2.2 Signal Reconstruction .................................................................................................................... 21
2.2.1 Practical Considerations for Signal Sampling: Anti-Aliasing Filtering................................25
2.2.2 Practical Considerations for Signal Reconstruction: Anti-Image Filter and Equalizer ..........30
2.3 Analog-to-Digital Conversion, Digital-to-Analog Conversion, and Quantization .................................... 35
2.4 Summary ....................................................................................................................................... 47
2.5 MATLAB Programs .......................................................................................................................... 48

OBJECTIVES:
This chapter investigates the sampling process, sampling theory, and the signal reconstruction
process. It also includes practical considerations for anti-aliasing and anti-image filters and signal
quantization.

2.1 SAMPLING OF CONTINUOUS SIGNAL


As discussed in Chapter 1, Figure 2.1 describes a simplified block diagram of a digital signal
processing (DSP) system. The analog filter processes the analog input to obtain the band-limited
signal, which is sent to the analog-to-digital conversion (ADC) unit. The ADC unit samples the
analog signal, quantizes the sampled signal, and encodes the quantized signal level to the digital
signal.
Here we first develop concepts of sampling processing in the time domain. Figure 2.2 shows an
analog (continuous-time) signal (solid line) defined at every point over the time axis (horizontal line)
and amplitude axis (vertical line). Hence, the analog signal contains an infinite number of points.
It is impossible to digitize an infinite number of points. The infinite points cannot be processed by
the digital signal (DS) processor or computer, since they require an infinite amount of memory and
infinite amount of processing power for computations. Sampling can solve such a problem by taking
samples at a fixed time interval as shown in Figure 2.2 and Figure 2.3, where the time T represents the
sampling interval or sampling period in seconds.
As shown in Figure 2.3, each sample maintains its voltage level during the sampling interval T to
give the ADC enough time to convert it. This process is called sample and hold. Since there exits one
amplitude level for each sampling interval, we can sketch each sample amplitude level at its corre-
sponding sampling time instant shown in Figure 2.2, where 14 samples at their sampling time instants
are plotted, each using a vertical bar with a solid circle at its top.
Digital Signal Processing. http://dx.doi.org/10.1016/B978-0-12-415893-1.00002-0
Copyright Ó 2013 Elsevier Inc. All rights reserved.
15
16 CHAPTER 2 Signal Sampling and Quantization

Analog Band-limited Digital Processed Output Analog


input signal signal digital signal signal output
Analog Reconstruction
ADC DSP DAC
filter filter

FIGURE 2.1
A digital signal processing scheme.

Signal samples
x (t )
Analog signal/continuous-time signal
5
Sampling interval T

5 nT
0 2T 4T 6T 8T 10T 12T
FIGURE 2.2
Display of the analog (continuous) signal and the digital samples versus the sampling time instants.

x (t)
Voltage for ADC

5 Analog signal

5 nT
0 2T 4T 6T 8T 10T 12T
FIGURE 2.3
Sample-and-hold analog voltage for ADC.

For a given sampling interval T, which is defined as the time span between two sample points, the
sampling rate is therefore given by
1
fs ¼ samples per second ðHzÞ
T
For example, if a sampling period is T ¼ 125 microseconds, the sampling rate is fs ¼ 1=125ms ¼
8; 000 samples per second (Hz).
2.1 Sampling of Continuous Signal 17

After obtaining the sampled signal whose amplitude values are taken at the sampling instants, the
processor is able to process the sample points. Next, we have to ensure that samples are collected at
a rate high enough that the original analog signal can be reconstructed or recovered later. In other
words, we are looking for a minimum sampling rate to acquire a complete reconstruction of the analog
signal from its sampled version. If an analog signal is not appropriately sampled, aliasing will occur,
which causes unwanted signals in the desired frequency band.
The sampling theorem guarantees that an analog signal can be in theory perfectly recovered as long
as the sampling rate is at least twice as large as the highest-frequency component of the analog signal
to be sampled. The condition is described as
fs  2fmax
where fmax is the maximum-frequency component of the analog signal to be sampled. For example, to
sample a speech signal containing frequencies up to 4 kHz, the minimum sampling rate is chosen to be
at least 8 kHz, or 8,000 samples per second; to sample an audio signal possessing frequencies up to
20 kHz, at least 40,000 samples per second, or 40 kHz, of the audio signal are required.
Figure 2.4 illustrates sampling of two sinusoids, where the sampling interval between sample points
is T ¼ 0:01 second, and the sampling rate is thus fs ¼ 100 Hz. The first plot in the figure displays
a sine wave with a frequency of 40 Hz and its sampled amplitudes. The sampling theorem condition is
satisfied since 2fmax ¼ 80 < fs . The sampled amplitudes are labeled using the circles shown in the first

Sampling condition is satisfied

1 40 Hz
Voltage

-1

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (sec.)
Sampling condition is not satisfied

90 Hz 10 Hz
1
Voltage

-1

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (sec.)

FIGURE 2.4
Plots of the appropriately sampled signals and nonappropriately sampled (aliased) signals.
18 CHAPTER 2 Signal Sampling and Quantization

plot. We notice that the 40-Hz signal is adequately sampled, since the sampled values clearly come from
the analog version of the 40-Hz sine wave. However, as shown in the second plot, the sine wave with
a frequency of 90 Hz is sampled at 100 Hz. Since the sampling rate of 100 Hz is relatively low compared
with the 90-Hz sine wave, the signal is undersampled due to 2fmax ¼ 180 > fs . Hence, the condition of
the sampling theorem is not satisfied. Based on the sample amplitudes labeled with the circles in the
second plot, we cannot tell whether the sampled signal comes from sampling a 90-Hz sine wave (plotted
using the solid line) or from sampling a 10-Hz sine wave (plotted using the dot-dash line). They are not
distinguishable. Thus they are aliases of each other. We call the 10-Hz sine wave the aliasing noise in
this case, since the sampled amplitudes actually come from sampling the 90-Hz sine wave.
Now let us develop the sampling theorem in frequency domain, that is, the minimum sampling rate
requirement for sampling an analog signal. As we shall see, in practice this can help us design the anti-
aliasing filter (a lowpass filter that will reject high frequencies that cause aliasing) that will be applied
before sampling, and the anti-image filter (a reconstruction lowpass filter that will smooth the
recovered sample-and-hold voltage levels to an analog signal) that will be applied after the digital-to-
analog conversion (DAC).
Figure 2.5 depicts the sampled signal xs ðtÞ obtained by sampling the continuous signal xðtÞ at
a sampling rate of fs samples per second.
Mathematically, this process can be written as the product of the continuous signal and the
sampling pulses (pulse train):
xs ðtÞ ¼ xðtÞpðtÞ (2.1)
where pðtÞ is the pulse train with a period T ¼ 1=fs . From spectral analysis, the original spectrum
(frequency components) Xðf Þ and the sampled signal spectrum Xs ðf Þ in terms of Hz are related as
1 X N
Xs ðf Þ ¼ Xðf  nfs Þ (2.2)
T n ¼ N

p( t )

t
T

x (t ) ADC
encoding

x (t ) xs ( t ) = x ( t ) p( t )
x s (0) x s (T )

x s ( 2T )

t t
T
FIGURE 2.5
The simplified sampling process.
2.1 Sampling of Continuous Signal 19

where Xðf Þ is assumed to be the original baseband spectrum while Xs ðf Þ is its sampled signal spec-
trum, consisting of the original baseband spectrum Xðf Þ and its replicas Xðf  nfs Þ. Since Equation
(2.2) is a well-known formula, the derivation is omitted here and can be found in well-known texts
(Ahmed and Nataranjan, 1983; Ambardar, 1999; Alkin, 1993; Oppenheim and Schafer, 1975; Proakis
and Manolakis, 1996).
Expanding Equation (2.2) leads to the sampled signal spectrum in Equation (2.3):
1 1 1
Xs ðf Þ ¼ / þ Xðf þ fs Þ þ Xðf Þ þ Xðf  fs Þ þ / (2.3)
T T T
Equation (2.3) indicates that the sampled signal spectrum is the sum of the scaled original spectrum and
copies of its shifted versions, called replicas. Three possible sketches based on Equation (2.3) can be
obtained. Given the original signal spectrum Xðf Þ plotted in Figure 2.6(a), the sampled signal
spectrum according to Equation (2.3) is plotted in Figure 2.6(b), where the replicas T1 Xðf Þ, T1 Xðf  fs Þ,
T Xðf þ fs Þ, ., have separations between them. Figure 2.6(c) shows that the baseband spectrum and its
1

replicas, T1 Xðf Þ, T1 Xðf  fs Þ, T1 Xðf þ fs Þ, ., are just connected, and finally, in Figure 2.6(d), the original

X( f )
10
.
(a)
B = f max

f
−B 0 B
Xs( f )
Lowpass filter
1
(b)
T
fs
2
f
− fs − B − f s − f s + B −B 0 B fs − B fs fs + B
Xs( f ) Folding frequency/Nyquist limit
1
(c) T

f
− fs − B − fs −B 0 B fs fs + B
Xs( f )
1
(d) T

f
− fs − B − fs −B − fs + B 0 fs − B B fs fs + B

FIGURE 2.6
Plots of the sampled signal spectrum.
20 CHAPTER 2 Signal Sampling and Quantization

spectrum T1 Xðf Þ and its replicas T1 Xðf  fs Þ, T1 Xðf þ fs Þ, ., are overlapped; that is, there are many
overlapping portions in the sampled signal spectrum.
From Figure 2.6, it is clear that the sampled signal spectrum consists of the scaled baseband
spectrum centered at the origin, and its replicas centered at the frequencies of nfs (multiples of the
sampling rate) for each of n ¼ 1; 2; 3; ..
If applying a lowpass reconstruction filter to obtain exact reconstruction of the original signal
spectrum, the following condition must be satisfied:
fs  fmax  fmax (2.4)
Solving Equation (2.4) gives
fs  2fmax (2.5)
In terms of frequency in radians per second, Equation (2.5) is equivalent to

us  2umax (2.6)

This fundamental conclusion is well known as the Shannon sampling theorem, which is formally
described below:

For a uniformly sampled DSP system, an analog signal can be perfectly recovered as long as the sampling rate is at
least twice as large as the highest-frequency component of the analog signal to be sampled.

We summarize two key points here.


1. The sampling theorem establishes a minimum sampling rate for a given band-limited analog signal
with highest-frequency component fmax . If the sampling rate satisfies Equation (2.5), then the
analog signal can be recovered via its sampled values using the lowpass filter, as described in
Figure 2.6(b).
2. Half of the sampling frequency fs =2 is usually called the Nyquist frequency (Nyquist limit) or
folding frequency. The sampling theorem indicates that a DSP system with a sampling rate of fs
can ideally sample an analog signal with a maximum frequency that is up to half of the
sampling rate without introducing spectral overlap (aliasing). Hence, the analog signal can be
perfectly recovered from its sampled version.
Let us study the following example.

EXAMPLE 2.1
Suppose that an analog signal is given as
xðtÞ ¼ 5cosð2p$1; 000tÞ; for t  0

and is sampled at the rate 8,000 Hz.


a. Sketch the spectrum for the original signal.
b. Sketch the spectrum for the sampled signal from 0 to 20 kHz.
2.2 Signal Reconstruction 21

Solution:
a. Since the analog signal is sinusoid with a peak value of 5 and frequency of 1,000 Hz, we can write the sine wave
using Euler’s identity: rumus cos eksponensial

e j2p1;000t þ e j2p1;000t
5cosð2p  1; 000tÞ ¼ 5$ð Þ ¼ 2:5e j2p1;000t þ 2:5e j2p1;000t
2

which is a Fourier series expansion for a continuous periodic signal in terms of the exponential form (see Appendix B). We
can identify the Fourier series coefficients as
c1 ¼ 2:5 and c1 ¼ 2:5

Using the magnitudes of the coefficients, we then plot the two-side spectrum as shown in Figure 2.7A.
b. After the analog signal is sampled at the rate of 8,000 Hz, the sampled signal spectrum and its replicas centered
at the frequencies nfs , each with a scaled amplitude of 2:5=T , are as shown in Figure 2.7B:

X( f )
2.5

f kHz
−1 1

FIGURE 2.7A
Spectrum of the analog signal in Example 2.1.

Xs( f )
2.5 /T

f kHz
−9 −8 −7 −1 1 78 9 15 16 17

FIGURE 2.7B
Spectrum of the sampled signal in Example 2.1.

Notice that the spectrum of the sampled signal shown in Figure 2.7B contains the images of the original
spectrum shown in Figure 2.7A; that the images repeat at multiples of the sampling frequency fs (for our example,
8 kHz, 16kHz, 24kHz, .); and that all images must be removed, since they convey no additional information.

2.2 SIGNAL RECONSTRUCTION


In this section, we investigate the recovery of analog signal from its sampled signal version. Two
simplified steps are involved, as described in Figure 2.8. First, the digitally processed data yðnÞ are
converted to the ideal impulse train ys ðtÞ, in which each impulse has amplitude proportional to digital
output yðnÞ, and two consecutive impulses are separated by a sampling period of T; second, the analog
22 CHAPTER 2 Signal Sampling and Quantization

Digital signal y s (t ) Lowpass y (t )


DAC reconstruction
y ( n) filter

y ( n) y s (t ) y (t )
y(0) y(1) y s (0) y s (T )

y( 2) y s ( 2T )

n t t
T
a.Digital signal processed b.Sampled signal recovered c.Analog signal recovered.
Y( f )
10
.
f max = B

f
−B 0 B
d.Recovered signal spectrum
FIGURE 2.8
Signal notations at the reconstruction stage.

reconstruction filter is applied to the ideally recovered sampled signal ys ðtÞ to obtain the recovered
analog signal.
To study the signal reconstruction, we let yðnÞ ¼ xðnÞ for the case of no DSP, so that the recon-
structed sampled signal and the input sampled signal are ensured to be the same; that is, ys ðtÞ ¼ xs ðtÞ.
Hence, the spectrum of the sampled signal ys ðtÞ contains the same spectral content of the original
spectrum Xðf Þ, that is, Yðf Þ ¼ Xðf Þ, with a bandwidth of fmax ¼ B Hz (described in Figure 2.8d)
and the images of the original spectrum (scaled and shifted versions). The following three cases are
discussed for recovery of the original signal spectrum Xðf Þ.
Case 1: fs ¼ 2fmax
As shown in Figure 2.9, where the Nyquist frequency is equal to the maximum frequency of the
analog signal xðtÞ, an ideal lowpass reconstruction filter is required to recover the analog signal
spectrum. This is an impractical case.

Xs( f )
1 Ideal lowpass filter

f
− fs − B − fs −B 0 B fs fs + B

FIGURE 2.9
Spectrum of the sampled signal when fs ¼ 2fmax .
2.2 Signal Reconstruction 23

Xs( f ) Practical lowpass filter


1
T

f
− fs − B − f s − f s + B −B 0 B fs − B fs fs + B

FIGURE 2.10
Spectrum of the sampled signal when fs > 2fmax .

Case 2: fs > 2fmax


In this case, as shown in Figure 2.10, there is a separation between the highest-frequency edge of
the baseband spectrum and the lower edge of the first replica. Therefore, a practical lowpass recon-
struction (anti-image) filter can be designed to reject all the images and achieve the original signal
spectrum.
Case 3: fs < 2fmax
Case 3 violates the condition of the Shannon sampling theorem. As we can see, Figure 2.11 depicts
the spectral overlapping between the original baseband spectrum and the spectrum of the first replica
and so on. Even when we apply an ideal lowpass filter to remove these images, in the baseband there
are still some foldover frequency components from the adjacent replica. This is aliasing, where the
recovered baseband spectrum suffers spectral distortion, that is, it contains an aliasing noise spectrum;
in the time domain, the recovered analog signal may consist of the aliasing noise frequency or
frequencies. Hence, the recovered analog signal is incurably distorted.

Xs( f )
1 Ideal lowpass filter
T

f
− fs − B − fs −B − fs + B 0 fs − B B fs fs + B

FIGURE 2.11
Spectrum of the sampled signal when fs < 2fmax .

Note that if an analog signal with a frequency f is undersampled, the aliasing frequency component
falias in the baseband is simply given by the following expression:
falias ¼ fs  f
The following examples give a spectrum analysis of the signal recovery.

EXAMPLE 2.2
Assume that an analog signal is given by
xðtÞ ¼ 5cosð2p$2; 000tÞ þ 3cosð2p$3; 000tÞ; for t  0
24 CHAPTER 2 Signal Sampling and Quantization

and is sampled at the rate of 8,000 Hz.


a. Sketch the spectrum of the sampled signal up to 20 kHz.
b. Sketch the recovered analog signal spectrum if an ideal lowpass filter with a cutoff frequency of 4 kHz is used to
filter the sampled signal (y ðnÞ ¼ xðnÞ in this case) to recover the original signal.
Solution:
a. Using Euler’s identity, we get
3 j2p$3;000t 5 j2p$2;000t 5 j2p$2;000t 3 j2p$3;000t
xðtÞ ¼ e þ e þ e þ e
2 2 2 2

The two-sided amplitude spectrum for the sinusoid is displayed in Figure 2.12:

Xs( f )
2.5/T

f kHz
−11 −10 −6 −5 − 3 −2 2 3 5 6 8 1011 1314 16 1819

FIGURE 2.12
Spectrum of the sampled signal in Example 2.2.

Y( f )

f kHz
−3−2 23

FIGURE 2.13
Spectrum of the recovered signal in Example 2.2.

b. Based on the spectrum in (a), the sampling theorem condition is satisfied; hence, we can recover the original
spectrum using a reconstruction lowpass filter. The recovered spectrum is shown in Figure 2.13.

EXAMPLE 2.3
Assume an analog signal is given by
xðtÞ ¼ 5cosð2p  2; 000tÞ þ 1cosð2p  5; 000tÞ; for t  0

and is sampled at a rate of 8,000 Hz.


a. Sketch the spectrum of the sampled signal up to 20 kHz.
b. Sketch the recovered analog signal spectrum if an ideal lowpass filter with a cutoff frequency of 4 kHz is used to
recover the original signal (y ðnÞ ¼ xðnÞ in this case).
tingginya 2.2 Signal Reconstruction 25

sampling rate setiap 8


Xs( f ) Aliasing noise
2.5 / T
ke kanan 5, ke kanan 2
ke kiri 5, kekiri 2
tergantung brp nilai frek soal
f kHz
−11 −10 −6 −5 − 3 −2 2 3 5 6 8 1011 1314 16 1819

FIGURE 2.14
Spectrum of the sampled signal in Example 2.3.

Y( f )
Aliasing noise

f kHz
−3−2 23

FIGURE 2.15
Spectrum of the recovered signal in Example 2.3.

Solution:
a. The spectrum for the sampled signal is sketched in Figure 2.14.
b. Since the maximum frequency of the analog signal is larger than that of the Nyquist frequencydthat is, twice
the maximum frequency of the analog signal is larger than the sampling ratedthe sampling theorem condition is
violated. The recovered spectrum is shown in Figure 2.15, where we see that aliasing noise occurs at 3 kHz.

2.2.1 Practical Considerations for Signal Sampling: Anti-Aliasing Filtering


In practice, the analog signal to be digitized may contain other frequency components in addition to the
folding frequency, such as high-frequency noise. To satisfy the sampling theorem condition, we apply
an anti-aliasing filter to limit the input analog signal, so that all the frequency components are less than
the folding frequency (half of the sampling rate). Considering the worst case, where the analog signal
to be sampled has a flat frequency spectrum, the band limited spectrum Xðf Þ and sampled spectrum
Xs ðf Þ are depicted in Figure 2.16, where the shape of each replica in the sampled signal spectrum is the
same as that of the anti-aliasing filter magnitude frequency response.
Due to nonzero attenuation of the magnitude frequency response of the anti-aliasing lowpass filter,
the aliasing noise from the adjacent replica still appears in the baseband. However, the amount of
aliasing noise is greatly reduced. We can also control the aliasing noise by either using a higher-order
lowpass filter or increasing the sampling rate. For illustrative purpose, we use a Butterworth filter. The
method can also be extended to other filter types such as the Chebyshev filter. The Butterworth
magnitude frequency response with an order of n is given by

1
jHðf Þj ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 2nffi (2.7)
f

fc
26 CHAPTER 2 Signal Sampling and Quantization

Anti-aliasing Sample and ADC Digital value


LP filter hold coding
Analog signal spectrum X( f ) Xs( f )
(worst case)

Xa
f fc f fa fc fs f
fs
2
fs − fa
Aliasing level Xa
at fa (image from fs − fa )
FIGURE 2.16
Spectrum of the sampled analog signal with a practical anti-aliasing filter.

For a second-order Butterworth lowpass filter with unit gain, the transfer function (which will be
discussed in Chapter 8) and its magnitude frequency response are given by

ð2pfc Þ2
HðsÞ ¼ (2.8)
s2 þ 1:4141  ð2pfc Þs þ ð2pfc Þ2

1
jHðf Þj ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 4 (2.9)
f

fc

A unit gain second-order lowpass filter using a Sallen-Key topology is shown in Figure 2.17. Matching
the coefficients of the circuit transfer function to that of the second-order Butterworth lowpass transfer
function in Equation (2.10) gives the design formulas shown in Figure 2.17, where for a given cutoff

C2

Vin
R1 R2 Vo
+
Choose C2 −
14142
.
R1 = R2 = C1
C2 (2π fc)
1
C1 = 2
R1 R2 C2 (2π fc)
FIGURE 2.17
Second-order unit gain Sallen-Key lowpass filter.
2.2 Signal Reconstruction 27

frequency of fc in Hz, and a capacitor value of C2 , we can determine the other elements using the
formulas listed in the figure.

1
R1 R2 C1
C2 ð2pfc Þ2
 ¼ (2.10)
s2 þ
1
þ
1

1 s2 þ 1:4141  ð2pfc Þs þ ð2pfc Þ2
R1 C2 R2 C2 R1 R2 C1 C2

As an example, for a cutoff frequency of 3,400 Hz, and by selecting C2 ¼ 0:01 microfarad (mF),
we get
R1 ¼ R2 ¼ 6; 620 U; and C1 ¼ 0:005 mF
Figure 2.18 shows the magnitude frequency response, where the absolute gain of the filter is
plotted. As we can see, the absolute attenuation begins at the level of 0.7 at 3,400 Hz and reduces
to 0.3 at 6,000 Hz. Ideally, we want the gain attenuation to be zero after 4,000 Hz if our sampling
rate is 8,000 Hz. Practically speaking, aliasing will occur anyway with some degree. We will study
achieving the higher-order analog filter via Butterworth and Chebyshev prototype function tables
in Chapter 8. More details of the circuit realization for the analog filter can be found in Chen
(1986).

1.1

0.9

0.8
Magnitude response

0.7

0.6

0.5
fc=3400 Hz
0.4

0.3

0.2

0.1
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
Frequency (Hz)

FIGURE 2.18
Magnitude frequency response of the second-order Butterworth lowpass filter.
28 CHAPTER 2 Signal Sampling and Quantization

According to Figure 2.16, we can derive the aliasing level percentage using the symmetry of the
Butterworth magnitude function and its first replica. It follows that
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 2nffi
fa

Xa jHðf Þjf ¼fs fa fc
aliasing level % ¼ ¼ ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
  ffi for 0  f  fc (2.11)
Xðf Þjf ¼fa jHðf Þjf ¼fa fs  fa 2n

fc

With Equation (2.11), we can estimate the aliasing noise percentage, or choose a higher-order anti-
aliasing filter to satisfy the requirement for the aliasing level percentage.

EXAMPLE 2.4
Given the DSP system shown in Figures 2.16 to 2.18, where a sampling rate of 8,000 Hz is used and the anti-
aliasing filter is a second-order Butterworth lowpass filter with a cutoff frequency of 3.4 kHz, determine
a. the percentage of aliasing level at the cutoff frequency;
b. the percentage of aliasing level at a frequency of 1,000 Hz.
Solution:

fs ¼ 8; 000; fc ¼ 3; 400; and n ¼ 2


a. Since fa ¼ fc ¼ 3; 400 Hz, we compute
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 22
3:4

3:4 1:4142
aliasing level % ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 22ffi ¼ 2:0858 ¼ 67:8%
8  3:4

3:4

b. With fa ¼ 1; 000 Hz, we have


sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 22
1

3:4 1:03007
aliasing level % ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 22ffi ¼ 4:3551 ¼ 23:05%
81

3:4

Let us examine another example with an increased sampling rate.

EXAMPLE 2.5
Given the DSP system shown in Figures 2.16 to 2.18, where a sampling rate of 16,000 Hz is used and the anti-
aliasing filter is a second-order Butterworth lowpass filter with a cutoff frequency of 3.4 kHz, determine the
percentage of aliasing level at the cutoff frequency.
2.2 Signal Reconstruction 29

Solution:

fs ¼ 16; 000; fc ¼ 3; 400; and n ¼ 2

Since fa ¼ fc ¼ 3; 400 Hz, we have

sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 22
3:4

3:4 1:4142
aliasing level % ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 22ffi ¼ 13:7699 ¼ 10:26%
16  3:4

3:4

In comparison with the result in Example 2.4, increasing the sampling rate can reduce the aliasing level.

The following example shows how to choose the order of the anti-aliasing filter.

EXAMPLE 2.6
Given the DSP system shown in Figure 2.16, where a sampling rate of 40,000 Hz is used, the anti-aliasing filter is
the Butterworth lowpass filter with a cutoff frequency 8 kHz, and the percentage of aliasing level at the cutoff
frequency is required to be less than 1%, determine the order of the anti-aliasing lowpass filter.
Solution:
Using fs ¼ 40; 000, fc ¼ 8; 000, and fa ¼ 8; 000 Hz, we start at order 1 and increase the filter order until the
requirement is met.

sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
 21ffi
8

8 1:4142
 21 ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
n ¼ 1; aliasing level % ¼ sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ¼ 34:30%
40  8 1 þ ð4Þ2

8

1:4142
n ¼ 2; aliasing level % ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ¼ 8:82%
1 þ ð4Þ4

1:4142
n ¼ 3; aliasing level % ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ¼ 2:21%
1 þ ð4Þ6

1:4142
n ¼ 4; aliasing level % ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ¼ 0:55% < 1%
1 þ ð4Þ8

To satisfy the 1% aliasing level requirement, we choose n ¼ 4.


30 CHAPTER 2 Signal Sampling and Quantization

2.2.2 Practical Considerations for Signal Reconstruction: Anti-Image Filter


and Equalizer
The analog signal recovery for a practical DSP system is illustrated in Figure 2.19.
As shown in Figure 2.19, the DAC unit converts the processed digital signal yðnÞ to a sampled
signal ys ðtÞ, and then the hold circuit produces the sample-and-hold voltage yH ðtÞ. The transfer
function of the hold circuit can be derived as
1  esT
Hh ðsÞ ¼ (2.12)
sT
We can obtain the frequency response of the DAC with the hold circuit by substituting s ¼ ju in
Equation (2.12). It follows that
sinðuT=2Þ
Hh ðuÞ ¼ ejuT=2 (2.13)
uT=2
The magnitude and phase responses are given by
   
sinðuT=2Þ sinðxÞ
jHh ðuÞj ¼   
¼   (2.14)
uT=2  x 

:Hh ðuÞ ¼ uT=2 (2.15)


where x ¼ uT=2. In terms of Hz, we have
 
sinðpfTÞ
jHh ðf Þj ¼   (2.16)
 pfT 

1 − e − sT
H h (s) =
sT
Digital Signal Anti-
DAC Hold
Equalizer image
y ( n) Circuit y (t )
filter
y s (t ) y H (t )

y (n ) ys (t) yH (t) y(t)

n t t t
T T
(a) (b) (c) (d)
FIGURE 2.19
Signal notations at the practical reconstruction stage. (a) Processed digital signal. (b) Recovered ideal sampled
signal. (c) Recovered sample-and-hold voltage. (d) Recovered analog signal.
2.2 Signal Reconstruction 31

0.5
sin(x)/x

-0.5
-20 -15 -10 -5 0 5 10 15 20
x

0.8

0.6
|Hh(w)|

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3
Radians

FIGURE 2.20
Sample-and-hold lowpass filtering effect.

:Hh ðf Þ ¼ pfT (2.17)


The plot of the magnitude effect is shown in Figure 2.20.
The magnitude frequency response acts like lowpass filtering and shapes the sampled signal
spectrum of Ys ðf Þ. This shaping effect distorts the sampled signal spectrum Ys ðf Þ in the desired
frequency band, as illustrated in Figure 2.21. On the other hand, the spectral images are attenuated

Ys ( f )
Y( f ) Y( f − fs ) Y( f − 2 fs ) Spectral images

Sample-and-hold effect
sin( x )
x
f
0 fs 2 fs

FIGURE 2.21
Sample-and-hold effect and distortion.
32 CHAPTER 2 Signal Sampling and Quantization

due to the lowpass effect of sinðxÞ=x. This sample-and-hold effect can help us design the anti-image
filter.
As shown in Figure 2.21, the percentage of distortion in the desired frequency band is given by

distortion % ¼ ð1  jHh ðf ÞjÞ  100%


  
sinðpfTÞ (2.18)
¼ 1    100%
pfT 

EXAMPLE 2.7
Given a DSP system with a sampling rate of 8,000 Hz and a hold circuit used after DAC, determine
a. the percentage of distortion at a frequency of 3,400 Hz;
b. the percentage of distortion at a frequency of 1,000 Hz.
Solution:
a. Since fT ¼ 3; 400  1=8; 000 ¼ 0:425;
  
sinð0:425pÞ
distortion % ¼ 1     100% ¼ 27:17%
0:425p 

b. Since fT ¼ 1; 000  1=8; 000 ¼ 0:125;


  
sinð0:125pÞ
distortion % ¼ 1     100% ¼ 2:55%
0:125p 

To overcome the sample-and-hold effect, the following methods can be applied.


1. We can compensate the sample-and-hold shaping effect using an equalizer whose magnitude
response is opposite to the shape of the hold circuit magnitude frequency response, which is
shown as the solid line in Figure 2.22.
2. We can increase the sampling rate using oversampling and interpolation methods when a higher
sampling rate is available at the DAC. Using the interpolation will increase the sampling rate
without affecting the signal bandwidth, so that the baseband spectrum and its images are
separated further apart and a lower-order anti-aliasing filter can be used. This subject will be
discussed in Chapter 12.
3. We can change the DAC configuration and perform digital pre-equalization using a flexible digital
filter whose magnitude frequency response is against the spectral shape effect due to the hold
circuit. Figure 2.23 shows a possible implementation. In this way, the spectral shape effect can
be balanced before the sampled signal passes through the hold circuit. Finally, the anti-image
filter will remove the rest of images and recover the desired analog signal.
The following practical example will illustrate the design of an anti-image filter using a higher
sampling rate while making use of the sample-and-hold effect.
2.2 Signal Reconstruction 33

1.6

1.5

1.4

1.3
Equalizer gain

1.2

1.1

0.9

0.8

0.7

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6


Radians

FIGURE 2.22
Ideal equalizer magnitude frequency response to overcome the distortion introduced by the sample-and-hold
process.

Digital signal Anti-


Digital equalizer DAC Hold image
y (n ) filter y (t )
yeq (n ) ys (t )
yH (t )

FIGURE 2.23
Possible implementation using a digital equalizer.

EXAMPLE 2.8
Determine the cutoff frequency and the order for the anti-image filter given a DSP system with a sampling rate of
16,000 Hz and specifications for the anti-image filter as shown in Figure 2.24.
Design requirements:
• Maximum allowable gain variation from 0 to 3,000 Hz ¼ 2 dB
• 33 dB rejection at a frequency of 13,000 Hz
• Butterworth filter is assumed for the anti-image filter.
Solution:
We first determine the spectral shaping effects at f ¼ 3; 000 Hz and f ¼ 13; 000 Hz; that is,
34 CHAPTER 2 Signal Sampling and Quantization

Digital signal Anti-


DAC Hold image
y ( n) filter y(t )
y s (t )
y H (t )
FIGURE 2.24
DSP recover system for Example 2.8.

f ¼ 3; 000 Hz; fT ¼ 3; 000  1=16; 000 ¼ 0:1785

 
sinð0:1875pÞ
gain ¼   ¼ 0:9484 ¼ 0:46 dB
0:1875p 

and
f ¼ 13; 000 Hz; fT ¼ 13; 000  1=16; 000 ¼ 0:8125

 
sinð0:8125pÞ

gain ¼   ¼ 0:2177 z 13 dB
0:8125p 

This gain would help the attenuation requirement.


Hence, the design requirements for the anti-image filter are
• Butterworth lowpass filter
• Maximum allowable gain variation from 0 to 3,000 Hz ¼ 20.46 ¼ 1.54 dB
• 3313 ¼ 20 dB rejection at frequency 13,000 Hz.
We set up equations using log operations of the Butterworth magnitude function as

20 logð1 þ ð3; 000=fc Þ2n Þ1=2  1:54

20 logð1 þ ð13; 000=fc Þ2n Þ1=2  20

Ys ( f )
0.2177

0.9484

f kHz
0 3 13
. 16
. 3.2
FIGURE 2.25
Spectral shaping by the sample-and-hold effect in Example 2.8.
2.3 Analog Conversion and Quantization 35

From these two equations, we have to satisfy

ð3; 000=fc Þ2n ¼ 100:154  1

ð13; 000=fc Þ2n ¼ 102  1

Taking the ratio of these two equations yields


 
13; 000 2n 102  1
¼
3; 000 100:154  1

Then
1
n ¼ logðð102  1Þ=ð100:154  1ÞÞ=logð13; 000=3; 000Þ ¼ 1:86 z 2
2

Finally, the cutoff frequency can be computed as


13; 000 13; 000
fc ¼ 1=ð2nÞ
¼ ¼ 4; 121:30 Hz
ð102  1Þ ð102  1Þ1=4

3; 000 3; 000
fc ¼ ¼ ¼ 3; 714:23 Hz
ð100:154  1Þ1=ð2nÞ ð100:154  1Þ1=4

We choose the smaller one, that is,


fc ¼ 3; 714:23 Hz

With the filter order and cutoff frequency, we can realize the anti-image (reconstruction) filter using the second-
order unit gain Sallen-Key lowpass filter described in Figure 2.17.

Note that the specifications for anti-aliasing filter designs are similar to anti-image (reconstruction)
filters, except for their stopband edges. The anti-aliasing filter is designed to block the frequency
components beyond the folding frequency before the ADC operation, while the reconstruction filter
is designed to block the frequency components beginning at the lower edge of the first image after
the DAC.

You might also like