Ch 6 Sampling and Analog-to-Digital Conversion
description
Transcript of Ch 6 Sampling and Analog-to-Digital Conversion
Ch 6Sampling and Analog-to-Digital Conversion
ENGR 4323/5323Digital and Analog Communication
Engineering and PhysicsUniversity of Central Oklahoma
Dr. Mohamed Bingabr
Chapter Outline
β’ 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 Compression2
Sampling Theorem
Sampling is the first step in converting a continuous signal to a
digital signal.
Sampling Theorem determines the minimum number of
samples needed to reconstruct perfectly the continuous signal
again from its samples.
Sampling Theorem: A continuous function x(t) bandlimited to B
Hz can be reconstructed from its samples if it was sampled at
rate equal or greater than 2 B samples per second. If the
sampling rate equals 2 B then it is called the Nyquist rate.3
Sampling Theorem
5
πΏπ π (π‘ )=β
ππΏ(π‘βππ π )
π (π‘ )=π (π‘ )πΏπ π (π‘ )=β
ππ(ππ π )πΏ(π‘βππ π )
πΏπ π (π‘ )= 1
π π β
π=ββ
π=β
π πππ π π‘
π (π‘ )=π (π‘ )πΏπ π (π‘ )= 1
π π βπ=β β
π=β
π(π‘ )π ππ ππ π‘
Use the frequency shifting property to find the spectrum of the sampled signal
πΊ ( π )= 1π π
βπ=β β
π=β
πΊ( π βπ π π )
Reconstruction from Uniform Samples
6
π» ( π )=π π Ξ ( π4π π΅ )
h (π‘ )=2π΅π π π πππ(2π π΅π‘)
To reconstruct the continuous signal g(t) from the samples, pass the samples through a low-pass filter with cutoff frequency =B Hz.
h (π‘ )=π πππ(2π π΅π‘ )
Sampling at Nyquist rate: 2BTs = 1
LPFπ (π‘ )=βππ(ππ π )πΏ(π‘βππ π )
π (π‘ ) π (π‘ )
π (π‘ )=βππ (ππ π ) h (π‘βππ π )=β
ππ (ππ π )π πππ [2π π΅(π‘βπππ ) ]
h(t)
Reconstruction from Uniform Samples
7
π (π‘ )=βππ (ππ π ) π πππ [ 2π π΅π‘βππ ]
π (π‘ )=βππ (ππ π ) π πππ [2π π΅(π‘βππ π )] Interpolation formula
Example 6.1
8
Find a signal g(t) that is band-limited to B Hz and whose samples are g(0) = 1 and g(Β±Ts) = g(Β±2Ts) = g(Β±3Ts) =β¦= 0 where the sampling interval Ts is the Nyquist interval, that is Ts = 1/2B.
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|π |> π π βπ΅
The equalizer filter E( f ) must be low-pass in nature to stop all frequency content above fs - B, and it should be the inverse of P( f ) within the signal bandwidth of B Hz.
10
Practical Signal Reconstruction-Example
11
π (π‘ )=Ξ ( π‘β 0.5ππ
π π)
~πΊ ( π )=π ( π )1π π
βππΊ( π βπ π π )
π ( π )=ππ π πππ (π π π π)πβ π π π π π
πΈ ( π )=π π . π ππ ππ (π π π π )
βπ π
π πWhen Tp is very small
p(t)
Practical Issues in Sampling
Sampling at the Nyquist rate require ideal low-pass filter which is unrealizable in practice.
fs=2B
fs > 2B
12
AliasingPractical signals are time-limited by nature which means they can not be band-limited at the same time.
Practical Issues in Sampling
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
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.
Techniques for communication using pulse modulation:
1- Pulse Amplitude Modulation (PAM)
2- Pulse Width Modulation (PWM)
3- Pulse Position Modulation (PPM)
4- Pulse Code Modulation (PCM)
5- Time Division Multiplexing (TDM)
16
Pulse Code Modulation (PCM)
PCM is widely used as a tool to convert analog signal to digital signal.
The signal range [-mp , mp] is divided into L subintervals (Ξv = 2mp/L).
L levels require n binary digits (bits) where L = 2n. 18
Telephone Vs. Music
Phone conversation for 5 minutes1- Bandwidth 3500 Hz2- sampling rate = 8000 samples/sec3- number of samples 8 bits/sample
CD music recording1- Bandwidth 20,000 Hz2- sampling rate = 44,100 samples/sec3- number of samples 16 bits/sample
Compare the channel bandwidth required to transmit speech vs. music.
Compare the storage capacity required to store 5 minutes phone conversation vs. 5 minutes music. 19
Advantage of Digital Communication
1) Withstand channel noise and distortion much better than analog.
2) With regenerative repeater it is possible to transmit over long distance.
3) Digital hardware implementation is flexible4) Digital coding provide further error reduction, high fidelity and
privacy.5) Easier to multiplex several digital signals.6) More efficient in exchanging SNR for bandwidth.7) Digital signal storage is relatively easy and inexpensive.8) Reproduction with digital messages is reliable without
deterioration.9) Cost of digital hardware is cheaper and continue to decrease.
20
Quantization Error Analysis
Original signal π (π‘ )=βππ (ππ π ) π πππ (2π π΅π‘βππ )
Quantized signal οΏ½ΜοΏ½ (π‘ )=βποΏ½ΜοΏ½ (ππ π ) π πππ (2π π΅π‘βππ )
Quantization noise π (π‘ )=βπ
[οΏ½ΜοΏ½ (ππ π )βπ (ππ π ) ]π πππ (2π π΅π‘βπ π )
π (π‘ )=βππ (ππ π )π πππ (2π π΅π‘βππ )
Power of q(t)~π2(π‘)= lim
π β β
1π β«
βπ /2
π /2
[βπ π (ππ π ) π πππ (2π π΅π‘βππ ) ]2ππ‘
21
Quantization Error Analysis
β«βπ /2
π /2
π πππ (2π π΅π‘βππ ) π πππ (2π π΅π‘βππ )ππ‘={ 0πβ π1
2π΅π=π
~π2(π‘ )= limπ β β
1πβ
ππ2 (ππ π ) β«
βπ /2
π /2
π πππ2 (2π π΅π‘βππ )ππ‘
~π2(π‘ )= lim
π β β
12π΅π β
ππ2 (ππ π ) 2BT: number of samples over
averaging interval T
Mean square quantization error
~π2= 1β π£ β«
β βπ£ /2
β π£/2
π2ππ=(βπ£ )2
12=ππ
2
3πΏ2
π0
π0=3πΏ2~π2(π‘ )ππ
2Signal to Noise Ration (SNR) 22
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)
π¦=1
ln (1+π)ln (1+
ππππ ) 0 β€ π
ππβ€ 1
The A-law (rest of the world)
π¦={ π΄1+ ln π΄ ( πππ )1
1+ln π΄ (1+ ln π΄πππ )
0 β€ πππ
β€ 1π΄
1π΄ β€ π
ππβ€ 1
23
Β΅ is the compression parameter
Nonuniform Quantization
SNR for Β΅-lawπ0
π0= 3πΏ2
[ ln (1+ ΞΌ )]2
π2β«ππ
2
~π2(π‘)
24
For L=128 (7-bit), Β΅ = 100For L=256 (8-bit), Β΅ = 255
Transmission Bandwidth
B : Signal bandwidth in HzL : Quantization Leveln : Number of bits per samplefs : Samples per secondBT: Transmission Channel Bandwidth
fs = 2*Bn = log2 L Number of bits per second = 2*B*nBT = Number of bits per second /2;BT = B*n
Usually the sampling rate is higher than the Nyquest rate 2B to improve signal to noise ratio (SNR). 25
Example
A signal m(t) band-limited to 3 kHz is sampled at a rate 33.333% higher than the Nyquist rate. The maximum acceptable error in the sample amplitude (the maximum quantization error) is 0.5% of the peak amplitude mp. The quantization samples are binary coded. Find the minimum bandwidth of a channel required to transmit the encoded binary signal. If 24 such signals are time-division-multiplexed, determine the minimum transmission bandwidth required to transmit the multiplexed signal.
26
Channel Bandwidth and SNR
Output SNR increase exponentially with the transmission bandwidth BT.
ππ
ππ=π (2)2π
π=ΒΏππ
ππ=π (2)2 π΅π /π΅
( ππ
ππ)ππ΅=10 πππ10( ππ
π π) ( ππ
ππ)ππ΅=(πΌ+6π) dB
Increasing n by 1 (increasing one bit in the codeword) quadrables the output SNR (6 dB increase).
27
π0
π0=3πΏ2~π2(π‘ )ππ
2
Digital Telephony: PCM in T1 Carrier Systems
Regenerative repeater every 6000 feet
T1 Specifications24 ChannelsSampling: 2 Β΅s pulseRate: 1.544 Mbit/sDS1: digital signal level 1
ITU-T Specifications30 ChannelsSampling: 2 Β΅s pulseRate: 2.048 Mbit/s
28
Synchronizing and Signaling
8000 samples/sec24 channels1 frame bit193 bits/frame125 Β΅s/frameThe framing bits pattern: 100011011100 (12 frame)0.4 to 6 msec for frame detectionUp to 50 ms to reframe.LSB of every sixth sample used for switching communication (robbed-bit signaling).
Read the detail of frame signaling in textbook 30
Digital Multiplexing (DM)
Digital interleavingWord interleavingOverhead bits (synchronization)
Time division multiplexing of digital signals: (a) digit interleaving; (b) word (or byte) interleaving;(c) interleaving channel having different bit rate; (d) alternate scheme for (c).
31
Signal Format DM 1/2
Bit interleaving4 channelsChannel rate1.544 Mbit/sOverhead frames are M,C,FEach frame consist of four subframe Each subframe has six overhead bitsEach subframe has six 48-interleaved data bitsThe 48 interleaved data bits from the four channels (12 bits/ch). Each frame has 1152 data bits (48*6*4) and 24 overhead bits(6*4).Efficiency =1152/1176=98%
The F digits are periodic 01010101F digits identify the framesThe M digits 0111 identify subframesThe C digits for bit stuffing and Asynchronous
33
subframe
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
d[k] = m[k] β m[k-1]
d[k] has lower amplitude so it require less bits per sample or the size of quantization level will be smaller if we keep the number of bits unchanged which reduces the quantization error.
We can improve the DPCM by estimating the kth value from previous values and then transmit the difference
35π [π ]=π [π ] βοΏ½ΜοΏ½ [π ]
Differential Pulse Code Modulation (DPCM)
Linear predictor
π (π‘+π π )=π (π‘ )+π π Λπ(π‘)+
π π 2
2! οΏ½ΜοΏ½ (π‘ )+π π
3
3! οΏ½βοΏ½ (π‘ )+β¦βπ (π‘ )+π π Λπ(π‘)
π [π+1 ] βπ [π ]+π π [π [π ] βπ [πβ1 ]π π ]
π [π+1 ] β m [ k ]+(m [ k ] βm [ k β 1 ])β 2 m [ k ] βm [ k β1 ]
36
Taylor Series
For small Ts
Analysis of DPCM
37
Linear predictorπ [π ]=π [π ] βοΏ½ΜοΏ½π [π ]
ππ [π ]=π [π ]+π [π ]
ππ [π ]=οΏ½ΜοΏ½π [π ]+ππ [π ]
ππ [π ]=π [π ] βπ [π ]+ππ [π ]
ππ [π ]=π[π ]+π [π ]
mq[k] is a quantized version of m[k]
DPCM system (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 overloading1- small step size E causes slope overload2- Large step size (E) causes granular noise.| Λπ (π‘)|<πΈ /π π | Λπ (π‘ )|<πΈ π π
41
| Λπ (π‘ )|<πΈ π π
If m(t) = A cos Οt
[ π΄πππ₯ ]π£ππππβ πΈ π π π
Linear Prediction Coding (LPC) Vocoders
Table 6.1
The human speech production mechanism.
Typical pressure impulses.
π» (π§ )= ππ΄(π§ )
π» (π§ )=π .(1ββπ=1
π
ππ π§βπ)
β 1
Linear Prediction Coding (LPC) Vocoders
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.
π» (π§ )= ππ΄(π§)
=π .(1 ββπ=1
π
πππ§βπ)
β1