DSP Lecture 2
DSP Lecture 2
DIGITAL SIGNAL
PROCESSING
LECTURE 2
Digital Processing of Analogue Signals
Figure 2.4
Block diagram of a simplified, generalized real-time digital signal
processing system.
Representation of DSP Application
ADC DAC
Analogue
to Digital
converter
Filtering and Sampling: the analog signal is converted into a discrete-time continuous amplitude signal
through sampling (using a sample and hold (S/H) circuit) after being filtered (anti-aliasing – to be discussed
later).
Quantizing: the amplitude of each signal sample is quantized into one of the 2𝐵 levels, where B is the
number of bits used to represent a sample in the ADC.
Encoding: The discrete amplitude levels are encoded into distinct binary Words of length B bits.
Worth noting for the conversion process
• Analog To Digital Conversion process needs an
extremely stable voltage reference Vref+ and Vref–
representing the maximum allowable voltage swing
for the input in order to be correctly converted to
digital value with respect to the limits which are set
by the analog reference Vref.
• The easiest way to guarantee a stable Vref is to use a
resistor and a capacitor to resist any sudden drop in
voltage and protect your system. You can also use a
Zener diode as well to guarantee a stable voltage
reference which immunes your system against any
sudden changes in power supply increase/drop. The
concept is indicated in the diagram in Figure 2.7 Figure 2.7
Ensuring a stable analog voltage for ADC
Expanding more on Sampling
Figure:2.8.
In practice, sampling is performed by applying a continuous signal to an analog-to-digital (A/D) converter
whose output is a series of digital values.
Important concept to note: Aliasing
This represents signal ambiguity in the frequency domain
To illustrate:
class exercise –
Given the following sequence of values 𝑥(𝑛) which represent instantaneous values of a
time-domain sinewave taken at periodic intervals. Draw the sign wave from which the
values were extracted.
x(0) = 0
x(1) = 0.866
x(2) = 0.866
x(3) = 0
x(4) = –0.866
x(5) = –0.866
x(6) = 0,
Time to draw the resulting sinewave
Solution: Resulting sinewave(s) - Frequency ambiguity:
a) discrete-time sequence of
values;
Figure 2.9.
The original sequence of values could, with equal validity, represent sampled values of both sinewaves.
The key issue is that if the data sequence represents periodic samples of a sinewave,
we cannot unambiguously determine the frequency of the sinewave from those sample values alone.
Aliases - mathematically
When sampling at a rate of 𝑓𝑠 samples/second, if k is any positive or negative
integer, we cannot distinguish between the sampled values of a sinewave of 𝑓0
Hz and a sinewave of (𝑓0 +𝑘𝑓𝑠 ) Hz.
The implication of Eqn. (2.1) is that an x(n) sequence of digital sample values,
representing a sinewave of 𝑓0 Hz, also exactly represents sinewaves at other
frequencies, namely, 𝑓0 + 𝑘𝑓𝑠 .
Aliases - graphically
Figure 2.11:
Shark’s tooth pattern: (a) aliasing at multiples of the sampling frequency;
(b) aliasing of the 7 kHz sinewave to 1 kHz, 13 kHz, and 19 kHz.
Understanding the Shark-tooth pattern example for
aliasing
• From the shark-tooth pattern example, we see that our sampling of a 7 kHz
sinewave at a sample rate of 6 kHz will provide a discrete sequence of numbers
whose spectrum ambiguously represents tones at 1 kHz, 7 kHz, 13 kHz, 19 kHz, etc.
Sampling Rate
The rate at which an ADC converts the continuous analog signal to digital
data is called “Sampling Rate”. And if it takes 𝑇𝑠 time to convert a single
sample, then the sampling rate of this ADC is 𝐹𝑠 = 1Τ𝑇𝑠 . Then the original
analog signal can be reproduced from the discrete-time digital values by
mathematical interpolation. The accuracy in this procedure is dictated by the
combined effect of the sampling rate and quantization error.
Sampling Theorem
Theoretically, and to get the minimal information about
the original analog signal, an ADC must sample and
convert the analog signal with a frequency of
𝐹𝑠 >= 2𝐹𝑚𝑎𝑥
Which satisfies the Shannon-Nyquist sampling
theorem.
Option 2:
Use an anti-aliasing filter to remove all frequency content greater than the Nyquist
frequency.
An anti-aliasing filter is a low pass filter with the cutoff frequency (i.e., the -3 dB
frequency) set to the Nyquist frequency. This filter cuts out any higher order
frequency content in the input signal as any frequencies higher than the
Nyquist frequency would be aliased. With these frequencies removed from the
signal, the ADC can now sample the remaining harmonic content without
creating false low-frequency errors.
Figure 2.14 Example second order active low-pass filter that can be used as an anti-aliasing filter.
Reminder of different filter characteristics
1
=
2.27 𝑋10−5 s
= 44.1𝐾𝐻𝑧
𝐹𝑠
Nyquist Frequency =
2
44.1 𝑥 103
=
2
= 22.1 KHz
Sampling of Low-pass signals
The x(t) time signal is called a low-pass signal because its spectral energy is low
in frequency.
Figure 2.18: spectral replications of the sampled low-pass signal when fs /2 > B;
Sampling of Low-pass signals - 3
Given that the continuous x(t) signal, whose spectrum is shown in Figure
2.18, is sampled at a rate of fs samples/second, we can see the spectral
replication effects of sampling in Figure 2.18 showing the original spectrum in
addition to an infinite number of replications. The period of spectral replication is
fs Hz. Figure 2.18 is the spectrum of the sequence of x(n) sampled values of the
continuous x(t) signal
Figure 2.18: spectral replications of the sampled low-pass signal when fs /2 > B;
Sampling of Low-pass signals - 4
In practical A/D conversion schemes, fs is always greater than 2B to separate
spectral replications at the folding frequencies (Nyquist Frequency) of ±fs/2.
This very important relationship of fs ≥ 2B is known as the Nyquist criterion. To
illustrate why the term folding frequency is used, lower the sampling frequency to
fs = 1.5B Hz. The spectral result of this undersampling is illustrated in Figure
2.19.
Folds
(leading to the term
‘folding frequency’)
Figure 2.19: frequency overlap and aliasing when the sampling rate is too low because fs /2 < B.
Sampling of Low-pass signals – effect of
undersampling
The discrete sampled values associated with the spectrum of Figure 2.19 no
longer truly represent the original input signal. The spectral information in the
bands of –B to –B/2 and B/2 to B Hz has been corrupted.
Undersampling – another example
We can use a technique known as bandpass sampling to sample a continuous bandpass signal that is
centered about some frequency other than zero Hz. When a continuous input signal’s bandwidth and center
frequency permit us to do so, bandpass sampling not only reduces the speed requirement of A/D converters
below that necessary with traditional lowpass sampling;
it also reduces the amount of digital memory necessary to capture a given time interval of a continuous
signal.
2𝑓𝐻 2𝑓𝐿
≤ 𝐹𝑆 ≤
𝑛 𝑛−1
where:
𝑓𝐻
𝑛=
𝐵 (n is an integer, rounded up to largest integer)
Illustration of Bandpass filtering
(a)
(b)
Fig. 2.24 (a) Front end of the system. (b) Spectrum of received signal
Steps:
(a)
(b)
(c)
Fig. 2.25 (a) Output of the bandpass filter. (b) Sampling function (c) Output of sampler
Explanation of the bandpass filtering steps
1.Fig a, shows the signal after it is passed through the bandpass filter
2.Fig b, shows the process of sampling, the sampling frequency is
chosen to be 20kHz, so the samples are seen at the integer multiples
of 20kHz.
3.Fig c, illustrates the result of convolution operation in frequency
domain between the input spectrum and the sampling impulses.
References
• https://deepbluembedded.com/analog-to-digital-converter-how-adc-work-pic/
• https://resources.pcb.cadence.com/blog/2020-anti-aliasing-filter-design-and-
applications-in-sampling
• Isukapalli Y. (DSP Introduction notes)
• Lyons, R.G., Understanding Digital Signal Processing Evans D., Quantization and
Encoding
• https://slideplayer.com/slide/13774234/
• https://legacy.cs.indiana.edu/~port/teach/541/sig.proc.html
Next class