Analog To Digital Conversion (A/D) : Engr. Francis B. Malit

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 66

Analog to Digital Conversion

(A/D)

Engr. Francis B. Malit


2.1 Basic Concepts in Signals
• A/D is the process of converting an analog
signal to digital signal, in order to transmit it
through a digital communication system.
• Electric Signals can be represented either in
Time domain or frequency domain.
– Time domain i.e
– We can get the value of that signal at any time (t)
by substituting in the v(t) equation.
Pulse Modulation
 Includes many different methods of converting
information for transferring pulses from a source to a
destination

 Four predominant methods:


- PWM (Pulse Width Modulation)
- PPM (Pulse Position Modulation)
- PAM (Pulse Amplitude Modulation)
- PCM (Pulse code Modulation)
Pulse Modulation…
• PWM – sometimes called pulse duration modulation (PDM) or
Pulse Length modulation (PLM). The pulse width is
proportional to the amplitude of the analog signal.
• PPM – the position of constant width pulse within a
prescribed time slot is varied according to the amplitude of
the analog signal.
• PAM – The amplitude of a constant-width, constant position
pulse is varied according to the amplitude of the analog
signal.
• PCM – the analog signal is sampled and converted to a fixed-
length, serial binary number for transmission.
Pulse modulation: (a) analog signal; (b) sample pulse; (c) PWM; (d) PPM; (e) PAM;
(f) PCM
ANALOG-TO-DIGITAL Conversion

A digital signal is superior to an analog signal. The


tendency today is to change an analog signal to digital
data. In this section includes techniques by pulse code
modulation, Pulse amplitude modulation and different
modulation techniques
Analog to Digital Encoding

Analog data Digital output 010111101


Pulse Code Modulation (PCM)

ƒ
The practical implementation of PCM uses
three processes:

Sampling
Quantizing
ƒ Binary Encoding
ƒ
Pulse Code Modulation
 Was developed by AT&T in 1937 at their Paris laboratories.
 It is the only one of digitally encoded modulation technique
that is used for digital transmission.
 The term pulse code modulation is somewhat of a
misnomer as it is not really a modulation form, but rather a
form of source coding.
 With PCM, the pulses are of fixed length and amplitude.
 It is a binary system where a pulse or a lack of a pulse within
a prescribed time slot represents either logic 1 or a logic 0
condition.
Signal Sampling
• Sampling is converting a continuous time
signal into a discrete time signal

• Categories: Sample and Hold operation


– Ideal sampling
– Natural Sampling
– Flat-top Sampling
Pulse Code Modulation (PCM)
Figure Components of PCM encoder
PCM Sampling
 the function of a sampling circuit in a PCM
transmitter is to periodically sample the
continually changing analog input signal and
convert those samples to a series of pulses that
can more easily be converted to a binary PCM code
Figure :Three different sampling methods for PCM
Natural sampling: (a) input analog signal; (b) sample pulse; (c) sampled output

Digital Communication Abdullah Al-


Meshal
Flat-top sampling: (a) input analog signal; (b) sample pulse: (c) sampled output
Ideal Sampling and Aliasing
• Sampled signal is discrete in time domain with
spacing Ts
• Spectrum will repeat for every fs Hz
• Aliasing (spectral overlapping) if fs is too small
(fs < 2fa)
• Nyquist sampling rate fs = 2fa
• Generally oversampling is done  fs > 2fa
(a)Non- Aliasing and (b)Aliasing

fs > 2fa

fs < 2fa
Sampling Rate
 The Nyquist sampling theorem establishes the
minimum sampling rate (fs) that can be used for a
given PCM system.

Where:

fs= minimum Nyquist sample rate (Hz)


fa= highest fequency to be sampled (Hz)
Example 2:

For a PCM system with a maximum audio


input frequency of 4 kHz, determine the
minimum sample rate and the alias frequency
produced if a 5-kHz audio signal were allowed
to enter the sample-and –hold circuit.
Example 1:

Telephone companies digitize voice by


assuming maximum frequency of 4000 Hz.
The sampling rate therefore is 8000
samples per second.
(a) Sample-and-hold circuit; (b) input and output waveforms
Sample and Hold Circuit output: Pulse Amplitude
Modulation (PAM)

(a)Analog Signal (b) PAM Signal


Pulse Amplitude Modulation (PAM)

Pulse Amplitude Modulation (PAM) is not used by itself


in data communication but it is the first step in Pulse Code
Modulation (PCM)
PAM is a form of signal modulation where the message
information is encoded in the amplitude of a series of signal
pulses.
The result is an analog signal with nonintegral values.
Quantization
• Quantization is done to make the signal
amplitude discrete

Quantizatio
Sampling

Mappin
Discrete Discrete

g
Time Time &

n
Analog Binary
Cont. Discrete
Signal Sequence
Ampl. Ampl
Signal Signal
Quantization and encoding of a sampled signal
The result of PAM is a series of pulses with amplitude values
between the maximum and minimum amplitudes of the
signal( with real values).
These values cannot be used in the encoding process.
Quantization: is a method of assigning integer values in a
specific range to sampled instances
Folded Binary Code:
 The PCM code shown in Table 1 is called folded binary
