You are on page 1of 32

SIGNALS and SYSTEMS

Lecture 3

Analog-to-Digital Conversion (ADC)


Digital-to-Analog Conversion
(DAC)

Assoc.prof. Kamala Pashayeva


Sampling
Most of the signals directly encountered in science and
engineering are continuous:
light intensity that changes with distance;
voltage that varies over time;
a chemical reaction rate that depends on temperature, etc.
Analog-to-Digital Conversion (ADC) and Digital-to-Analog
Conversion (DAC) are the processes that allow digital
computers to interact with these everyday signals.

11 February 2020 2
Sampling
Sampling - Conversion of a continuous-time signal to discrete
time.

11 February 2020 3
Sampling
Sampling allows the use of
modern digital electronics to
process, record, transmit,
store, and retrieve C T
signals.

 audio: MP3, CD, cell


phone
 pictures: digital camera,
printer Example: digital cameras record
 video: D V D sampled images.
 everything on the web
11 February 2020 4
Sampling
Photographs in newsprint are “half-tone” images. Each point is black or
white and the average conveys brightness.
Zoom in to see the binary pattern.

11 February 2020 5
Sampling
Every image that we see is sampled by the retina, which contains ≈ 100
million rods and 6 million cones (average spacing ≈ 3µm) which act as
discrete sensors.

11 February 2020 6
Analog signal to be digitized
 This signal is a voltage that varies
over time;
 We will assume that the voltage
can vary from 0 to 4.095 volts,
corresponding to the digital
numbers between 0 and 4095 that
will be produced by a 12 bit
digitizer;

11 February 2020 7
Sampling
 Block diagram is broken into two sections, the sample-and-hold (S/H), and
the analog-to-digital converter (ADC).
 The sample-and-hold is required to keep the voltage entering the ADC
constant while the conversion is taking place.
 The output of the sample-and-hold is allowed to change only at periodic
intervals, at which time it is made identical to the instantaneous value of the
input signal. Changes in the input signal that occur between these sampling
times are completely ignored.
Sampled Digital output
Analog input analog
S/H signal ADC
Sampling converts the independent variable from continuous to
discrete.
11 February 2020 8
Quantization

11 February 2020 9
Effects of quantization
Any one sample in the digitized signal can have a maximum
error of ±½ LSB (Least Significant Bit, jargon for the distance
between adjacent quantization levels).
Figure (d) shows the quantization error for this particular
example, found by subtracting (b) from (c), with the appropriate
conversions.
The digital output (c), is equivalent to the continuous input (b),
plus a quantization error (d).
The quantization error appears very much like random noise.

11 February 2020 10
Quantization error
Quantization adds a specific amount of random noise to the
signal.
The additive noise is uniformly distributed between ±½ 𝐿𝑆𝐵,
has a mean of zero, and a standard deviation of 1/12 LSB
(0.29 𝐿𝑆𝐵).
 8 bit digitizer adds an rms noise of: 0.29 /256  1/900 of the full
scale value.
 12 bit conversion adds a noise of: 0.29 /4096 1 /14000 of the
full scale value
 16 bit conversion adds: 0.29 /65536  1 /227000 of the full scale
value
Number of bits determines the precision of the data !
11 February 2020 11
Quantization error
When the analog signal remains at about the same value for
many consecutive samples, then model of quantization isn’t valid!
The output remains
stuck on the same digital
number for many samples in a
row, even though
the analog signal may be
changing up to ±½ LSB

Instead of being an
additive random noise, the
quantization error now looks
like a thresholding
effect or weird distortion
11 February 2020 12
Dithering
Dithering is a common technique for improving the digitization of
these slowly varying signals.
A small amount of random noise is added to the analog signal.
The added noise is normally distributed with a standard deviation of
2/3 LSB, resulting in a peak-to-peak amplitude of about 3 LSB.

11 February 2020 13
Dithering
Subtractive Dither -
• using a computer to generate random numbers;
• passing them through a DAC to produce the added noise;
• after digitization, the computer can subtract the random numbers
from the digital signal using floating point arithmetic.

