Transcript Source Coding: Part 1
Source Coding: Part 1-Formatting Topics covered from Chapter 2 (Digital Communications Bernard Sklar) Chapter 3 (Communication Systems-Simon Haykin)
1
2
Layering of Source Coding
• •
Source coding includes
▫ Formatting (input data) Sampling Quantization Symbols to bits (Encoding) ▫ Compression
Decoding includes
▫ Decompression ▫ Formatting (output) Bits to symbols Symbols to sequence of numbers Sequence to waveform (Reconstruction) 3
Layering of Source Coding
4
Formatting
•
The first important step in any DCS:
▫ Transforming the information source to a form compatible with a digital system 5
Formatting of Textual Data (Character Codes)
A textual information is a sequence of alphanumeric characters Alphanumeric and symbolic information are encoded into digital bits using one of several standard formats, e.g, ASCII, EBCDIC 6
Character Coding (Textual Information)
Example 1:
In ASCII alphabets, numbers, and symbols are encoded using a 7-bit code 7 A total of
2 7 = 128
different characters can be represented using a 7-bit unique ASCII code
Formatting of Analog Data
•
To transform an analog waveform into a form that is compatible with a digital communication, the following steps are taken:
1.Sampling
2.Quantization and Encoding 3.Base-band transmission (PCM) 8
Sampling
Strictly band limited Band unlimited 9
10
Sampling in Frequency Domain
11
Sampling Theorem
▫ The sampling theorem for strictly band-limited signals of finite energy in two equivalent parts Analysis : A band-limited signal of finite energy that has no frequency components higher than W hertz is completely described by specifying the values of the signal at instants of time separated by 1/2W seconds.
Synthesis : A band-limited signal of finite energy that has no frequency components higher than W hertz is completely recovered form knowledge of its samples taken at the rate of 2W samples per second. (using a low pass filter of cutoff freq. W) ▫ Nyquist rate (fs) The sampling rate of 2W samples per second for a signal bandwidth of W hertz ▫ Nyquist interval (Ts) 1/2W (measured in seconds) 12
Type of Sampling
• • • •
Ideal Natural Practical Sample and Hold (Flat-top)
13
Ideal Sampling ( or Impulse Sampling)
x(t)x (t) x(t) T s Is accomplished by the multiplication of the signal
x(t)
by the uniform train of impulses Consider the instantaneous sampling of the analog signal
x(t)
14 Train of impulse functions select sample values at regular intervals
Ideal Sampling
15
Practical Sampling
In practice we cannot perform ideal sampling It is not practically possible to create a train of impulses Thus a non-ideal approach to sampling must be used We can approximate a train of impulses using a train of very thin rectangular pulses: 16
Natural Sampling
If we multiply
x(t)
by a train of rectangular pulses
xp(t)
, we obtain a gated waveform that approximates the ideal sampled waveform, known as
natural sampling
or
gating
17
Natural Sampling
Each pulse in
x p (t)
has width
T s
and amplitude
1/T s
The top of each pulse follows the variation of the signal being sampled
X s X s (f)
is the replication of
X(f)
periodically every
f s (f)
is weighted by
C n
Hz
Fourier Series Coeffiecient The problem with a natural sampled waveform is that the tops of the sample pulses are not flat It is not compatible with a digital system since the amplitude of each sample has infinite number of possible values Another technique known as
flat top sampling
is used to alleviate this problem; here, the pulse is held to a constant height for the whole sample period This technique is used to realize Sample-and-Hold (S/H) operation In S/H, input signal is continuously sampled and then the value is held for as long as it takes to for the A/D to acquire its value 18
Flat-Top Sampling
Time Domain 19 Frequency Domain
Flat-Top Sampling
20
Aliasing
• Aliasing Phenomenon ▫ The phenomenon of a high-frequency component in the spectrum of the signal seemingly taking on the identify of a lower frequency in the spectrum of its sampled version.
▫ To combat the effects of aliasing in practices Prior to sampling : a low-pass anti-alias filter is used to attenuate those high-frequency components of a message signal that are not essential to the information being conveyed by the signal The filtered signal is sampled at a rate slightly higher than the Nyquist rate.
▫ Physically realizable reconstruction filter
The reconstruction filter is of a low-pass kind with a passband
extending from –W to W
The filter has a non-zero transition band extending form W to f stop -W Thus use Engr. Nyquist formula
21
Fig. a Under-sampled Signal
22
Fig. b Over-sampled Signal
23
Pulse-Amplitude Modulation (PAM)
• •
Output of Sampling (natural/S&H) is known as PAM Pulse-Amplitude Modulation (PAM)
▫ The amplitude of regularly spaced pulses are varied in proportion to the corresponding sample values of a continuous message signal.
▫ Two operations involved in the generation of the PAM signal Instantaneous sampling of the message signal m(t) every T s seconds, Lengthening the duration of each sample, so that it occupies some finite value T. 24
Other forms of Pulse Modulations
25
Other forms of Pulse Modulations
• PDM (Pulse-duration modulation) ▫ Pulse-width or Pulse-length modulation.
▫ The samples of the message signal are used to vary the duration of the individual pulses.
▫ PDM is wasteful of power • PPM (Pulse-position modulation) ▫ The position of a pulse relative to its un-modulated time of occurrence is varied in accordance with the message signal.
26
Other forms of Pulse Modulations
27
Quantization
28
Quantization
•
Amplitude quantizing:
amplitudes.
Mapping samples of a continuous amplitude waveform to a finite set of
Out In
Average quantization noise power Signal peak power Signal power to average quantization noise power 29
30
Qunatization example
amplitude x(t)
111 3.1867
110 2.2762
101 1.3657
Quant. levels
100 0.4552
011 -0.4552
010 -1.3657
boundaries
001 -2.2762
x(nTs): sampled values xq(nTs): quantized values
000 -3.1867
PCM codeword Ts: sampling time t
110 110 111 110 100 010 011 100 100 011 PCM sequence
31
Quantization Effect
•
Sampling and Quantization Effects
▫ Quantization (Granularity) Noise: Results when quantization levels are not finely spaced apart enough to accurately approximate input signal resulting in truncation or rounding error.
▫ Quantizer Saturation or Overload Noise: Results when input signal is larger in magnitude than highest quantization level resulting in clipping of the signal.
▫ Timing Jitter: Error caused by a shift in the sampler position. Can be isolated with stable clock reference.
32
Non-uniform Quantization • •
Nonuniform quantizers
have unequally spaced levels ▫ The spacing can be chosen to optimize the Signal-to-Noise Ratio for a particular type of signal It is characterized by: ▫ Variable step size ▫ Quantizer size depend on signal size 33
34 M any signals such as speech have a nonuniform distribution
Basic principle
function (pdf) is to use more levels at regions with large probability density Concentrate quantization levels in areas of largest pdf Or use fine quantization (small step size) for weak signals and coarse quantization (large step size) for strong signals
35
Non-uniform Quantization
Non-uniform quantization is achieved by, first passing the input signal through a “compressor”. The output of the compressor is then passed through a uniform quantizer.
The combined effect of the compressor and the uniform quantizer is that of a non uniform quantizer. At the receiver the voice signal is restored to its original form by using an expander. This complete process of Compressing and Expanding the signal before and after uniform quantization is called Companding. 36
m
(
t
)
Non-uniform Quantization (Companding)
Compressor Uniform Quantizer Expander 37 (
t
)
m
( (
t t
) )
Non-uniform Quantization (Companding)
Compressor Uniform Quantizer Expander 38 (
t
) The 3 stages combine to give the characteristics of a Non uniform quantizer.
• Basically, companding introduces a nonlinearity into the signal ▫ This maps a nonuniform distribution into something that more closely resembles a uniform distribution ▫ A standard ADC with uniform spacing between levels can be used after the compandor (or compander) ▫ The companding operation is inverted at the receiver • There are in fact two standard logarithm based companding techniques ▫ US standard called
µ -law companding
▫ European standard called
A-law companding
39
Nonuniform quantization using companding
• • • • Companding is a method of reducing the number of bits required in ADC while achieving an equivalent dynamic range or SQNR In order to improve the resolution of weak signals within a converter, and hence enhance the SQNR, the weak signals need to be enlarged, or the quantization step size decreased, but only for the weak signals But
strong signals
can potentially be
reduced
without significantly degrading the SQNR or alternatively increasing quantization step size The compression process at the transmitter must be matched with an equivalent expansion process at the receiver 40
• • The signal below shows the effect of compression, where the amplitude of one of the signals is compressed After compression, input to the quantizer will have a more uniform distribution after sampling At the receiver, the signal is expanded by an inverse operation The process of CO M pressing and exPANDING the signal is called
companding
Companding is a technique used to reduce the number of bits required in ADC or DAC while achieving comparable SQNR 41
Input/Output Relationship of Compander
42 • • Logarithmic expression Y = log X is the most commonly used compander This reduces the dynamic range of Y
Types of Companding
-Law Companding Standard (North & South America, and Japan)
y
y
max
e
log (1
e
)
x
max 43 where • x and y represent the input and output voltages • • is a constant number determined by experiment In the U.S., telephone lines uses companding with •
= 255
▫ Samples 4 kHz speech waveform at 8,000 sample/sec ▫ Encodes each sample with 8 bits,
L = 256
quantizer levels ▫ Hence data rate
R = 64
kbit/sec = 0 corresponds to uniform quantization
A-Law Companding Standard (Europe, China, Russia, Asia, Africa)
y
max
A
(1
x
max
A
) 0
x
max 1
A
y
max
e
A e x
max
A
) 1
A
x
max 1 where ▫ x and y represent the input and output voltages ▫ A = 87.6 ▫ A is a constant number determined by experiment 44
Pulse Code Modulation (PCM)
45
Pulse Code Modulation (PCM)
Pulse Code Modulation refers to a digital baseband signal that is generated directly from the quantizer and encoder output Sometimes the term PCM is used interchangeably with quantization 46
Figure 3.13
(Communication System-Simon Haykin) The basic elements of a PCM system. (Topic 3.7) 47
Pulse-Code Modulation • ▫ ▫ PCM (Pulse-Code Modulation) A message signal is represented by a sequence of coded pulses, which is accomplished by representing the signal in discrete form in both time and amplitude The basic operation Transmitter : sampling, quantization, encoding Receiver : regeneration, decoding, reconstruction 48 • Operation in the Transmitter 1. Sampling 1. The incoming message signal is sampled with a train of rectangular pulses 2. The reduction of the continuously varying message signal to a limited number of discrete values per second 2. Nonuniform Quantization 1. The step size increases as the separation from the origin of the input-output amplitude characteristic is increased, the large end-step of the quantizer can take care of possible excursions of the voice signal into the large amplitude ranges that occur relatively infrequently.
3. Encoding 1.To translate the discrete set of sample vales to a more appropriate form of signal 2.A binary code The maximum advantage over the effects of noise in a transmission medium is obtained by using a binary code, because a binary symbol withstands a relatively high level of noise.
The binary code is easy to generate and regenerate 49
50
• ▫ ▫ ▫ ▫ ▫ Regeneration Along the Transmission Path The ability to control the effects of distortion and noise produced by transmitting a PCM signal over a channel Equalizer Shapes the received pulses so as to compensate for the effects of amplitude and phase distortions produced by the transmission Timing circuitry Provides a periodic pulse train, derived from the received pulses Renewed sampling of the equalized pulses Decision-making device The sample so extracted is compared o a predetermined threshold ideally, except for delay, the regenerated signal is exactly the same as the information-bearing signal 1. The unavoidable presence of channel noise and interference causes the repeater to make wrong decisions occasionally, thereby introducing bit errors into the regenerated signal 2. If the spacing between received pulses deviates from its assigned value, a jitter is introduced into the regenerated pulse position, thereby causing distortion.
51
Fig.5.13
52
Receiver
• Operations in the Receivers 1. Decoding and expanding 1.Decoding : regenerating a pulse whose amplitude is the linear sum of all the pulses in the code word 2.Expander : a subsystem in the receiver with a characteristic complementary to the compressor 1.The combination of a compressor and an expander is a compander 2. Reconstruction 1.Recover the message signal : passing the expander output through a low-pass reconstruction filter 53
Line Coder
• • The input to the line encoder is the output of the A/D converter or a sequence of values
a n
that is a function of the data bit The output of the line encoder is a waveform:
n
n
nT
b
) where
f(t)
is the pulse shape and
T b
quantizer) is the bit period
(T b =T s /n
for
n
bit This means that each line code is described by a symbol mapping function
a
n
and pulse shape
f(t)
Details of this operation are set by the type of line code that is being used 54
55
Goals of Line Coding (
q
ualities to look for)
• A line code is designed to meet one or more of the following goals: ▫
Self-synchronization
The ability to recover timing from the signal itself ▫ That is, self-clocking (self-synchronization) - ease of clock lock or signal recovery for symbol synchronization Long series of ones and zeros could cause a problem
Low probability of bit error
Receiver needs to be able to distinguish the waveform associated with a
mark
from the waveform associated with a
space
BER performance relative immunity to noise Error detection capability enhances low probability of error
56 ▫ ▫ ▫ ▫
Spectrum Suitable for the channel
Spectrum matching of the channel e.g. presence or absence of DC level In some cases DC components should be avoided The transmission bandwidth should be minimized
Power Spectral Density
Particularly its value at zero PSD of code should be negligible at the frequency near zero
Transmission Bandwidth
Should be as small as possible
Transparency
The property that any arbitrary symbol or bit pattern can be transmitted and received, i.e., all possible data sequence should be faithfully reproducible
Summary of Major Line Codes • •
Categories of Line Codes
▫ ▫ ▫
Polar
- Send pulse or negative of pulse
Uni-polar
- Send pulse or a 0
Bipolar
(
a.k.a. alternate mark inversion, pseudoternary
) Represent 1 by alternating signed pulses
Generalized Pulse Shapes
▫
NRZ
-Pulse lasts entire bit period Polar NRZ ▫ Bipolar NRZ
RZ
- Return to Zero - pulse lasts just half of bit period Polar RZ Bipolar RZ ▫
Manchester Line Code
Send a 2 pulse for either 1 (high Includes rising and falling edge in each pulse No DC component low) or 0 (low high) 57
▫ ▫ ▫ ▫ When the category and the generalized shapes are combined, we have the following:
Polar NRZ:
Wireless, radio, and satellite applications primarily use Polar NRZ because bandwidth is precious
Unipolar NRZ
Turn the pulse ON for a ‘1’, leave the pulse OFF for a ‘0’ Useful for
noncoherent
communication where receiver can’t decide the sign of a pulse fiber optic communication often use this signaling format
Unipolar RZ
RZ signaling has both a rising and falling edge of the pulse This can be useful for timing and synchronization purposes 58
▫
Bipolar RZ
A unipolar line code, except now we alternate between positive and negative pulses to send a ‘1’ Alternating like this eliminates the DC component This is desirable for many channels that cannot transmit the DC components Note: There are many other variations of line codes (see Fig. 2.22, page 80 for more) 59
Commonly Used Line Codes
• Polar line codes use the antipodal mapping ▫
A
,
A
,
when X n
a n
when X n
Polar NRZ uses NRZ pulse shape 1 0 ▫ Polar RZ uses RZ pulse shape 60
•
Unipolar NRZ Line Code (on-off Signaling)
Unipolar non-return-to-zero (NRZ)
line code is defined by unipolar mapping
a n
0,
A
,
when X when X n n
1 0 Where X n is the n th data bit • In addition, the pulse shape for unipolar NRZ is: where
T b
is the bit period , NRZ Pulse Shape 61
•
Bipolar Line Codes
With
bipolar line codes
a space is mapped to zero and a mark is alternately mapped to -A and +A
a n
0,
A A
, , when when when
X X X
It is also called
pseudoternary
n n n
1 and last mark 1 and last mark 0
A A
signaling or
alternate mark inversion (AMI)
Either RZ or NRZ pulse shape can be used 62
•
Manchester Line Codes
Manchester line codes
use the antipodal mapping and the following
split-phase
pulse shape:
t
T b
4
T b
2
t
T T b
4
b
2 63
Figure 3.15
Line codes for the electrical representations of binary data. (
a
) Unipolar NRZ signaling. (
b
) Polar NRZ signaling. (
c
) Unipolar RZ signaling. (
d
) Bipolar RZ signaling. (
e
) Split-phase or Manchester code.
64
Comparison of Line Codes
• • •
Self-synchronization
▫ Manchester codes have built in timing information because they always have a zero crossing in the center of the pulse ▫ Polar RZ codes tend to be good because the signal level always goes to zero for the second half of the pulse ▫ NRZ signals are not good for self-synchronization
Error probability
▫ Polar codes perform better (are more energy efficient) than Uni-polar or Bipolar codes
Channel characteristics
▫ We need to find the power spectral density (PSD) of the line codes to compare the line codes in terms of the channel characteristics 65
Comparisons of Line Codes
•
1. Power Spectral Density of Line Codes (see Fig. 2.23, Page 90)
• Different pulse shapes are used ▫ to control the spectrum of the transmitted signal (no DC value, bandwidth, etc.) ▫ guarantee transitions every symbol interval to assist in symbol timing recovery After line coding, the pulses may be filtered or shaped to further improve there properties such as ▫ Spectral efficiency ▫ Immunity to Intersymbol Interference •
2.DC Component and Bandwidth
• Distinction between Line Coding and Pulse Shaping is not easy
DC Components
▫ Unipolar NRZ, polar NRZ, and unipolar RZ all have DC components ▫ Bipolar RZ and Manchester NRZ do not have DC components 66
Differential Encoding
(
a
) Original binary data. (
b
) Differentially encoded data, assuming reference bit 1. (
c
) Waveform of differentially encoded data using unipolar NRZ signaling.
67
Differential Coding
• •
Encoding
▫ encoded(k) = encoded(k – 1) XOR original(k) ▫ where k starts from 0 ▫ Encoded(-1) is called the reference bit which can be either 1 or 0
Decoding
▫ original(k) = encoded (k – 1) XOR encoded(k) ▫ where k starts from 0 ▫ Reference bit remains same for both encoding and decoding process 68
Sources of Corruption in the sampled, quantized and transmitted pulses
69 •
Channel Effects
▫ Channel Noise (AWGN, White Noise, Thermal etc) ▫ Intersymbol Interference (ISI) •
Sampling and Quantization Effects
▫ Quantization (Granularity) Noise ▫ Quantizer Saturation or Overload Noise ▫ Timing Jitter
Bits per PCM word and M-ary Modulation
•
Section 2.8.4:
▫ L=2 l Bits per PCM Word and Bits per Symbol •
Section 2.8.5:
▫ M = 2 k M-ary Pulse Modulation Waveforms •
Problem 2.14:
± The information in an analog waveform, whose maximum frequency f using a 16-level PAM system. The quantization must not exceed 1% of the peak-to-peak analog signal.
(a) What is the minimum number of bits per sample or bits per PCM word that should be used in this system?
(b) What is the minimum required sampling rate, and what is the resulting bit rate?
m =4000Hz, is to be transmitted (c) What is the 16-ary PAM symbol Transmission rate? 70
Note:
Topics Covered
• • Digital Communications-Bernard Sklar ▫ Chapter 2 Communication System-Simon Haykin 4 th ▫ Chapter 3 3.1-3.8
Ed.
71