code. Except for the sign bit, the codes on the bottom half
of the table are a mirror of the codes on the top half.
 there are two codes assigned to zero volts: 100 (+0) and
000 (-0)
 for this example, the magnitude of the minimum step size
is 1 V.
 then, the maximum voltage that can be encoded with this
scheme is +3 V (111) or – 3 V (011).
 if the magnitude of a sample exceeds the highest
quantization interval, overload distortion (also called peak
limiting) occurs.
Table 1: Three bit PCM Code
Three - Bit PCM code
Folded Binary code ...
 Assigning PCM codes to absolute magnitudes is called
Quantizing.

 the magnitude of the minimum step size called


resolution, which is equal in magnitude to the voltage of
the least significant bit (or the magnitude of the
minimum step size of the DAC).

Note: The smaller the magnitude of the minimum step


size, the better (smaller) the resolution and the more
accurately the quantization interval will resemble the
actual analog sample.
(a) Analog input signal; (b) sample pulse; (c) PAM signal; (d) PCM code
Folded Binary Code . . .
 Figure(previous slide)shows an analog input signal, the
sampling pulse, the corresponding PAM signal, and the
PCM code.
 the analog sample is sampled three times
- first sample occurs at t1 at exactly +2V corresponds to
PCM code to 110
- sample 2 occurs at time t2 at voltage – 1 V which
corresponds to PCM code is 001.
- sample 3 occurs at t3 at +2.6V which corresponds to
PCM code 2.6 that would be rounded off to nearest valid
code (111 or +3V).
Folded Binary Code . . .
 rounded – off to the nearest valid code for sample 3 would
result to an error when the code is converted back to
analog by the DAC at the receiver end.
 this error called QUANTIZATION ERROR (Qe)
- quantization error is equivalent to additive white
noise (it alters the signal amplitude).
- it may add or subtract from the actual signal
- it is also called QUANTIZATION noise. (Qn)
- its maximum magnitude is :

Where: Vlsb is the minimum


step size or the resolution
Dynamic Range
 is the ratio of the largest possible magnitude to the
smallest possible magnitude that can be decoded by the
DAC.
 Mathematically:
Where: Vmin is the resolution and
Vmax is the maximum voltage
magnitude that can be decoded by the
DACs

 in dB :
NOTE!
the dynamic range is independent of resolution. If the
resolution is reduced by a factor of 2, to maintain the
same maximum input amplitude, the dynamic range must
double.
Dynamic Range . . .
 the number of bits used for a PCM code depends on
the dynamic range.
 DR is simply the maximum binary number for a
system
- the number of bits for a PCM code is:

- for a minimum value of n,

Where:
n = number of PCM bits, excluding sign bit
DR = absolute value of dynamic range
Question???
Why
“It is because one PCM code is used for 0V, which is not
considered for a dynamic range.”

Therefore,

In dB:

For large values of n:


Dynamic Range . . .
EXAMPLE:

 A PCM system has a following parameters: a


maximum analog input frequency of 4 kHz, a
maximum decoded voltage at the receiver of ± 2.55 V,
and a minimum dynamic range of 46 dB. Determine
the following: minimum sample rate, minimum
number of bits used in the PCM code, resolution, and
the quantization error.
Dynamic Range versus Number of PCM Magnitude Bits
Coding Efficiency
 is a numerical indication of how efficiently a PCM code is
utilized.
 it is the ration of the minimum number of bits required to
achieve a certain dynamic range to the actual number of
PCM bits used.

mathematically:
Signal-to-quantization Noise Ratio

For minimum amplitude (101 or 001)

For a maximum amplitude input signal of 3 V (111 0r


011)
Example:
Determine the SQR for a 2- Vrms signal and a
quantization interval of 0.2 V
Activity
1. Determine the dynamic range in dB for the following n-bit linear
sign
-magnitude PCM codes: n = 7, 8, 12, 14.

2. Determine the SQR for the following input signal and quantization
noise magnitudes.
Vs Vn (V)
1 V rms 0.01
2 Vrms 0.02
3 Vrms 0.01
4 V rms 0.2
Activity
3. Determine the resolution and quantization noise for an
8-bit linear sign-magnitude PCM code for the following
maximum decoded voltages:
Vmax = 3.06 Vp, 3.57 Vp, 4.08 Vp, and 4.59 Vp.

4. For a resolution of 0.04 V, determine the voltages for


the following linear 7-bit sign-magnitude PCM codes.

a. 0110101
b. 0000011
c. 1000001
d. 0111111
e. 1000000
Liner Vs. Nonlinear PCM Codes
Linear

• early PCM systems used linear codes


• with linear encoding, the accuracy (resolution) for
the higher amplitude analog signals is the same as
for the lower amplitude signals, and the SQR for the
lower amplitude signals is less than for the higher-
amplitude signals.

Nonlinear
• the step size increases with the amplitude of the
input signal.
Liner Vs. Nonlinear PCM Codes
Nonlinear

