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

DSP Lecture 2

This document discusses digital processing of analog signals through analog-to-digital conversion (ADC). It covers: 1) The process of ADC which captures analog signals (e.g. sound) and converts them to numeric digital values that can be stored and processed digitally. 2) Reasons for using ADCs include that computers are digital while real-world signals are analog, and sensors produce analog outputs that need conversion to digital for processing. 3) Important concepts in ADC including filtering, sampling, quantization, encoding, and ensuring a stable voltage reference. Aliasing is also discussed, where multiple frequencies can be represented by the same digital samples, introducing ambiguity.

Uploaded by

hussein alamutu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

DSP Lecture 2

This document discusses digital processing of analog signals through analog-to-digital conversion (ADC). It covers: 1) The process of ADC which captures analog signals (e.g. sound) and converts them to numeric digital values that can be stored and processed digitally. 2) Reasons for using ADCs include that computers are digital while real-world signals are analog, and sensors produce analog outputs that need conversion to digital for processing. 3) Important concepts in ADC including filtering, sampling, quantization, encoding, and ensuring a stable voltage reference. Aliasing is also discussed, where multiple frequencies can be represented by the same digital samples, introducing ambiguity.

Uploaded by

hussein alamutu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

CPE 531

DIGITAL SIGNAL
PROCESSING
LECTURE 2
Digital Processing of Analogue Signals

DEPARTMENT OF COMPUTER ENGINEERING


UNIVERSITY OF ILORIN
Lecture Outline
• Illustration of Digital
processing of analogue
signals
• Analogue I/O interface for
real-time DSP systems
• Analogue-to-digital
conversion (ADC)
• Introduction to sampling
What is Analog To Digital Conversion?
• It’s a process of capturing the analog electric signal (such as sound captured
by a microphone) and converting it to a series of numeric “digital” values to
be stored/processed by a digital computer or DSP. The electronic device
which is used for this conversion process has been known to be the A/D
or ADC (Analog-To-Digital Converter).

Figure 2.1 Example of an ADC Chip


Reasons for ADCs
• Our need to convert analog signals to digital data stems
from the fact that our computers are digital ones. They
cannot handle the analog signal and therefore, there should
be a device which converts the signal from analog to digital
domain (ADC).
• Most signals are analog in nature and the electronic sensors
which we use for capturing these phenomena are also
analog. For example, the temperature sensor converts
temperature in °C to an analog voltage that’s proportional
to the value of temperature. So do the microphone,
pressure sensor, light sensor and so on.
• Hence, we need a way to read analog voltage and convert it
to digital values which we can program our computers to Figure 2.2
Temperature Sensor Provides Analog Output. An
manipulate it mathematically in order to achieve real-time ADC Will Make it Possible To Read The Temperature
monitoring and/or control or whatever. On the computer
Image Credit to Ti.com
Examples of Analogue to Digital Conversions

• Finger snap switch • Analogue LED Dimer

Figure 2.3. Examples of analogue to digital conversions in real life applications


https://deepbluembedded.com/analog-to-digital-converter-how-adc-work-pic/
Analog I/O interface for real-time DSP systems
The real-world signals are usually in analog form, the interface converts the
analog signal into a digital one. Figure 2.4 shows the place of the interface in a real
system.

x(𝑡) ADC 𝑥(𝑛) y(𝑛) y(𝑡)


Input Digital Output
(Sample processor DAC
Filter filter
and Hold)

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

Figure 2.5 Representation of DSP Application


Analogue to Digital conversion steps
• The analog input filter limits the bandwidth of the analog input signal (e.g.,
recording voice / songs through a microphone)
• The ADC converts the analog input signal into digital form, for wide band
signals ADC is preceded by a sample and hold circuit.
• Digital processor is at the heart of the system, it implements various DSP
algorithms. Motorola’s MC68000 , DSP56000 and Texas Instrument’s
TMS320C50 are popular Digital processors.
• DAC converts the processed digital data into analog form, followed by an
analog filter to give the final output (e.g., processed music output that you
can hear through a speaker)
Analogue-to-digital conversion (ADC)

Figure 2.6 Block diagram of ADC

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

• Sampling is the acquisition of an


analog signal at discrete time
intervals
• Sometimes called periodic sampling:
the process of representing a
continuous signal with a sequence of
discrete data values

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;