Adding noise provides more information !

The simplest method is to use the


noise already present in the analog
signal for dithering!
11 February 2020 14
Sampling
Proper sampling - if you can exactly reconstruct the analog
signal from the samples, you must have done the sampling
properly.

 The analog signal is a constant


DC value, a cosine wave of zero
frequency.
 All of the information needed to
reconstruct the analog signal is
contained in the digital data.

Proper sampling.

11 February 2020 15
Sampling
Sine has a frequency of 0.09 of the
sampling rate.
90 cycle/second sine wave being
sampled at 1000 samples/second.
There are 11.1 samples taken over
each complete cycle of the sinusoid.

These samples correspond to only


one analog signal, and therefore the
analog signal can be exactly
reconstructed.

11 February 2020 16
Sampling
 The sine wave's frequency is 0.31
of the sampling rate.
 only 3.2 samples per sine wave
cycle.

The samples are a unique


representation of the analog signal.
All of the information needed to
reconstruct the continuous waveform
is contained in the digital data.

11 February 2020 17
Sampling
 The sine wave's frequency is 0.95
of the sampling rate.
 only 1.05 samples per sine wave
cycle.
The samples represent a
different sine wave.
The original sine wave of 0.95
frequency misrepresents itself as
a sine wave of 0.05 frequency in
the digital signal.
This phenomenon of sinusoids
changing frequency during
Improper sampling
sampling
11 February 2020
is called aliasing. 18
Aliasing
Suppose we have a sinusoidal signal 𝑥 𝑡 = cos 2𝜋800𝑡 . When we sampled it, we replaced t
in the continuous signal 𝑥(𝑡) with regularly spaced time points 𝑛𝑇𝑠
𝑥 𝑛 = 𝑥 𝑛𝑇𝑠
Suppose that we sample this 800 Hz sinusoid at 𝑓𝑠 = 600 samples/second. Sampled signal is:
𝑥 𝑡 = cos 2𝜋800𝑡
𝑥 𝑛 = cos 2𝜋800𝑛𝑇𝑠
𝑥 𝑛 = cos 2𝜋 200 + 600 𝑛𝑇𝑠
𝑥 𝑛 = cos 2𝜋200𝑛𝑇𝑠 + 2𝜋600𝑛𝑇𝑠
1 1
𝑇𝑠 = , 𝑠𝑜 𝑇𝑠 = . We will replace this in the right-most term.
𝑓𝑠 600
1
𝑥 𝑛 = cos 2𝜋200𝑛𝑇𝑠 + 2𝜋600𝑛
600
𝑥 𝑛 = cos 2𝜋200𝑛𝑇𝑠 + 2𝜋𝑛
The cosine function is periodic with period 2𝜋. That is why we will obtain
𝑥 𝑛 = cos 2𝜋200𝑛𝑇𝑠 .
When we sample a 800 Hz sinusoid at 600 samples/second, we cannot distinguish it from a
200 Hz sinusoid. It is called aliasing.
11 February 2020 19
Sampling Theorem
Shannon sampling theorem Nyquist sampling theorem

A continuous signal can be properly sampled, only if it does


1
not contain frequency components above one-half ( ) of the
2
sampling rate.

For instance, a sampling rate of 2000 samples/second requires the analog


signal to be composed of frequencies below 1000 cycles/second.
If frequencies above this limit are present in the signal, they will be aliased
to frequencies between 0 and 1000 cycles/second

11 February 2020 20
Nyquist frequency and Nyquist rate
Nyquist frequency/rate is one-half the sampling rate.
Consider an analog signal composed of frequencies between DC
and 3 kHz.
To properly digitize this signal it must be sampled at 6,000
samples/sec (6 kHz) or higher. Suppose we choose to sample at
8,000 samples/sec (8 kHz), allowing frequencies between DC and
4kHz to be properly represented.

In this situation their are four important frequencies:


1. the highest frequency in the signal, 3 kHz;
2. twice this frequency, 6 kHz;
3. the sampling rate, 8 kHz;
4. one-half the sampling rate, 4 kHz (Nyquist frequency)
11 February 2020 21
Nyquist frequency and Nyquist rate
 Digital signal cannot contain
frequencies above ½ the
sampling rate (Nyquist
frequency/rate).

 When the frequency of the


continuous wave is below the
Nyquist rate, the frequency of
the sampled data is a match.

 When the continuous signal's


frequency is above the Nyquist
rate, aliasing changes the
frequency into something that can
be represented in the sampled
data.
11 February 2020 22
Nyquist frequency and Nyquist rate
Aliasing is a double curse:
 information can be lost about the higher and the lower frequency.
 aliasing can change the phase.
Aliasing has changed the frequency
and introduced a 1800 phase shift.
Only two phase shifts are possible: 00
(no phase shift) and 1800 (inversion)

11 February 2020 23
Impulse Train
Impulse train is a continuous signal
consisting of a series of narrow spikes
(impulses) that match the original signal at
the sampling instants.

Between these sampling times the


value of the waveform is zero.

11 February 2020 24
Signal spectra

Figure (a) shows an analog signal we wish to sample. Its


frequency spectrum in (b) is composed only of frequency
components between 0 and about 0.33 fs, where fs is the
sampling frequency we intend to use.
11 February 2020 25
Signal spectra

Sampling the signal in (a) by using an impulse train produces the signal
shown in (c), and its frequency spectrum shown in (d). This spectrum is a
duplication of the spectrum of the original signal. Each multiple of the
sampling frequency, fs, 2fs, 3fs, 4fs, etc., has received a copy and a left-
forright flipped copy of the original frequency spectrum. The copy is called
11the upper
February 2020 sideband, while the flipped copy is called the lower sideband. 26
Signal spectra

Sampling has generated new frequencies.


Is this proper sampling? The answer is yes, because the signal in (c) can
be transformed back into the signal in (a) by eliminating all frequencies
above ½fs. An analog low-pass filter will convert the impulse train, (b),
back into the original analog signal, (a).
11 February 2020 27
Signal spectra

Figure (e) shows an example of improper sampling, resulting from too low of
sampling rate. The analog signal still contains frequencies up to 3.3 kHz, but
the sampling rate has been lowered to 5 kHz.

11 February 2020 28
Overlapping problem

The frequency spectrum, (f), shows the problem: the duplicated portions of the
spectrum have invaded the band between 0 and ½ of the sampling frequency.
Although (f) shows these overlapping frequencies as retaining their separate identity,
in actual practice they add together forming a single confused mess. Since there
is no way to separate the overlapping frequencies, information is lost, and the
original signal cannot be reconstructed.
11 February 2020 29
Digital-to-Analog Conversion
 The simplest method for digital-to-analog conversion is to pull the samples from
memory and convert them into an impulse train.
 The original analog signal can be perfectly reconstructed by passing this
impulse train through a low-pass filter, with the cutoff frequency equal to ½ of
the sampling rate.
 The original signal and the impulse train have identical frequency spectra
below the Nyquist frequency (½ the sampling rate). At higher frequencies, the
impulse train contains a duplication of this information.

11 February 2020 30
Digital-to-Analog Conversion
it is difficult to generate the required narrow pulses in electronics. Nearly all DACs
operate by holding the last value until another sample is received. This is called a
zeroth-order hold, the DAC equivalent of the sample-and-hold used during
ADC. The zeroth-order hold produces the staircase appearance shown in (c).

11 February 2020 31
Digital-to-Analog Conversion
In the frequency domain, the zeroth-order hold results in the spectrum of the
impulse train being multiplied by the dark curve shown in (d), given by the
equation:

The general form:


The frequency spectrum of the
sin 𝜋𝑥 zeroth-order hold signal is equal to
𝜋𝑥
- sinc function or 𝒔𝒊𝒏𝒄(𝒙). the product of two curves: sinc(x) and
11 February 2020 "correct" spectrum 32

You might also like