• the step size increases with the amplitude of


the input signal.
• there are more codes at the bottom of the
scale than there are at the top, thus
increasing the accuracy for the smaller
signals.
• the distance between two successive codes is
greater for the higher-amplitude
Coding Methods:
 there are several coding methods used to quantize PAM
into 2n levels .

• Level-at-a-time coding
– this type of coding compares the PAM signal to a ramp
waveform while binary counter is being advanced at a
uniform rate.
- requires a very fast clocking if the number of PCM code
is larger.
- generally limited to a low speed applications.
Coding Methods:

• Digit –at – a – time coding

- this type of coding determines each digit of the PCM code


sequentially.
- digit-at-a-time coders provide a compromise between
speed and complexity.
- one common kind of digit-at-a-time coder, is called
feedback coder, uses a successive approximation register (SAR).
With this type of coder, the entire PCM code word is
determined simultaneously.
Coding Methods:
• Word-at-a-time coding

- word-at-a-time coders are flash encoders and are


more complex; however they are more suitable for high
speed applications.
- one common type of word-at-a-time coder uses
multiple threshold circuits.
Logic circuits sense the highest threshold circuit sensed
by PAM input signal and produce the approximate PCM
code. This method is impractical for large values of n.
COMPANDING
 is the process of compressing, then expanding.

 the higher amplitude signals are compressed


(amplified less than the lower-amplitude signals)
prior to transmission, then expanded (amplified
the more than the smaller amplitude signals) at
the receiver.
Analog Companding

 Historically, analog companding was


implemented using specially designed diodes
inserted in the analog signal path in the PCM
transmitter prior to the sample-and-hold circuit.
 Analog expansion was also implemented with
diodes that were placed just after the receive
low-pass filter.
Analog Companding
Methods of Analog companding
µ - law companding

 In the United States and Japan, µ - law companding


is used.
 The compression characteristic is

 WHERE:

Vmax = maximum uncompressed analog input amplitude (volts)


Vin = amplitude of the input signal at a particular instant of time (volts)
Vout = compressed output amplitude (volts)
µ = parameter used to define the amount of compresseion (unitless)
µ - law compression characteristics
µ - law compression characteristics…

 the higher µ, the more compression.


 the parameter µ determines the range of signal power
in which the SQR is relatively constant. Voice transmission
requires a minimum dynamic range of 40-dB and a seven
bit PCM code.
 for a relatively constant SQR and 40-dB dynamic range,
µ = 100 or larger is required.
 the early Bell System transmission systems used a
seven bit PCM code.
 the most recent digital transmission systems use eight
bit PCM codes and µ = 255
Example:
For a compressor with µ = 255, determine

(a)The voltage gain for the following relative values


of Vin : Vmax , 0.75 Vmax , 0.5Vmax , and 0.25Vmax .
(b) The compressed output voltage for a maximum
input voltage of 4 V.
(c) Input and output dynamic range and
compression.
Answer:
a. Vin Compressed voltage gain
Vmax 1
0.75 Vmax 1.26
0.50 Vmax 1.75
0.25 Vmax 3.00

b. Vin Vo

Vmax = 4 4
0.75 Vmax = 3 3.78
0.50 Vmax = 2 3.5
0.25 Vmax 3

c. 12 dB, 2.5 dB, 9.5 dB


Methods of Analog companding
A – law companding

 In Europe, the CCITT has established A – law companding


to be used to approximate true logarithmic companding.
 for a intended dynamic range , A – law companding has
slightly flatter SQR µ - law.
 A – law companding, however, inferior to µ - law in terms
of small – signal quality
 the compression characteristic for A – law is
Methods of Analog companding
A – law companding
DIGITAL COMPANDING

Digital companding involves compression at


the transmit end after the input sample has
converted to a linear PCM code and
expansion at the receive end prior to PCM
decoding.
Digital Companding
DIGITAL COMPANDING
See figure : µ 255 compression characteristics (positive values
only)

See figure : 12-bit-to8-bit digital companding


(a) 8-bit µ 255 compressed code format
(b) µ 255 encoding table
(c) µ 255 decoding table
µ 255 compression characteristics
(positive values only)
12-bit-to8-bit digital companding
(a) 8-bit µ 255 compressed code format
(b) µ 255 encoding table
(c) µ 255 decoding table
Example:
Determine the 12-bit linear code, the 8-bit
compressed code, and the recovered 12-bit code
for a resolution of 0.01V and analog sample
voltages of

(a)0.05 V
(b) 0.32 V
(c) 10.23 V
Percentage error

Example

The maximum percentage error will occur for the


smallest number in the lowest subsegment within
any given segment. Because there is no
compression error in segments 0 and 1, for segment
3 the maximum % error is computed as follows:
PCM line speed
 Line speed is simply the rate at which serial PCM
bits are clocked out of the transmitter onto the
transmission line or rate at which serial PCM bits
are clocked off the transmission line into the
receiver.
 It is directly proportional to the sample rate and
the number of bits in the compressed PCM code.
Mathematically,

You might also like