b) Two different sinewaves that


pass through the points of the
discrete sequence.

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.

𝑥 𝑛 = sin 2𝜋𝑓0 𝑛𝑡𝑠 = sin(2𝜋(𝑓0 +𝑘𝑓𝑠 )𝑛𝑡𝑠 ) (2.1)

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

Frequency ambiguity effects of Eqn. 2.1):

(a) sampling a 7 kHz


sinewave at a sample rate of 6 kHz;

(b) sampling a 4 kHz sinewave at


a sample rate of 6 kHz;

Same amplitude (energy) but different sinewaves


(1KHz wave aliased from 7KHz wave)

Same amplitude (energy) but different sinewaves


(-2KHz wave aliased from 4KHz wave)
(c) spectral relationships showing aliasing of
the 7 and 4 kHz sinewaves.

Figure 2.10: Explaining aliases graphically


Another Aliasing example – Shark’s tooth pattern

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.

• These discrete sequence representations of a continuous signal have unavoidable


ambiguities in their frequency domains. These ambiguities must be taken into
account in all practical digital signal processing algorithms.
Fun stuff: Other effects of Aliasing

Have you ever wondered, whenever you


watched fast running car movies e.g.
Fast and Furious ☺ where the camera
pans along the driving vehicle, there was
always one particular speed where the
spokes in the wheels appeared to
remain stationary or even move
backwards ?
(can someone try to explain)
Aliasing!
When aliasing occurs, the signal you’re
trying to sample appears to have a constant
level, i.e., you cannot observe an oscillation.
This happens when the sampling period is
Figure 2.12 Aliasing occurring in digital photography, and relevant in equal to the oscillation period, and the
analog-to-digital conversion sampling device (your eyes in this case ☺ )
will only reliably measure a fixed signal
Addressing Aliasing in Analogue to Digital Conversion
Option 1:
Increase the sampling rate so that the Nyquist frequency (`Nyquist freq' =
(sampling rate)/2) is larger than the end of the frequency spectrum. As arbitrary
signals have frequency content that extends out to infinity, you cannot
increase the sampling rate to infinity. The other option is to choose a suitable
maximum frequency that you need to sample.

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.

𝐹𝑠 : The Sampling Frequency of an ADC

𝐹𝑚𝑎𝑥 : The Maximum Frequency In The Analog Signal


Being Converted

Violating this rule will lead to further problems and loss


of significant information about the signal. It’s near to
impossible to get an idea of what does the original
signal look like before conversion. That’s why some Figure 2.13
Engineers select an ADC with a sampling rate (𝐹𝑠) of As long as your sampling rate is high enough (more than
about 10 x 𝐹𝑚𝑎𝑥 to avoid operating near to the double the max signal frequency), you can always detect
the signal with high accuracy
fundamental limitations of the sampling.
Addressing Aliasing in Analogue to Digital Conversion (2)

Option 2:

Use an anti-aliasing filter to remove all frequency content greater than the Nyquist
frequency.

Aliasing problem is a challenge where frequencies above Nyquist frequency get


mapped to lower frequencies

If an anti-aliasing filter is applied before before sampling, it will remove all


unwanted inputs. Any energy remaining above the Nyquist frequency (folding
frequency) will be mapped onto lower frequencies. On most modern digital
equipment, this filtering is taken care of for you
The anti-aliasing filter (Low-pass filter)

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

Figure 2.15: Different filter characteristics


Class exercise
• Digitizing of music soundwaves for a
compact disc was carried out at a
period of 2.27 𝑋10−2 milliseconds.
• Bearing in mind the need for anti-
aliasing to filter out any higher order
frequency content in the input signal
as any frequencies higher than the
Nyquist frequency will be aliased.
What would be the Nyquist freq to
work with?
Figure 2.16: Connections to a Compact Disc
Time to do the exercise
Class exercise
• 𝑇𝑠 = 2.27 𝑋10−5 seconds.
1
• 𝐹𝑠 = … sampling rate
𝑇𝑠

1
=
2.27 𝑋10−5 s
= 44.1𝐾𝐻𝑧
𝐹𝑠
Nyquist Frequency =
2

44.1 𝑥 103
=
2

= 22.1 KHz
Sampling of Low-pass signals

The analog signal should be sampled at the rate of at least


2𝑓𝑚𝑎𝑥 (the highest frequency component in the signal is 𝑓𝑚𝑎𝑥 ), for its
complete description.

Nyquist rate is the term used to describe the sampling frequency if it is


close to 2𝑓𝑚𝑎𝑥 .
Sampling of Low-pass signals - Illustration
Consider the situation of sampling a signal such as a continuous real-valued
lowpass x(t) signal whose spectrum is shown in Figure 2.17. Notice that the
spectrum is symmetrical around 0Hz, and the spectral amplitude is 0 above +B Hz
and below –B Hz; i.e., the signal is band-limited. (Practically, the term band-limited
signal implies that any signal energy outside the range of ±BHz is below the
sensitivity of the system.)

The x(t) time signal is called a low-pass signal because its spectral energy is low
in frequency.

Figure 2.17: spectrum of a low-pass x(t) signal


Sampling of Low-pass signals - 2
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 - 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 spectral replications are now overlapping the original baseband


spectrum centered at zero Hz. Limiting our attention to the band ±fs/2 Hz, we
see two very interesting effects. First, the lower edge and upper edge of the
spectral replications centered at +fs and –fs now lie in our band of interest.
This situation is equivalent to the original spectrum folding to the left at +fs/2
and folding to the right at –fs/2. Portions of the spectral replications now
combine with the original spectrum, and the result is aliasing errors.

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

Spectrum of Right sampling following Shannon-Nyquist


theorem.

Signals in the foldover region are not recoverable. To


recover all the components of a signal, we must sample at a
rate greater than (or equal to) twice the highest frequency
component

Spectrum of an undersampled signal, showing aliasing


(foldover region).

Fig. 2.20 Spectrum of a well sampled and undersampled signal


Addressing undersampling – lowpass analog
filtering
Sampling a continuous signal at a rate that’s greater than 2B
prevents replications of the signal of interest from overlapping
each other, but all of the noise energy still
(a) ends up in the range between –fs/2 and +fs/2 of our discrete
spectrum shown in Figure 2.21(a).

This problem is solved in practice by using an analog lowpass


anti-aliasing filter prior to A/D conversion to attenuate any
unwanted signal energy above +B and below –B Hz as shown
in Figure 2.21 (b) An example lowpass filter response shape is
shown as the dotted line superimposed on the original
(b) continuous signal spectrum in Figure 2.21 (b). Notice how the
output spectrum of the lowpass filter has been band-limited,
and spectral aliasing is avoided at the output of the A/D
converter.
Fig. 2.21 Lowpass analog filtering prior to sampling at a rate of fs Hz.
Oversampling
Analog signals are usually sampled at the
minimum allowable frequency for economical
reasons – more power demands for higher
frequencies. However, if an analog signal is
sampled at a much higher rate than the Nyquist
limitation and then got filtered by a digital filter to
limit its bandwidth, we may have some interesting
results (though not encouraged). For example, a
20-bit ADC can be made to act as a 24-bit ADC
with 256× oversampling.

The over-sampling technique is typically used in


audio frequency ADCs where the required
sampling rate (typically 44.1kHz) is very low
compared to the clock speed of typical logic
circuits (>1MHz). In this case, by using the extra
bandwidth to distribute quantization error onto out
of band frequencies, the accuracy of the ADC can Fig. 2.22 Time and frequency domain representations of the
be greatly increased at no additional cost. sampling process. The spectra of the signal (b) before and (d) after
sampling should be compared.
Sampling of bandpass signals
If the bandwidth of the signal, B is small compared to the lower and upper band edge frequencies, it is
uneconomical to use the lowpass sampling theorem.

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.

Fig. 2.23 A bandpass signal


Bandpass sampling theorem

The bandpass sampling theorem states that:

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

The band pass filter allows the frequencies between 40 to 50kHz


Theoretical sampling rate is 20kHz
Illustration of Bandpass filtering
The band pass filter allows the frequencies between 40 to 50kHz
Theoretical sampling rate is 20kHz

Steps:

1. Signal passes through the bandpass filter


2. Sampling - the sampling frequency is 20kHz, so the samples are seen at the
integer multiples of 20kHz.
3. Convolution operation in frequency domain between the input spectrum and
the sampling impulses.
Bandpass filtering – graphical illustration

(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

Quantizing and Encoding

You might also like