review of probability theory - guceee.guc.edu.eg/courses/communications/comm502... ·...
TRANSCRIPT
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Comm. 502: Communication Theory
Lecture 3
Transmission of Baseband Signals
- Pulse Code Modulation.
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
: Transmission of Baseband SignalsRemember
Baseband channel: Coaxial cable or
pair of wires Conversion from a bit stream to a
Sequence of pulse waveform
PAM PCM
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Pulse Code Modulation (PCM)
PCM consists of three steps to digitize an analog signal:
1. Sampling: Convert the message signal to samples.
2. Quantization: Converting of samples to a set of discrete amplitudes.
3. Binary encoding: Translating the discrete set of samples into digital data.
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
. Quantization2 • It is not necessary to transmit the exact amplitude of the sampled
signal
• The original continuous signal may be approximated by a signal constructed of discrete amplitudes selected on a minimum error basis from an available set. (i.e quantization)
Definition:
• Quantization is the process of transforming the amplitude of a sampled signal into a discrete amplitude taken from a finite set.
sampled signal Quantized signal
)( snTX )( snTXq
Quantizer
XqnTXq s )()( snTX
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Uniform Quantizer
im
1im
2im
iiiq
q
xXxifmX
toaccordinggenerated
isXoutputquantizedThe
1
:
1ix
ix
1ix
2ix
X
Lixx
m iii ...,,2,1,
2
1
The distance between min and max of the signal is divided into L levels, with
step size
= (max - min)/L L is the number of levels.
Each sample falling in a zone is then approximated to the value of the level
in this zone.
Levels Levels Zone
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Example: (Uniform Quantizer)
• Assume we have a voltage signal with amplitudes Vmax=+40V and Vmin=-40V. • We want to use L=16 quantization levels. • Step Size = [40 – (-40)]/16 = 5
• The 16 zones are: -40 to -35 0 to 5 -35 to -30 5 to 10 -30 to -25 10 to 15 -25 to -20 15 to 20 -20 to -15 20 to 25 -15 to -10 25 to 30 -10 to -5 30 to 35 -5 to 0 35 to 40
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Uniform Quantization of Sinusoidal signal
Sampling and quantization of a signal.
Quantization A/D Conversion
16L
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Effect of changing the number of levels
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Uniform Quantizers
0 2 4 -4 -2
2
4
-4
-2
0 2 4 -4 -2
2
4
-4
-2
Mid-Tread Uniform Quantizer Mid-Rise Uniform Quantizer
Used for odd number of levels Used for even number of levels. The
levels do not include the value of zero
Xq Xq
Xs Xs
8 Levels 7 Levels
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
. Coding3
• Each level is then assigned a binary code.
• The number of bits required to encode the levels, or the number of bits per sample as it is commonly referred to, is obtained as follows:
n = log2 L L is the number of levels
• In our example, n = log2 16= 4
• The 16 level codes are therefore: 0000, 0001,0010,…….. and 1111
PCM
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
. Coding (Cont.)3
1111
0001
0000
0111
bit4n
Coding of a Quantized signal
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Quantization Noise (Error) of the Uniform Quantizer • When a signal is quantized, this introduces an error - the quantized signal is
an approximation of the actual amplitude value.
• The difference between quantized value (midpoint) and actual value is referred to as the quantization error q:
• The quantization error is uniformly distributed with pdf:
• The more levels, the smaller which results in smaller errors.
• BUT, the more levels, the more bits required to encode the samples.
Δ Δq
2 2
)1(
0
22
1
)(
otherwise
qqfQ
0 q
;)( XXqerroronQuantizati q
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
• Consider an input signal of continuous amplitude in the range and we use a uniform quantizer, then we define the step size of the quantizer as:
Since the mean of the quantization error
is zero, its variance (power or mean square value)
is derived as:
12
|3
1
1
)(
][
2
2/2/
3
2/
2/
2
2/
2/
2
22
q
dqq
dqqfq
QE
Q
Q
Variance (power) of Quantization error
0
Quantization Noise Ratio of a -to-Derivation of Output SignalUniform Quantizer
),( maxmax VV
L
Vmax2
2Q
Using equation (1)
/1
q
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
• Let n denotes the number of bits per sample used in the construction of binary code. We may write:
Using these equations, the step size can be written as:
and
Then the variance of the quantization error (noise power) becomes:
• The peak power of the analog signal can be expressed as:
• The output signal-to-quantization noise ratio of a uniform quantizer is given by:
nL 2 Ln 2log
n
V
2
2 max
n
Q V 22
max
22 2
3
1
12
L
Vmax2
Quantization Noise Ratio of a Uniform Quantizer-to-Derivation of Output Signal
2max
LV
4
222
max
LVP
n
Q
LLP
SQNR 22
2
22
2233
12/
4/
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Quantization Noise Ratio of a Uniform -to-Output SignalQuantizer
• The output signal-to-quantization noise ratio of a uniform quantizer is given by:
This equation shows that the output signal to quantization noise
ratio of the quantizer increases exponentially with increasing
the number of bits per sample n. Any increase in n leads
to increase in the transmission bandwidth
n
Q
LLP
SQNR 22
2
22
2233
12/
4/
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Quantization & Coding
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Example: Statistics of Speech Amplitudes
•Very low speech
amplitudes
predominante 50%
of the time.
•Large amplitude
values are
relatively rare.
•Uniform
quantization would
be wasteful for
speech signals. (normalized to its rms values))
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Uniform Quantizers-Non
• A nonuniform quantizer uses a variable step size.
• Basic Concept of Non-Uniform Quantizers
– Concentrate quantization levels within the range where the pdf of the message signal is large
1 iii xx
x
fX(x)
Representation Levels
Li ...,,2,1
1ixix
i 1 i
1ix
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Uniform Quantizers (Cont.)-Non
• Non-uniform quantization can provide small quantization errors of the weak signals and increase quantization errors of strong signals.
• The effect is to improve the overall SQNR by reducing the noise for the predominant weak signals at the expense of an increase in noise for the rarely occurring strong signals.
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Uniform Quantizers (Cont.)-Non
• The most commonly used compander (Compressor/Expander) uses a logarithmic compression Y=log X where the levels are crowded near the origin and spaced farther apart near the peak values of X.
• Two commonly used logarithmic compression laws are so called and A-compression laws defined as:
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Example:
Original Signal
After Compression
The dynamic range of a signal is compressed before
transmission and is expanded to the original value
at the receiver
Dynamic range
describes the ratio
between the largest and
smallest amplitude of the
signal.
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Law Quantizer-μ • Used in North America and Japan
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
m
m'
=5 =100=0
ln 1+μ mm' =
ln 1+μ
where m' is the compressed signal
Normalized to
maximum
value of the
amplitude of
the signal input
Output
Output
signal
input
signal
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Law Quantizer-A
• Used in Europe
A m 10 m
1+ln A Am' =
1+ln A m 1m 1
1+ln A A
where m' is the compressed signal
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
m
m'
A=1 A=100A=2
input
output
The µ-law algorithm
provides a slightly
larger dynamic range
than the A-law at the
cost of worse
proportional distortion
for small signals
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Companding (Compressor/Expander)
• It is often much cheaper to build ADCs which implement uniform quantization. • In the Transmitter: Compress the signal first, then apply uniform PCM. • In the Receiver: Demodulate the uniform PCM then expand the signal.
Compressor
Analog-to-Digital
Converter (ADC)
Input
Signal Transmitter
Expander
Output
Signal Receiver
Digital-to-Analog
Converter (DAC)
Channel
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Bandwidth of PCM signals • PCM codeword length is: n bits
• Sample rate: fs samples /second
• Bit rate R: n fs bits/second
• First null BW (with rectangular pulse shaping) the first null bandwidth is: n fs Hz
Bit rate ss nffSample
bitsR
#
)(log2 LffnRB ssPCM
Without Proof
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Bandwidth of PCM signals
We have:
The bandwidth of a PCM signal is at least 2n times larger
than the maximum frequency of the analog signal.
max2: ffIf s
max2: ffIf s
LfnffnRB sPCM 2maxmax log22
LfnfnfB sPCM 2maxmax log22
lowest bandwidth of PCM
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Digital Telephone
Voice channel: 4 kHz
8000 samples per second required
8 bits per sample
==> 64 kbps bit rate )( sfnR
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
SNR of PCM
• The peak signal power to the average noise power is given by:
• The average signal power to the average noise power is given by:
• Where is the channel bit error rate due to noise.
e
outpkPL
L
)1(41
3SNR
2
2
e
outPL
L
)1(41SNR
2
2
eP
Proof : see the
reference book
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
• Neglecting : the peak SNR resulting only from quantizing error is given by:
• The average SNR due to quantizing error only is given by:
• Since , the previous equations in dB can be written as:
• (6 dB law)
• for peak SNR and for average SNR
eP
23SNR Loutpk
2SNR Lout
nL 2
ndB 02.6SNR
77.4 0
Proof next page
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Proof of:
dBn
n
LSNR
LSince
n
n
dB
n
n
02.677.4
301.0277.4
]2log3[log10
)23log(10SNR
233
2
2
2
22
ndB 02.6SNR
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
SNR of PCM with Compression
• The 6-dB law (output SNR) in case of using compression becomes:
ndB 02.6SNR
)compandinglaw(,)]1[ln(log2077.4
)compandinglaw(,)]ln1[log2077.4 AA
levelsinputlargelysufficientFor
or
Proof : see the
reference book
Dr. Ahmed El-Mahdy COM 502: Comm. Theory
Quantization & Coding
Remember
word