Sampling and Analog-to-Digital Conversion
Sampling and Analog-to-Digital Conversion
• Sampling Theorem
• Pulse Code Modulation (PCM)
• Digital Telephony: PCM IN T1 Carrier Systems
• Digital Multiplexing
• Differential Pulse Code Modulation (DPCM)
• Adaptive Differential PCM (ADPCM)
• Delta Modulation
• Vocoders and Video Compression
2
Sampling Theorem
Sampling Rate
fs= 1/Ts
Nyquist Rate
fs = 2B
fs > 2B 4
Sampling Theorem
𝛿 𝑇 ( 𝑡 )=∑ 𝛿 (𝑡 −𝑛 𝑇 𝑠)
𝑠
𝑛
𝑠
𝑇 𝑠 𝑛=− ∞
𝑛=∞
1 𝑗𝑛𝜔 𝑡
´𝑔 ( 𝑡 ) =𝑔 (𝑡 ) 𝛿 𝑇 ( 𝑡 )= ∑ 𝑔 (𝑡 )𝑒 𝑠
𝑠
𝑇 𝑠 𝑛=− ∞
Use the frequency shifting property to find the spectrum of the
sampled signal 𝑛 =∞
1
𝐺´ ( 𝑓 )= ∑ 𝐺(𝑓 −𝑛 𝑓 𝑠 )
𝑇 𝑠 𝑛=−∞ 5
Reconstruction from Uniform Samples
To reconstruct the continuous signal g(t) from the samples, pass
the samples through a low-pass filter with cutoff frequency =B Hz.
𝐻 ( 𝑓 ) =𝑇 𝑠 Π 𝜔
( 4𝜋 𝐵 )
h
( 𝑡 ) =2 𝐵 𝑇 𝑠 𝑠𝑖𝑛𝑐 (2 𝜋 𝐵𝑡 )
h
( 𝑡 ) =𝑠𝑖𝑛𝑐(2 𝜋 𝐵𝑡 ) h(t)
´𝑔 ( 𝑡 ) = ´𝑔 ( 𝑡 ) LPF 𝑔 ( 𝑡 )
∑ 𝑔(𝑛𝑇 𝑠 )𝛿 (𝑡 −𝑛𝑇 𝑠 )
𝑛
𝑔 ( 𝑡 ) =∑ 𝑔 ( 𝑘 𝑇 ) h(𝑡 − 𝑘𝑇 )=∑ 𝑔 ( 𝑘𝑇 ) 𝑠𝑖𝑛𝑐 [ 2𝜋 𝐵 (𝑡 −𝑘 𝑇 ) ]
𝑠 𝑠 𝑠 𝑠
𝑘 𝑘
6
Reconstruction from Uniform Samples
𝑔 ( 𝑡 ) = ∑ 𝑔 ( 𝑘 𝑇 𝑠 ) 𝑠𝑖𝑛𝑐 [ 2𝜋 𝐵(𝑡 − 𝑘 𝑇 𝑠)] Interpolation formula
𝑘
𝑔 ( 𝑡 ) = ∑ 𝑔 ( 𝑘 𝑇 𝑠 ) 𝑠𝑖𝑛𝑐 [ 2𝜋 𝐵𝑡− 𝑘 𝜋 ]
𝑘 7
Example 6.1
8
Practical Signal Reconstruction
~ 1
𝐺 ( 𝑓 ) =𝑃(𝑓 ) ∑ 𝐺(𝑓 − 𝑛 𝑓 𝑠)
𝑇𝑠 𝑛
To recover g(t) from we pass it through an equalizer E( f )
9
Practical Signal Reconstruction
~ 1
𝐺 ( 𝑓 )=𝐸 ( 𝑓 ) 𝐺 ( 𝑓 ) =𝐸(𝑓 )𝑃(𝑓 ) ∑ 𝐺(𝑓 −𝑛 𝑓 𝑠 )
𝑇𝑠 𝑛
𝑇 𝑠|𝑓 |≤ 𝐵
{
𝐸( 𝑓 ) 𝑃( 𝑓 )= Flexible 𝐵< ¿ 𝑓 ∨¿(1/ 𝑇 𝑠 − 𝐵)
0|𝑓 |> 𝑓 𝑠 − 𝐵
p(t)
𝑡 −0.5 𝑇 𝑝
𝑝(𝑡 )=Π
(𝑇𝑝 ) 𝑃( 𝑓 )=𝑇 𝑝 𝑠𝑖𝑛𝑐 ( 𝜋 𝑓 𝑇 𝑝 ) 𝑒 − 𝑗 𝜋 𝑓 𝑇 𝑝
~ 1
𝐺 ( 𝑓 ) =𝑃(𝑓 ) ∑ 𝐺(𝑓 − 𝑛 𝑓 𝑠)
𝑇𝑠 𝑛
𝜋 𝑓 𝑇𝑠
𝐸 ( 𝑓 )=𝑇 𝑠 . ≈ When Tp is very small
𝑠𝑖𝑛 ( 𝜋 𝑓 𝑇 𝑝 ) 𝑇 𝑝
11
Practical Issues in Sampling
Sampling at the Nyquist rate require ideal low-pass filter which is
unrealizable in practice.
fs=2B
fs > 2B
12
Practical Issues in Sampling
Aliasing
Practical signals are time-limited by
nature which means they can not be
band-limited at the same time.
13
Maximum Information Rate
A maximum of 2B independent pieces of information per second
can be transmitted, error free, over a noiseless channel of
bandwidth B Hz.
14
Nonideal Practical Sampling Analysis
Read details in textbook section 6.1.4
15
Sampling Theorem and Pulse Modulation
The continuous signal g(t) is sampled, and sample values are
used to modify certain parameters (amplitude, width, position) of
a periodic pulse train.
TDM
PAM
PWM
PPM
17
Pulse Code Modulation (PCM)
PCM is widely used as a tool to convert analog signal to digital
signal.
CD music recording
1- Bandwidth 20,000 Hz
2- sampling rate = 44,100 samples/sec
3- number of samples 16 bits/sample
Original signal 𝑚
(𝑡 )=∑ 𝑚 ( 𝑘 𝑇 ) 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 −𝑘 𝜋 )
𝑠
𝑘
Quantized signal 𝑚
^ (𝑡 )=∑ 𝑚
^ ( 𝑘 𝑇 𝑠) 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 −𝑘 𝜋 )
𝑘
( 𝑡 )=
Quantization noise 𝑞 ∑ [ 𝑚^ ( 𝑘 𝑇 𝑠) − 𝑚 ( 𝑘 𝑇 𝑠 ) ] 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 − 𝑘 𝜋 )
𝑘
𝑞 ( 𝑡 )=∑ 𝑞 ( 𝑘 𝑇 𝑠 ) 𝑠𝑖𝑛𝑐 ( 2𝜋 𝐵𝑡 − 𝑘 𝜋 )
𝑘
𝑇 /2
~2 1 2
𝑞 (𝑡)= lim ∫ ∑ 𝑞 ( 𝑘 𝑇 𝑠 ) 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 − 𝑘 𝜋 ) 𝑑𝑡
Power of q(t)
𝑇 → ∞ 𝑇 − 𝑇 /2 [ 𝑘
21
]
Quantization Error Analysis
𝑇 /2 0𝑚≠𝑛
∫ 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 − 𝑚 𝜋 ) 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 −𝑛 𝜋 ) 𝑑𝑡 = 1 𝑚 =𝑛
−𝑇 / 2
2𝐵
{
𝑇/2
~ 2 1 2 2
𝑞 (𝑡)= lim ∑ 𝑞 ( 𝑘 𝑇 𝑠 ) ∫ 𝑠𝑖𝑛𝑐 ( 2 𝜋 𝐵𝑡 −𝑘 𝜋 ) 𝑑𝑡
𝑇 →∞ 𝑇 𝑘 −𝑇 / 2
~
2 1 2 2BT: number of samples over
𝑞 (𝑡)= lim ∑ 𝑞 ( 𝑘 𝑇 𝑠)
𝑇 → ∞ 2 𝐵𝑇 𝑘 averaging interval T
∆𝑣 /2 2 2
~ 2 1 2 (∆ 𝑣) 𝑚 𝑝
Mean square
𝑞= ∫ 𝑞 𝑑𝑞= = 2 quantization error
∆ 𝑣 −∆ 𝑣 /2 12 3 𝐿
~ 2
𝑆 0 2 𝑚 (𝑡 )
Signal to Noise Ration (SNR) =3 𝐿 22
𝑁0 𝑚2𝑝
Nonuniform Quantization
Nonuniform quantization reduces the quantization error by
reducing the quantization level where the signal is more frequently
exist (at low amplitude).
The µ-law (North America and Japan)
µ is the compression parameter
𝑦= 1 𝜇𝑚
0 ≤ 𝑚 ≤ 1
ln (1+𝜇) (
ln 1+
𝑚𝑝 ) 𝑚𝑝
𝑁 0 [ ln (1+ μ ) ]2
2 𝑚 2𝑝
𝜇 ≫~2
𝑚 (𝑡 )
24
Transmission Bandwidth
B : Signal bandwidth in Hz
L : Quantization Level
n : Number of bits per sample
fs : Samples per second
BT: Transmission Channel Bandwidth
fs = 2*B
n = log2 L
Number of bits per second = 2*B*n
BT = Number of bits per second /2;
BT = B*n
26
Channel Bandwidth and SNR
Output SNR increase exponentially with the transmission
bandwidth BT.
𝑐=¿
~ 2
𝑆 0 𝑚 (𝑡 )
=3 𝐿2 2
𝑁0 𝑚𝑝
𝑆 𝑜 =𝑐(2)2 𝑛 𝑆 𝑜 = 𝑐(2)2 𝐵 𝑇
/𝐵
𝑁𝑜 𝑁𝑜
𝑆𝑜 𝑆𝑜 𝑆𝑜
( )
𝑁𝑜 𝑑𝐵
=10 𝑙𝑜𝑔10 ( )
𝑁𝑜 ( )
𝑁𝑜 𝑑𝐵
= ( 𝛼 + 6 𝑛 ) dB
ITU-T Specifications
30 Channels
Sampling: 2 µs pulse
Rate: 2.048 Mbit/s
28
Synchronizing and Signaling
100011011100
125 μs
193 bits
0.4-0.6 ms to detect
50 ms to reframe
29
Synchronizing and Signaling
8000 samples/sec
24 channels
1 frame bit
193 bits/frame
125 µs/frame
The framing bits pattern: 100011011100 (12 frame)
0.4 to 6 msec for frame detection
Up to 50 ms to reframe.
LSB of every sixth sample used for switching communication
(robbed-bit signaling).
30
Read the detail of frame signaling in textbook
Digital Multiplexing (DM)
Digital interleaving
Word interleaving
Overhead bits
(synchronization)
31
North America Digital Hierarchy (AT&T)
32
Signal Format DM 1/2
subframe
34
Plesiochronous digital hierarchy (PDH) according to ITU-T Recommendation G.704.
Differential Pulse Code Modulation
(DPCM)
DPCM exploits the characteristics of the source signals. It
reduce the number of bits needed per sample by taking
advantage of the redundancy between adjacent samples.
Instead of transmitting sample m[k] we transmit
Taylor Series
𝑚 ( 𝑡 +𝑇 )=𝑚 ( 𝑡 )+𝑇 𝑚 ˙(𝑡 )+ 𝑇 2𝑠 𝑇 3𝑠
𝑠 𝑠 !
𝑚
¨ (𝑡 ) + ! ⃛ ( 𝑡 )+ … ≈ 𝑚 ( 𝑡 ) +𝑇 𝑠 𝑚 ˙(𝑡 )
𝑚
2 3
𝑚 [ 𝑘 +1 ] ≈ 𝑚 [ 𝑘 ] +𝑇 𝑚 [ 𝑘 ] − 𝑚[ 𝑘 −1 ] For small Ts
𝑠
[ 𝑇𝑠 ]
𝑚 [ 𝑘 +1 ] ≈ m [ k ] +(m [ k ] − m [ k − 1 ] ) ≈ 2 m [ k ] − m [ k − 1 ]
36
Analysis of DPCM
Linear predictor
𝑑 [ 𝑘 ] =𝑚 [ 𝑘 ] − 𝑚
^ 𝑞 [𝑘 ]
𝑑 𝑞 [ 𝑘 ] = 𝑑 [ 𝑘 ] +𝑞 [ 𝑘 ]
𝑚 𝑞 [ 𝑘 ] =𝑚
^ 𝑞 [ 𝑘 ] +𝑑 𝑞 [ 𝑘 ]
𝑚 𝑞 [ 𝑘 ] =𝑚 [ 𝑘 ] − 𝑑 [ 𝑘 ]+𝑑 𝑞 [ 𝑘 ]
𝑚
𝑞 [ 𝑘 ] =𝑚 [ 𝑘 ]+ 𝑞 [𝑘 ]
mq[k] is a quantized version of m[k]
DPCM system
37
(a) transmitter (b) receiver
Adaptive Differential PCM (ADPCM)
Adaptive DPCM further improve the efficiency of DPCM encoding
by incorporating an adaptive quantizer (varied Δv) at the
encoder.
The quantized prediction error dq[k] is a good indicator of the
prediction error size. It can be used to change Δv to minimize
dq[k]. When the dq[k] fluctuate around large positive or negative
value then the prediction error is large and Δv needs to grow and
when dq[k] fluctuates around zero then Δv needs to decrease.
8-bit PCM sequence can be
encoded into a 4-bit ADPCM
sequence at the same sampling
rate. This reduce channel bandwidth
or storage by half with no loss in
quality.
Delta Modulation (DM)
Delta modulation oversample the baseband signal (4 time the
Nyquist rate) to increase the correlation between adjacent
samples. The increase in correlation results in a small
prediction error that can be encoded using only one bit (L=2).
In DM the information of the difference between successive
samples is transmitted by a 1-bit code word.
𝑚 𝑞 [ 𝑘 ] =𝑚 𝑞 [ 𝑘 − 1 ] +𝑑 𝑞 [ 𝑘 ]
𝑚 𝑞 [ 𝑘 − 1 ] =𝑚 𝑞 [ 𝑘 − 2 ] +𝑑 𝑞 [ 𝑘 −1 ]
𝑚 𝑞 [ 𝑘 ] =𝑚 𝑞 [ 𝑘 −2 ] +𝑑 𝑞 [ 𝑘 ] +𝑑 𝑞 [ 𝑘 − 1 ]
𝑘
𝑚𝑞 [ 𝑘 ] = ∑ 𝑑 𝑞 [ 𝑚 ]
𝑚= 0 0 1 2 3 4 2 1 -1 1
Delta Modulator and Demodulator
a) Delta modulation
b) Delta demodulators
c) Message signal versus integrator
output signal
d) Delta-modulated pulse trains
e) Modulation errors
Threshold of Coding and overloading
1- small step size E causes slope
overload
2- Large step size (E) causes
granular noise.
| 𝑚 ˙(𝑡 )|< 𝐸 / 𝑇 𝑠 | 𝑚 ˙(𝑡 )|< 𝐸 𝑓 𝑠
| 𝑚 ˙(𝑡 )|< 𝐸 𝑓 𝑠
If m(t) = A cos ωt
[ 𝐴 𝐸𝑓 𝑠
𝑚𝑎𝑥 ] 𝑣𝑜𝑖𝑐𝑒 ≅
𝜔
41
Linear Prediction Coding (LPC) Vocoders
𝐻 ( 𝑧 ) = 𝑔
𝐴 (𝑧)
𝑝 −1
(
𝐻 ( 𝑧 ) =𝑔 . 1− ∑ 𝑎 𝑖 𝑧
𝑖=1
−𝑖
)
The human speech production mechanism.
𝑝 −1
𝑔
𝐻 (𝑧 )=
𝐴 (𝑧 ) (
=𝑔 . 1 − ∑ 𝑎𝑖 𝑧
𝑖=1
−𝑖
)
The LPC analyzer
- Estimate the all-pole filter coefficients in A(z).
- The optimum filter coefficients are determined by minimizing
the mean square error (MSE) of the linear prediction error.
Video Compression
Video Compression
Pixel intensity Pixel intensity-128