Kuliah 5a Formatting and Line Coding
Kuliah 5a Formatting and Line Coding
Kuliah 5a Formatting and Line Coding
Transmission
Sistem Komunikasi
1
Formatting
2
Example 1:
In ASCII alphabets, numbers, and symbols are encoded using a 7-
bit code
3
Formatting
Transmit and Receive Formatting
Transition from information source digital symbols
information sink
4
Character Coding (Textual Information)
A textual information is a sequence of alphanumeric characters
5
Transmission of Analog Signals
6
Sampling
Sampling is the processes of converting continuous-time analog
signal, xa(t), into a discrete-time signal by taking the “samples” at
discrete-time intervals
Sampling analog signals makes them discrete in time but still
continuous valued
If done properly (Nyquist theorem is satisfied), sampling does not
introduce distortion
Sampled values:
The value of the function at the sampling points
Sampling interval:
The time that separates sampling points (interval b/w samples), Ts
If the signal is slowly varying, then fewer samples per second will
be required than if the waveform is rapidly varying
So, the optimum sampling rate depends on the maximum
frequency component present in the signal
7
Analog-to-digital conversion is (basically) a 2 step process:
Sampling
intervals, Ts
Quantization
Convert from discrete-time continuous valued signal to discrete
8
Sampling
f s 2 f max
9
Sampling
Natural Sampling
Flat-Top Sampling
10
Ideal Sampling ( or Impulse Sampling)
jnst 1
1
X s ( f ) X ( f )* e X ( f )* e jns t
Ts n Ts n
1
s
X s ( f ) X ( f )* ( f nf s ), f s
Ts n 2
1 1 n
Xs( f )
Ts
n
X ( f nf s )
Ts
n
X( f )
Ts
12
Ideal Sampling ( or Impulse Sampling)
This shows that the Fourier Transform of the sampled signal is the
Fourier Transform of the original signal at rate of 1/Ts
13
Ideal Sampling ( or Impulse Sampling)
14
Ideal Sampling ( or Impulse Sampling)
This means that the output is simply the replication of the original
signal at discrete intervals, e.g
15
Ts is called the Nyquist interval: It is the longest time interval that can
be used for sampling a bandlimited signal and still allow
reconstruction of the signal at the receiver without distortion
16
Practical Sampling
t nTs
x p (t )
n
Note:
Fourier Transform of impulse train is another impulse train
Convolution with an impulse train is a shifting operation
17
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 (see Figure 2.8)
xs (t ) x(t ) x p (t )
x(t ) n
c e
n
j 2 nf s t
X s ( f ) [ x(t ) x p (t )]
n
c
n
[ x (t )e j 2 nf s t
]
c
n
n X [ f nf s ]
18
Each pulse in xp(t) has width Ts and amplitude 1/Ts
The top of each pulse follows the variation of the signal being
sampled
Xs (f) is the replication of X(f) periodically every fs Hz
Xs (f) is weighted by Cn 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
19
Flat-Top Sampling
20
Flat top sampling (Time Domain)
x '(t ) x(t ) (t )
xs (t ) x '(t )* p(t )
p(t )* x(t ) (t ) p(t )* x(t ) (t nTs )
n
21
Taking the Fourier Transform will result to
X s ( f ) [ xs (t )]
P( f ) x(t ) (t nTs )
n
1
P( f ) X ( f ) * ( f nf s )
Ts n
1
P( f )
Ts
X ( f nf )
n
s
22
Flat top sampling (Frequency Domain)
23
Recovering the Analog Signal
One way of recovering the original signal from sampled signal Xs(f)
is to pass it through a Low Pass Filter (LPF) as shown below
24
Undersampling and Aliasing
If the waveform is undersampled (i.e. fs < 2B) then there will be
25
This could be due to:
1. x(t) containing higher frequency than were expected
2. An error in calculating the sampling rate
Under normal conditions, undersampling of signals causing aliasing
is not recommended
26
Solution 1: Anti-Aliasing Analog Filter
27
Aliasing is prevented by forcing the bandwidth of the sampled
signal to satisfy the requirement of the Sampling Theorem
28
Solution 2: Over Sampling and Filtering in the Digital
Domain
The signal is passed through a low performance (less costly)
analog low-pass filter to limit the bandwidth.
Sample the resulting signal at a high sampling frequency.
29
Summary Of Sampling
Ideal Sampling xs (t ) x(t ) x (t ) x(t ) (t nTs )
(or Impulse Sampling) n
x(nT ) (t nT )
n
s s
Natural Sampling
(or Gating)
xs (t ) x(t ) x p (t ) x(t ) cne j 2 nf s t
n
Flat-Top Sampling
xs (t ) x '(t )* p(t ) x(t ) (t nTs ) * p(t )
n
For all sampling techniques
If fs > 2B then we can recover x(t) exactly
30
Example 1:
Consider the analog signal x(t) given by
x(t ) 3cos(50 t ) 100sin(300 t ) cos(100 t )
What is the Nyquist rate for this signal?
Example 2:
Consider the analog signal xa(t) given by
xa (t ) 3cos 2000 t 5sin 6000 t cos12000 t
What is the Nyquist rate for this signal?
What is the discrete time signal obtained after sampling, if
fs=5000 samples/s.
What is the analog signal x(t) that can be reconstructed from the
sampled values?
31
Practical Sampling Rates
Speech
- Telephone quality speech has a bandwidth of 4 kHz
(actually 300 to 3300Hz)
- Most digital telephone systems are sampled at 8000
samples/sec
Audio:
- The highest frequency the human ear can hear is
approximately 15kHz
- CD quality audio are sampled at rate of 44,000
samples/sec
Video
- The human eye requires samples at a rate of at
least 20 frames/sec to achieve smooth motion
32
Pulse Code Modulation (PCM)
33
See Figure 2.16 (Page 80)
34
35
Advantages of PCM:
Relatively inexpensive
Disadvantage:
Requires wider bandwidth than analog signals
36
2.5 Sources of Corruption in the sampled,
quantized and transmitted pulses
37
Signal to Quantization Noise Ratio
The level of quantization noise is dependent on how close any
particular sample is to one of the L levels in the converter
38
Uniform Quantization
2
q/2 1 q/2 q/2
2 e p(e)de e
2
q de
1
e 2
de
q / 2 q / 2 q q / 2
1 e q/2
q 2
q
3
3 q / 2 12
40
The peak power of the analog signal (normalized to 1Ohms )can be
expressed as:
V pp
2
V p2 L2 q 2
P
1 2 4
L2 q 2 / 4
SNRq 2 3L2
q /12
41
If q is the step size, then the maximum quantization error that can
occur in the sampled output of an A/D converter is q
V pp
q
L
where L = 2n is the number of quantization levels for the converter.
(n is the number of bits).
S
10log (22n ) 6n dB
N dB 10
42
Nonuniform Quantization
Nonuniform quantizers have unequally spaced levels
The spacing can be chosen to optimize the Signal-to-Noise Ratio
43
Many signals such as speech have a nonuniform distribution
See Figure on next page (Fig. 2.17)
Basic principle is to use more levels at regions with large probability
density function (pdf)
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
44
Statistics of speech Signal Amplitudes
46
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
47
Basically, companding introduces a nonlinearity into the signal
This maps a nonuniform distribution into something that more
48
Input/Output Relationship of Compander
49
Types of Companding
-Law Companding Standard (North & South
America, and Japan)
loge 1 (| x | / xmax
y ymax sgn( x)
loge (1 )
where
x and y represent the input and output voltages
50
A-Law Companding Standard (Europe, China, Russia, Asia,
Africa)
| x|
A
xmax | x| 1
ymax sgn( x), 0
(1 A) xmax A
y ( x)
| x|
1 log e A
xmax 1 | x|
ymax sgn( x), 1
(1 log e A) A xmax
where
x and y represent the input and output voltages
A = 87.6
51
Pulse Modulation
Recall that analog signals can be represented by a sequence of discrete
samples (output of sampler)
Pulse Modulation results when some characteristic of the pulse (amplitude,
width or position) is varied in correspondence with the data signal
Two Types:
Pulse Amplitude Modulation (PAM)
The amplitude of the periodic pulse train is varied in proportion to the
sample values of the analog signal
Pulse Time Modulation
Encodes the sample values into the time axis of the digital signal
Pulse Width Modulation (PWM)
Constant amplitude, width varied in proportion to the signal
52
53
PCM Waveform Types
The output of the A/D converter is a set of binary bits
But binary bits are just abstract entities that have no physical definition
We use pulses to convey a bit of information, e.g.,
54
There are many types of waveforms. Why? performance criteria!
Each line code type have merits and demerits
The choice of waveform depends on operating characteristics of a
system such as:
Modulation-demodulation requirements
Bandwidth requirement
Synchronization requirement
55
Goals of Line Coding (qualities to look for)
A line code is designed to meet one or more of the following goals:
Self-synchronization
56
Spectrum Suitable for the channel
Spectrum matching of the channel
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
57
Line Coder
where f(t) is the pulse shape and Tb is the bit period (Tb=Ts/n for n
bit quantizer)
This means that each line code is described by a symbol mapping
function an and pulse shape f(t)
Details of this operation are set by the type of line code that is
being used
58
Summary of Major Line Codes
Categories of Line Codes
Polar - Send pulse or negative of pulse
Polar NRZ
Bipolar NRZ
Polar RZ
Bipolar RZ
Unipolar RZ
RZ signaling has both a rising and falling edge of the pulse
60
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
Note:There are many other variations of line codes (see Fig. 2.22,
page 80 for more)
61
Commonly Used Line Codes
Polar line codes use the antipodal mapping
A, when X n 1
an
A, when X n 0
Polar NRZ uses NRZ pulse shape
Polar RZ uses RZ pulse shape
62
Unipolar NRZ Line Code
Unipolar non-return-to-zero (NRZ) line code is defined by
unipolar mapping
A, when X n 1
a Where Xn is the nth data bit
n
0, when X n 0
In addition, the pulse shape for unipolar NRZ is:
where Tb is the bit period f (t ) t , NRZ Pulse Shape
Tb
63
Bipolar Line Codes
With bipolar line codes a space is mapped to zero and
a mark is alternately mapped to -A and +A
A, when X n 1 and last mark A
an A, when X n 1 and last mark A
0, when X n 0
It
is also called pseudoternary signaling or alternate mark inversion
(AMI)
Either RZ or NRZ pulse shape can be used
64
Manchester Line Codes
Manchester line codes use the antipodal mapping
and the following split-phase pulse shape:
Tb Tb
t 4 t 4
f (t ) T
Tb b
2 2
65
Summary of Line Codes
66
67
Comparison of Line Codes
Self-synchronization
Manchester codes have built in timing information because they
Error probability
Polar codes perform better (are more energy efficient) than
68
Comparisons of Line Codes
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
1. Power Spectral Density of Line Codes (see Fig. 2.23, Page 90)
After line coding, the pulses may be filtered or shaped to further
improve there properties such as
Spectral efficiency
69
First Null Bandwidth
Unipolar NRZ, polar NRZ, and bipolar all have 1st null bandwidths
of Rb = 1/Tb
Unipolar RZ has 1st null BW of 2Rb
Manchester NRZ also has 1st null BW of 2Rb, although the
spectrum becomes very low at 1.6Rb
70
Generation of Line Codes
71
Physical Channel
After line coding, the signal is put through a "physical channel",
either a "transmission medium" or "data storage medium".
The most common physical channels are:
the line-coded signal can directly be put on a transmission line, in the
form of variations of the voltage or current (often using differential
signaling).
the line-coded signal (the "baseband signal") undergoes further pulse
shaping (to reduce its frequency bandwidth) and then modulated (to shift
its frequency) to create an "RF signal" that can be sent through free
space.
the line-coded signal can be used to turn on and off a light source in
free-space optical communication, most commonly used in an infrared
remote control.
the line-coded signal can be printed on paper to create a bar code.
the line-coded signal can be converted to magnetized spots on a hard
drive or tape drive.
the line-coded signal can be converted to pits on an optical disc.
72
Bits per PCM word and M-ary Modulation
Section 2.8.4: Bits per PCM Word and Bits per Symbol
L=2l
73
Solution to Problem 2.14
q
| e | pVpp | e |max
2
Vpp 1
Vpp Lq q 2 L
l
L 2p
1
l log 2 l log 2 (50) 6
2p
fs 8000 Rs 48000 M 16
R 48000
R2 12000symbols / sec
log 2 ( M ) 4
74