Communication Systems
Communication Systems
Dhruva Hegde
1 Introduction to Communication
Communication is the process of exchanging (sending and receiving) data or
information.
Channel is the physical medium in which the signal carrying the informa-
tion travels. It can be wired (like optical fibre or copper cable) or wire-less.
Receiver is a device (or group of devices) that is used to recover back the
original information from the signal obtained through the channel.
1
The signal at the receiver end will be in electrical form, which again needs
to be converted back to it’s original form. This is accomplished using output
transducer, which outputs the data to the destination in it’s original form.
1.2 Modulation
Modulation is the process of varying some feature of a high frequency carrier
signal with respect to a low frequency message signal.
In simpler words, modulation is implanting the low frequency message on a
high frequency carrier due for transmission and reception.
2
Modulation also have other advantages such as allowing for multiplexing,
increasing signal to noise ratio, etc..
Note that the received signal can’t directly be used, it has to be demodu-
lated. Meaning, the low frequency message has to be re-obtained from the
modulated signal before sending to the output destination.
3
1.3 Hilbert Transform
Hilbert Transform a time domain transformation, i.e it transforms a time
domain signal to another time domain signal.
Hence, a Hilbert Transformer can be thought of as an LTI system of impulse
response hH (t) which operates on a signal x(t) to give Hilbert transform of
x(t) which is denoted by x̂(t).
=⇒ x̂(t) = hH (t) ∗ x(t)
The magnitude and phase of the above function will give more clarity on the
nature of behaviour of Hilbert transformer in the frequency domain.
(
1 : f 6= 0
|HH (f )| =
0 :f =0
The magnitude is unaffected except for the zero frequency (i.e DC) compo-
nent on x(t), which is completely attenuated. Hence, Hilbert transform kills
DC input.
−π/2 : f > 0
∠HH (f ) = 0 :f =0
π/2 :f <0
The phase is shifted by −90o for all positive frequencies and by 90o for all
negative frequencies. Hence, Hilbert transform is basically a 90o phase shifter.
• ax(t − t0 ) ↔ ax̂(t − t0 )
• x(at) ↔ sgn(a)x̂(t)
d[x(t)] d[x̂(t)]
• dt
↔ dt
If X(f ) is a complex quantity i.e X(f ) = a + jb, then X̂(f ) = b − ja. Hence,
Hilbert transform swaps the real and imaginary components in the frequency
domain.
If the above spectrum is shifted such that it is centered around the 0 fre-
quency, the obtained signal is called the ”Complex envelope”.
Shifting by fc in the frequency domain corresponds to multiplying the signal
by e−2jπfc in time domain. Hence, the complex envelope in time domain is
given by,
5
1.4 Correlation Functions
Correlation functions compare two signals and measure the extent of simi-
larity between them with respect to a certain lag. Note that a correlation
function is not a function of time, but a function of time delay.
This function characterizes the extent of similarity between x(t) and y(t) for
a lag τ .
Note that the cross-correlation operation is same as the convolution between
x(τ ) and ȳ(−τ ).
Sxy (f ) = X(f ) Ȳ (f )
6
changes nothing.
Also, since τ = 0 means the function is comparing a signal with itself, the
similarity has to be maximum. Hence, Rxx (0) is the maximum value that
Rxx (τ ) can take.
Energy of the signal x(t) over a band of frequencies [−W, W ] is given by,
Z W
E= Sxx (f ) df
−W
Note that ESD is a non-negative real quantity i.e Sxx (f ) > 0 ∀ f and it is
an even function i.e Sxx (f ) = Sxx (−f ).
7
The mean of the random process X(t) is given by,
Z ∞
µx (t) = E[X(t)] = X(t)fX (x, t)dx
−∞
Hence, the ACF of a random process gives the relation between the same
process at two different instances of time.
=⇒ µx (t) = k
Hence for a WSS random process, the ACF will be stationary for a given
time delay and mean will always be stationary.
The value of ACF at τ = 0 gives the average power of the random process.
8
Note that for a zero mean WSS process (µx (t) = 0), the variance and the
ACF at τ = 0 are the same i.e mean of square of X(t). Hence, for a WSS
process with zero mean, the power of the process is also equal to its variance.
PSD of a WSS random process has same properties as ESD of a signal i.e it
is always positive, real and even (symmetric).
It can be noted that Rxx (0) is equal to the area under PSD. Hence, area
under PSD also gives the average power of the WSS random process.
Note that for a non WSS random process, the ACF will be a function of both
t and τ , so it has to be denoted as Rxx (t, τ ).
9
1.5.2 Random Process’ & LTI Systems
Consider a random process X(t) being transmitted through an LTI system
of impulse response h(t).
The output Y (t) is given by,
Z ∞
Y (t) = X(t) ∗ h(t) = X(t − k)h(k)dk
−∞
The resulting random process Y (t) will also have mean that is constant with
time.
Y (t) has ACF that depends only on the delay τ and not on time instances,
meaning the ACF is constant of a given time delay.
Therefore, if the input to an LTI system is a WSS random process, then the
output of the system will also be a WSS random process.
Since h(τ ) ↔ H(f ) and h(−τ ) ↔ H̄(f ), the PSD of the output random
process Y (t) is given by,
This result is very useful in finding the power of a random signal which is
output from LTI systems (such as filters).
10
2 Analog Communication
As mentioned earlier, modulation and demodulation of message signals are
essential for communication systems. In analog communication, a high fre-
quency carrier is modulated to embed a low frequency message.
11
Observe that the message signal is encoded in the envelope of the modulated
carrier signal.
Hence, standard amplitude modulation is also called Double side band full
carrier (DSB-FC) modulation.
The value of µ should be such that envelope distortion should not occur
while demodulating the modulated signal, which will happen if zero ampli-
tude crossing occurs in the modulated signal.
For any arbitrary message signal m(t), the modulation index is given by
µ = ka |min[m(t)]|.
For a sinusoidal message signal, the spectrum of the modulated signal will
be as illustrated.
Power in AM signal
An AM modulated signal x(t) = Ac [1 + ka m(t)] cos(2πfc t) can be split into
two components i.e the carrier itself and the modulated message.
A2c
1 + ka2 Pm
Pt =
2
13
Since only the message part of the modulated signal carrier information, the
efficiency of AM is given by the ratio of modulated message power and the
total power.
ka2 Pm
η=
1 + ka2 Pm
Considering the specific case of a sinusoidal message signal m(t) = Am cos(2πfm t),
the power of the message signal will be Pm = A2m /2.
Hence, the total power is given by,
A2c 2
A2c µ2
2 Am
Pt = 1 + ka = 1+
2 2 2 2
Note that the power is LSB and USB will be µ2 A2c /8 and hence the side band
power (i.e power of the components that carry the message) is µ2 A2c /4.
ka2 A2m µ2
η= =
2 + ka2 A2m 2 + µ2
14
For a multi-tone
p modulated signal, the effective Modulation Index is given
by, µT = µ1 + µ22 + .... Hence, the total power will be,
2
Standard AM signal is generated using the square law modulator. The mes-
sage and carrier are added to obtain v1 (t) = m(t) + c(t), which is passed
through a non-linear system which generates v2 (t) = a v1 (t) + b v12 (t).
v2 (t) = a m(t) + a c(t) + b m2 (t) + b c2 (t) + 2b m(t)c(t)
The above signal is then passed through a band pass filter of cut-off frequen-
cies fc − fm and fc + fm .
=⇒ x(t) = a c(t) + 2b m(t)c(t) = aAc cos(2πfc t) + 2bAc m(t) cos(2πfc t)
The same can be expressed in standard AM form as,
2b
x(t) = aAc 1 + m(t) cos(2πfc t)
a
Envelope Detector
The envelope detector is a simple circuit that is used to recover back the
message signal from a modulated signal by tracking the envelope of the mod-
ulated signal.
This is done using a diode and an RC circuit with appropriate time constant.
When the modulated signal amplitude is increasing, the diode will be forward
biased and hence the capacitor charges. When the modulated signal ampli-
tude is decreases, the diode is reverse biased so the capacitor can’t discharge
15
back through the same path, but it has to discharge through the load.
If the charging time constant (τc = Rs C) is low and discharging time constant
(τd = RL C) is appropriately high, then the message signal will be tracked by
the envelope detected.
1 1 1
For enveloped detected to work properly, τc << fc
and fc
<< τd << fm
.
• If τd is too close to f1c , then it will start tracking the carrier itself instead
of the envelope, which is not desirable.
• If τd is too close to f1m , then it the capacitor discharges too slow and
hence will not track any fast changes in the message signal. This is
called ”diagonal clipping”.
Note that envelope detector will not work if the value of Modulation Index
is greater than 1.
In general, the output of a properly designed envelope detector will be |m(t)|.
16
in the signal which does not contain the message.
Meaning, the total power is same as the modulated message signal power
which is given by Pt = A2c Pm /2 and hence the efficiency of DSB-SC is 100%.
Consider single tone modulation i.e the message is m(t) = Am cos(2πfm t).
Then the power of the modulated signal is given by Pt = A2c A2m /4.
Similarly for multi-tone modulation i.e the message is m(t) = Am1 cos(2πfm1 t)+
Am2 cos(2πfm2 t) + .... Then the power of the modulated signal is given by
Pt = A2c (A2m1 + A2m2 + ...)/4.
Balanced Modulator
Here, s1 (t) = Ac [1+ka m(t)] cos(2πfc t) and s2 (t) = Ac [1−ka m(t)] cos(2πfc t)
and hence the final DSB-SC signal is s1 (t) = 2Ac ka m(t) cos(2πfc t).
Ring Modulator
17
• When the carrier is positive, diodes D1 and D3 are on, while D2 and
D4 are off. Hence, s(t) = m(t).
• When the carrier is negative, diodes D2 and D4 are on, while D1 and
D3 are off. Hence, s(t) = −m(t).
The signal s(t) changes back and forth between m(t) and −m(t) at the high
frequency of the carrier, and hence DSB-SC signal is generated.
Synchronous Demodulator
A2c
md (t) = m(t) cos φ
2
Ideally, the phase difference φ = 0 and hence the demodulated signal is sim-
ply scaled version of the message.
But due to mobile receivers, when the distance between the transmitter and
sender keeps changing, a phase difference is noticed in the modulated signal
when it arrives as the received signal.
Note that if φ = π/2, then the output will be 0. This effect is called ”Quadra-
ture nulling” and it must be avoided.
Orthogonal signals are those signals that are independent of each other i.e
they have 90o phase shift.
Example - cos(2πfc t) and sin(2πfc t)
Condition for two 2 real value signals f1 (t) and f2 (t) to be orthogonal is,
Z ∞
f1 (t)f2 (t)dt = 0
−∞
If m1 (t) and m2 (t) are the two message signals, then the QAM signal will be
s(t) = m1 (t) cos(2πfc t) + m2 (t) sin(2πfc t)
19
This technique of using orthogonal carriers of same frequency will reduce the
bandwidth necessary to transmit signals.
The message signals can be referred to as mI (t) i.e the in-phase message and
−mQ (t) i.e the quadrature-phase message.
=⇒ s(t) = mI (t) cos(2πfc t) − mQ (t) sin(2πfc t)
Hence, the base-band equivalent of the QCM signal is simply the in-phase and
quadrature-phase messages that are phase-shifted by 90o i.e are orthogonal.
20
and then passing it through ideal band pass filter with appropriate cut-off
frequencies to get either only USB or only LSB (and hence obtaining SSB-SC
signal).
The disadvantage with this method is that ideal filters can’t actually be de-
signed. There will always be a transition band in practical filters which will
allow some parts of unwanted frequency components to pass as well.
21
Demodulation of SSB-SC
Envelope detector can’t be used since the output will be constant DC (Ac /2).
Synchronous detector must be used.
0 A2c A2c
m (t) = m(t) cos φ ± m̂(t) sin φ
2 2
• If φ = 0, then m0 (t) ∝ m(t)
22
2.2 Angle Modulation
For a high frequency carrier sinusoid of the form c(t) = Ac cos(2πfc t + φ),
if its angle θ(t) = 2πfc t + φ is varied according to the message signal m(t),
then the carrier is said to be ”angle modulated”.
Note that there are two variable components in the angle, which are phase φ
and frequency fc . Meaning, there are broadly two types of angle modulation
schemes.
23
Hence, the phase modulated signal will be,
1 d[θi (t)] kp 0
fi (t) = = fc + m (t)
2π dt 2π
where m0 (t) is the derivative of the message signal m(t)
For a single tone sinusoidal message signal, m(t) = Am cos(2πfm t), the phase
modulated signal will be,
• ∆φmax = kp Am = β
• ∆fmax = kp Am fm = βfm
24
And hence, the frequency modulated signal will be,
Z t
x(t) = Ac cos(θi (t)) = Ac cos(2πfc t + 2πkf m(τ )dτ )
0
For a single tone sinusoidal message signal, m(t) = Am cos(2πfm t), the fre-
quency modulated signal will be,
kf Am
x(t) = Ac cos(θi (t)) = Ac cos(2πfc t + sin(2πfm t))
fm
kf Am
Hence, the modulation index is β = fm
.
kf Am
• ∆φmax = fm
=β
• ∆fmax = kf Am = β fm
If the modulating signal consists of both sin and cos terms such as,
m(t) = A1 sin(2πfmp t) + A2 cos(2πfm t), then the maximum value m(t) can
take is |m(t)|max = A21 + A22 .
This result will be useful while calculating maximum phase and frequency
deviations.
Narrow Band FM
25
So if β << 1, the FM signal behaves somewhat similar to a standard AM
signal, which is not very useful.
Wide Band FM
26
Spectral analysis of FM signal
s(t) = Re[Ac ej(2πfc t+β sin(2πfm t)) ] = Re[Ac ejβ sin(2πfm t) ej2πfc t ]
From the above expression, it can be noted that Ac ejβ sin(2πfm t) is the complex
base-band equivalent of the FM signal s(t).
Hence, the spectrum of FM signal can be found by first finding the spectrum
of its complex envelope and then frequency translating it.
Let s̃(t) = Ac ejβ sin(2πfm t) . This signal is periodic with period T0 = 1/fm . So
the spectrum will be given by complex Fourier series coefficients.
∞
X
s̃(t) = Ck ej2πfm kt
k=−∞
Z T0
1
Ck = Ac eβ sin(2πfm t) e−j2πkfm t dt
T0 0
Upon solving the above integral, it is found that the complex Fourier series
coefficients can be represented using Bessel’s Function of 1st kind and k th
order.
Z 2π
1
Ck = A c eβ sin x−kx dx = Ac Jk (β)
2π 0
∞
X
=⇒ s̃(t) = Ac Jk (β)ej2πfm kt
k=−∞
27
• Jn (x) = (−1)n J−n (x)
P 2
• Jn (x) = 1
Magnitude of carrier in the FM signal depends on the value of β. For
β = 2.4, 5.5, 8.6, 11.8, ..., the carrier magnitude will turn out to be zero and
hence, 100% modulation efficiency is obtained.
A2c
Power of FM signal is same as the power of the carrier. =⇒ Pt = Pc = 2
.
From the spectrum, it can be observed that the bandwidth of the FM signal
is infinite since k ranges from −∞ to ∞. However, practically the Bessel
function values decay rapidly with increasing k and hence most of the power
is contained in the first few frequency components.
Demodulation of FM signal
FM signal is demodulated by first passing it through a differentiator which
will convert it to a signal in standard AM form, and then using envelope
detector.
28
Note that the condition for envelope detector to work without distortion is
fc > ∆fmax , which will pretty much always be naturally satisfied.
For example, all AM radio signals that are in the range of 540 kHz to
1600 kHz are shifted around the intermediate frequency of 455 kHz.
29
The signal sm (t) can be passed through BPF to obtain st (t) = 0.5Ac m(t) cos(2πfIF t)
which is the same modulated signal centered around fIF rather than fc .
(note that l(t) = cos(2π(fc − fIF )t) can also be used for the same purpose)
Note that in this case, s(t) = rt (t). Meaning, modulated signals of two differ-
ent frequencies can be translated to the same intermediate frequency, which
will cause interference between the two. This effect is not desirable.
For a modulated signal of frequency fc , the frequencies of fc ± 2fIF can cause
interference. These are called ”image frequencies”.
30
As mentioned, to suppress image frequency components before mixing with
a local oscillator, a filter is used (tuned RF filter).
The image frequency rejection ratio of the tuned filter is given by,
p fimg fc
α = 1 + P 2 Q2 ; P = −
fc fimg
where Q is the quality factor of the antenna coupling circuit
Multiple such filters can be cascaded to obtain overall rejection ratio as prod-
uct of individual ratios.
31
If x1 (t), x2 (t) and x3 (t) are band-limited to frequency W , they are translated
to different frequencies using different carriers as shown.
Hence, y1 (t), y2 (t) and y3 (t) will be centred at f1 , f2 and f3 respectively.
These signals are added and transmitted.
At the receiving end, band pass filters of relevant cut-off frequencies are used
to receive only the required signal (for example BPF of cut-off frequencies
f1 − W and f1 + W for signal y1 (t) and so on), which are then demodulated
to recover the original signals.
The figure below illustrates how base-band signals are frequency translated
to different center frequencies.
The translated signals are then added to obtain the FDM signal as shown.
32
3 Digital Communication
Noise immunity of digital signals is significantly higher than that of analog
signals. Also, designing systems that deal with digital systems is more mem-
ory efficient and more structured when compared to analog systems.
Hence, digital communication schemes are more widely used. The block di-
agram shown illustrates a general digital communication system.
The two most generic coding schemes are polar and unipolar.
+A : 1 +A : 1
Polar =⇒ ak = Unipolar =⇒ ak =
−A : 0 0:0
33
Since ak is a discrete random variable, x(t) is a random process.
Assuming ”0” and ”1” are equally likely to occur, it can be calculated that
the expected value of ak , and hence X(t) as well as X(f ) are all 0.
where Ra (n) is the ACF of the discrete random variable ak and rP (τ ) is the
ACF of the deterministic pulse signal p(t).
Sx (f ) = A2 T sinc2 (f T )
Note that the polar scheme is the most common and simplest scheme for
random binary pulse transmission. More complicated schemes are illustrated
in the following section.
BW = Rb
– Return to Zero (U-RZ)
BW = 2Rb
• Polar:
– Non Return to Zero (P-NRZ)
BW = Rb
35
Polar Non Return to Zero is the line code which was considered
earlier for the derivation of ACF and PSD of pulse of a random
binary sequence.
BW = 2Rb
• Bipolar:
BW = Rb
– Return to Zero (B-RZ)
BW = Rb
• Manchester:
BW = 2Rb
36
3.1.3 Digital Channel
The most commonly used digital channel is called AWGN Channel i.e the
Additive White Gaussian Noise Channel.
N0
Rn (τ ) = δ(τ )
2
The above equation indicates that the correlation exists only at one instant
and hence, the noise signal is highly uncorrelated.
N0
Sn (f ) = ∀f
2
Since the PSD is flat, noise adds equally to all frequencies.
37
3.1.4 Digital Receivers
The transmitted signal, after being sent through a channel (AWGN) has to be
received such that the noise is minimized and signal component is maximized.
By calculating the signal power and the noise power, the following inequality
can be obtained.
R∞
S −∞
|X(f )|2 df
≤
N N0 /2
The numerator term is simply the energy of the input signal (E) and the
denominator term is obtained by the PSD of the Gaussian Noise.
S 2Emax
=⇒ =
N max N0
The energy of the input signal will be maximum if the transfer function of
the filter satisfies,
H(f ) = X̄(f ) e−j2πf T
Therefore, the impulse response of the filter must be
h(t) = x̄(T − t)
Such a filter is called Matched Filter and the receiver which uses this is
called ”Matched Filter Receiver”.
38
3.1.5 Probability of Error
Due to the addition of noise, there is always the chance for error, even if the
signal to noise ratio is maximized.
The output of the matched filter is sampled at every T duration. Since the
input signal is a random process, the output will be a random variable.
For a binary sample space S = [0, 1], let s0 correspond to ”0” and s1 cor-
respond to ”1”. n0 (t) represents that noise component in the output of the
filter.
Hence, depending on the channel and the noise model, the probability density
function of the output random variable is obtained.
If the noised model is Gaussian (as it will be for an AWGN channel), then
the PDFs of the output random variables will be as illustrated.
P (r|s0 ) is the PDF of the received symbol if 0 was transmitted and P (r|s1 )
is the PDF of the received symbol of 1 was transmitted.
Vth = s1 −s
2
0
is the threshold value which makes the decision in the output, i.e
if the received value is greater than Vth , it is assumed that 1 was sent and if
the received value is lesser than Vth , it is assumed that 0 was sent.
If the two PDFs coincide/overlap, it means there is a chance for error. This
probability is found by integrating the PDFs over the region of the graph
beyond Vth .
39
Note that if the noise that adds to both the symbols equally (as does AWGN),
then the probability of errors for both 1 and 0 will be the same.
For a system with AWGN Channel which uses Matched Filter Receiver, the
probability of error is given by the complementary error function or the Q-
function:
r
Ed
Pe = Q
2N0
r
Es1 + Es0 − 2Es1s0
=⇒ Pe = Q
2N0
In case of polar signaling, since s1 = −s0 , the energies are given by Es1 =
Es0 = Ep and Es1s0 = −Ep .
Average energy per bit, Eb = 0.5(Ep + Ep ) = Ep .
r
2Eb
=⇒ Pe = Q
N0
40
For any orthogonal binary signaling (such as on-off), since s0 = 0, the energies
are given by Es1 = Ep , Es0 = 0 and Es1s0 = 0.
Average energy per bit, Eb = 0.5(Ep + 0) = 0.5Ep .
r
Eb
=⇒ Pe = Q
N0
The above results indicate that any orthogonal binary signaling is inferior to
polar signaling by 3 dB.
It is known that using orthogonal pulses will save bandwidth. Hence, there
is a trade-off between probability of error and bandwidth required for trans-
mission between the two different schemes.
• Polar signaling gives lower probability of error and power consumption
• Orthogonal signaling gives lower bandwidth consumption
41
Using Bayes theorem, the aposteriori probabilities of the transmitted symbol
given the received symbol can be calculated.
Consider the aposteriori probabilities given that 1 was received i.e r has
occurred.
P (s0 )P (r|s0 ) P0 (1 − p)
P (s0 |r) = =
P (s0 )P (r|s0 ) + P (s1 )P (r|s1 ) P0 (1 − p) + P1 p
P (s1 )P (r|s1 ) P1 p
P (s1 |r) = =
P (s0 )P (r|s0 ) + P (s1 )P (r|s1 ) P0 (1 − p) + P1 p
MAP rule states that, choose the symbol with maximum aposteriori proba-
bility. Meaning in the above case, if P (s0 |r) > P (s1 |r), then choose s0 and
if P (s1 |r) > P (s0 |r), then choose s1 .
Similarly, consider the aposteriori probabilities given that 0 was received i.e
r̃ has occurred.
P (s0 )P (r̃|s0 ) P0 p
P (s0 |r̃) = =
P (s0 )P (r̃|s0 ) + P (s1 )P (r̃|s1 ) P0 p + P1 (1 − p)
P (s1 )P (r̃|s1 ) P1 (1 − p)
P (s0 |r̃) = =
P (s0 )P (r̃|s0 ) + P (s1 )P (r̃|s1 ) P0 p + P1 (1 − p)
Here if P (s0 |r̃) > P (s1 |r̃), then choose s0 and if P (s1 |r̃) > P (s0 |r̃), then
choose s1 .
The optimal receiver is the one that operates on MAP Rule since it mini-
mizes the probability of error.
42
Note that the MAP rule reduces to ML rule if the symbols are equiprobable
i.e if P (s1 ) = P (s0 ) = P .
Therefore, if the probability of generation of 0 and 1 are the same (0.5 since
they are mutually exclusive and exhaustive), then the decision taken by ML
rule and MAP rule will be exactly the same.
• Received symbol is r:
– P (r|s0 ) > P (r|s1 ) or 1 − p > p; choose s0
– P (r|s1 ) > P (r|s0 ) or p > 1 − p; choose s1
• Received symbol is r̃:
– P (r̃|s0 ) > P (r̃|s1 ) or p > 1 − p; choose s0
– P (r̃|s1 ) > P (r̃|s0 ) or 1 − p > p; choose s1
43
3.2.1 Sampling
Sampling is the process of converting an analog signal to discrete signal.
The process of sampling has been discussed from time domain point of view
in Signals. Here, sampling from the frequency domain perspective is elabo-
rated in detail.
Let x(t) be a continuous time signal and X(f ) be its Fourier Transform.
A band-limited signal is a signal which is zero outside a specific range of
frequencies.
The figure shown below represent the original spectrum (a) and the spectra
obtained after sampling above Nyquist rate (b), at Nyquist rate (c) and below
Nyquist rate (d).
It can be observed that there will be loss of higher frequency components if
sampled at a rate lower than the Nyquist rate. This phenomenon is called
”Aliasing”.
In the other two cases, there is no loss of any information as the original
spectrum has just repeated itself. And hence, it can be recovered by simply
using a filter with cut-off frequency W and gain Ts .
44
The transfer function of the required ideal filter is given by,
(
Ts : f ≤ W
H(f ) =
0 :f >W
45
Here, a train of periodic pulses of duration T and period Ts is multiplied
with the message signal. This is generally done using a ”sample and hold
circuit”.
This process is also called ”Pulse Amplitude Modulation” and the signal
obtained is the PAM signal.
∞
X
xp (t) = x(kTs )p(t − kTs )
k=−∞
3.2.2 Quantization
Quantization is the process of converting a discrete signal to quantized signal.
Meaning, a few discrete levels are defined and the amplitudes of the discrete
samples are mapped to the nearest levels, so that the discrete samples can
take only finite number of predefined values which can be encoded in a finite
number of bits.
Mid-Tread Quantization:
The number of quantization levels are odd. Hence, the midpoint of the input-
output characteristics will be horizontal.
Mid-Rise Quantization:
The number of quantization levels are even. Hence, the midpoint of the
input-output characteristics will be vertical.
46
The dynamic range of a discrete signal is the range of values/amplitudes the
signal can take.
Hence, the dynamic range is given by [−Vmin , Vmax ].
Usually this is assumed to be symmetric, so in that case, the range will be
[−Vm , Vm ] and the length of the dynamic range is Vm − (−Vm ) = 2Vm .
Note that all quantization need not be uniform. Quantization can be cus-
tomized to have any number of levels, any step size and any number in each
step can be the mapped value (instead of midpoint).
47
If L is the number of quantization levels and n is the number of bits necessary
to encode the quantized signal (also termed as the ”resolution”), n can be
found using the relation L = 2n (where n is an integer).
This means n bits can be used to encode upto L = 2n levels and hence, n
bits can naturally be used to encode any number of levels less than 2n , so it
is not necessary that all combinations of bits have to be used.
The signal power can be calculated based on the nature of input signal.
If the input signal is sinusoidal, then the signal power (P ) is given by A2m /2
where Am is peak amplitude. In this case, the dynamic range of the quantizer
can be approximated as 2Am .
=⇒ P = A2m /2 and ∆ = 2Am /2n .
The Signal to Noise Ratio (SNR) is the ratio of signal power to quantization
noise power. SN R = P/Q =⇒ SN R = 6A2m /∆2 = 3(22n−1 )
Since there are n bits for every period Ts , the duration of each bit is given
by Tb = Ts /n.
Hence, the bit rate is Rb = 1/Tb .
48
=⇒ Increasing quantization levels for more accuracy will reduce error but
will increase bandwidth.
Note that the above expressions and methods for calculating SNR are valid
if the input signal is deterministic and uniform quantization is used.
Consider the case where input signal is a random signal X(t) which follows
some distribution fX (x).
The signal power is calculated using:
Z ∞
2
S = E[X (t)] = X 2 (t)fX (x)dx
−∞
This method works for uniform quantization as well, so it is the general pro-
cedure to find the quantization noise given any quantization scheme.
49
3.2.4 Delta Modulation
A modified version of DPCM where only 2 quantization levels exist. Hence,
it is also called 1-bit DPCM.
Delta Modulation works very well if the correlation between samples is high
i.e the samples are not changing rapidly.
Granular Noise Distortion occurs if ∆ value is too large and hence slight
variations in the output is causing unnecessary ups and downs in modulated
signal.
Slope Overload Distortion occurs if ∆ value is too small and hence the
modulator will be unable to track rapid changes in the original signal.
50
dm(t)
∆opt fs =
dt max
51
• Choose sampling rate to be twice the maximum frequency among the
messages i.e fs = 2fmax .
Ex: fs = 6fm . =⇒ Rb = 6fm × 3 × n
• Divide the higher frequency signal into multiple lower frequency signals
by feeding the same signal into the commutator multiple times. This
will work if the frequencies present are integral multiples of the lowest
frequency.
Ex: fs = 3fm ; feed the second signals twice, the third signal thrice. So
total number of signals will be 6. =⇒ Rb = 3fm × 6 × n
Consider two pulses p1 (t) and p2 (t) that are orthogonal to each other i.e
Z ∞
p1 (t) p2 (t) dt = 0
−∞
Also, let the energy of both the pulses be equal to unity i.e
Z ∞ Z ∞
2
|p1 (t)| dt = |p2 (t)|2 dt = 1
−∞ −∞
52
r
2
p2 (t) = sin(2πf2 t) : 0 < t < T
T
where f1 and f2 are integral multiples of same fundamental frequency f0
The signal space is mainly used to draw the constellation diagram, which
is a plot of the symbols to be transmitted using the orthonormal basis func-
tions as the axes.
The probability of error will vary inversely with the change is distance be-
tween the symbols as represented in the signal space constellation diagram.
The digital message signal a which is +Aq for ”1” or 0 for ”0” is simply
multiplied with the carrier pulse p(t) = T2 cos (2πfc t) which lasts for the
duration 0 < t < T such that T = k/fc (k is an integer).
53
The bandwidth of the base-band polar NRZ pulse is 1/T but now since it
is modulated to be a pass-band signal, the bandwidth of ASK modulated
signal will be 2/T .
Ed = Eb + 0 − 2(0) = Eb
Assuming AWGN channel, the received symbol will be r(t) = s(t) + n(t),
which will be sampled at t = T . In detection of ASK modulated signal using
matched filter receiver and threshold decision device, the optimal threshold
will be A/2.
• r(T ) > A/2 =⇒ : a = 1
54
f1 = fc + Kf V → Mark Frequency
f2 = fc − Kf V → Space Frequency
For orthogonality of the two carriers, the constraint that must be satisfied is:
kRb k
f1 − f2 = =
2 2Tb
where k is an integer.
Since the minimum value k can take is 1, the FSK system where
f1 − f2 = Rb /2 is known as ”Minimum Shift Keying” (MSK).
The binary data a represented in polar NRZ form is multiplied to one of the
two carriers depending on its value, which is done using Voltage Controlled
Oscillator (VCO).
q
s1 = A 2 cos (2πf1 t) : a = 1
s(t) = qT
s2 = A 2 cos (2πf2 t) : a = 0
T
A2 A2 p
Eb = + = A2 ; A= 2Eb
2 2
Hence the modified expression of FSK modulated signal is given by,
q
s1 = 2Eb cos (2πf1 t) : a = 1
s(t) = q T
s = 2Eb cos (2πf t) : a = 0
2 T 2
55
Bandwidth of FSK modulated signal is f1 − f2 + 2/T or (k1 − k2 + 2)/T .
Ed = Eb + Eb − 2(0) = 2Eb
Assuming AWGN channel, the received symbol will be r(t) = s(t) + n(t),
which will be sampled at t = T . In detection of FSK modulated signal using
matched filter receiver and threshold decision device, the decision has to be
taking by measuring the frequency instead of amplitude.
• r(T ) > fc =⇒ : a = 1
• r(T ) < fc =⇒ : a = 0
Note that the bandwidth needed for FSK is higher when compared to ASK
but since the symbols are place further apart, the probability of error will be
reduced.
56
3.4.4 Binary Phase Shift Keying
Binary data is represented using polar non-return to zero signaling.
The digital message signal a which is +A qfor ”1” or −A for ”0” is simply
multiplied with the carrier pulse p(t) = T2 cos (2πfc t) which lasts for the
duration 0 < t < T such that T = k/fc (k is an integer).
57
The bandwidth of the base-band polar NRZ pulse is 1/T but now since it
is modulated to be a pass-band signal, the bandwidth of BPSK modulated
signal will be 2/T .
Ed = Eb + Eb − (−2Eb ) = 4Eb
Assuming AWGN channel, the received symbol will be r(t) = s(t) + n(t),
which will be sampled at t = T . In detection of BPSK modulated signal using
matched filter receiver and threshold decision device, the optimal threshold
amplitude will be 0.
• r(T ) > 0 =⇒ : a = 1
• r(T ) < 0 =⇒ : a = 0
Note that the bandwidth required for BPSK is same ASK (and hence lower
than FSK) and since the symbols are place further apart, the probability of
error will less than both the previous schemes.
If the carriers are out of phase, then quadrature nulling can occur and distort
the original signal.
DPSK is a scheme designed so that no carrier is necessary at the receiver
end, hence quadrature nulling effect is eliminated entirely.
58
Reference signal for the first XNOR operation is generally taken as 1.
59
3.4.6 Quadrature Phase Shift Keying
QPSK is a simple case of using quadrature carrier multiplexing technique.
The binary data is represented using 2 bits (n = 2) and 4 levels (M = 4).
q
Let the two orthogonal carrier pulses be p1 (t) = T2 cos(2πfc t) and p2 (t) =
q
2
T
sin(2πfc t). Note that these two are normalized to unit energy, hence
they form an orthonormal basis for a signal space.
2A
s1 = √
T
cos (2πfc t − 45o ) : a1 a2 = 11
2A
cos (2πfc t + 45o )
s
2 = √
T
: a1 a2 = 10
s(t) = 2A o
s3 = √
T
cos (2πfc t + 135 ) : a1 a2 = 01
2A
cos (2πfc t + 225o ) : a1 a2 = 00
s
4 = √
T
The waveform illustrates the phase shifted cosine signal as per the QPSK
scheme given.
60
For receiving the QPSK signal, two matched filters have to be used i.e one
corresponding to each carrier.
h1 (t) is used for s1 (t) and optimal decision boundary is 0 to determine is the
message sent with p1 (t) i.e a1 is +A or −A. Similarly, h2 (t) is used for s2 (t)
and optimal decision boundary is 0 to determine is the message sent with
p2 (t) i.e a2 is +A or −A.
Now the received symbol has error if error has occurred in detection of either
a1 or a2 or both.
Since the scheme is phase shift keying, the probability of error in detection
of a1 or a2 is,
r
2Eb
Pe1 = Pe2 = Q
N0
Since Pe1 << 1, the square term will be even smaller and can usually be
neglected.
r
2Eb
∴ Pe ≈ 2Q
N0
61
3.4.7 M-ary Pulse Amplitude Modulation
So far, all the schemes studied were binary i.e a pulse could take one of two
values (except for QPSK).
In M-ary schemes, a pulse can take one of M distinct values. Hence, the
number of bits per symbol (level) if M levels are present is n = log2 M .
At the receiver end, decision device follows nearest neighbor decision rule.
For example in the above scenario:
62
• 4A < r(T ) < 6A : =⇒ a = 5A
• r(T ) > 6A : =⇒ a = 7A
Assuming AWGN channel and matched filter receiver, the probability can be
calculated as follows.
Consider the message signal a = A (or any intermediate level). Then the
received signal will be r(T ) = s + ñ. Now if r(T ) is less than 0 or greater
than 2A, there will be an error in detection.
Pe1 = P (r(T ) > 2A)+P (r(T ) < 0) = P (ñ > A)+P (ñ < −A) = 2P (ñ < A)
Now consider the message signal a = 7A (or a = −7A i.e an end point).
Then the received signal will be r(T ) = s + ñ. Now if r(T ) greater than 7A
only there will be an error in detection.
Hence, probability of error in receiving the first or last level is give by,
s 2
A A
=⇒ Pe2 = Q =Q
N0 /2 σ
Assuming all M levels occur at equal probabilities of 1/M , since there are
M − 2 intermediate levels and 2 end levels, the average probability of error
will be,
M −2 A 2 A
Pe = 2Q + Q
M σ M σ
Upon simplifying and substituting for A and σ,
s
1 6Es
∴ Pe = 2 1 − Q
M N0 (M 2 − 1)
63
3.4.8 M-ary Quadrature Amplitude Modulation
√
M-ary QAM is a scheme which uses two M-ary PAM signals with two or-
thogonal carrier pulses.
The number of bits required transmitted per symbol is again, n = log2 M .
64
The M-QAM signal has to be received using two matched filters (similar to
QPSK) since there are two different pulses.
h1 (t) is used for receiving a1 p1 (t), which is sampled and nearest neighbor
decision rule is applied on r2 (T ) to get a1 .
Similarly, h2 (t) is used for receiving a2 p2 (t), which is sampled and nearest
neighbor decision rule is applied on r2 (T ) to get a2 .
Now the received symbol has error if error has occurred in detection of either
a1 or a2 or both. √
Since the individual scheme is M-PAM, the probability of error in detection
of a1 or a2 is,
s
1 3Es
Pe1 = Pe2 = 2 1 − √ Q
M N0 (M − 1)
Since Pe1 << 1, the square term will be even smaller and can usually be
neglected.
s
1 3Es
∴ Pe ≈ 4 1 − √ Q
M N0 (M − 1)
It can easily be observed that in this scheme, the signal constellation dia-
gram takes a circular shape since all the symbols are separated only by phase
65
difference and hence they are equidistant from the origin of the signal space.
66
Some general results:
1. Find the total energy per symbol by finding the square of the
distance from each symbol to origin and adding them all up.
2. If the symbols are equiprobable, then the average energy is the
total energy divided by number of symbols.
3. If the symbols occur with certain given
P probabilities, then the
average energy is given by Eave = i pi Ei (where i represents
each symbol).
67
3.5 Inter Symbol Interference
If a pulse is limited to a finite time interval, then in reality the bandwidth
occupied by it will be infinite (though 95% of the power will be present within
major lobe).
Similarly, if a pulse is band-limited to a certain range of frequencies, it can’t
be time limited i.e its time response will be non-zero for all time.
Spreading of a pulse beyond its allocated time interval will cause it to in-
terfere with neighbouring pulses. This phenomenon is called ”Inter symbol
interference” (ISI).
ISI can’t be avoided completely since time-limited pulse are not band-limited
and band-limited pulse are not time-limited.
However, pulse amplitude can be detected correctly despite this by properly
shaping the pulse.
If the duration is Tb , then the bit-rate will be Rb = 1/Tb , which means mini-
mum transmission bandwidth is Rb /2.
The only pulse p(t) that will satisfy the Nyquist criterion and has bandwidth
Rb /2 is the sinc function i.e,
1 f
p(t) = sinc(πRb t) ←→ P (f ) = rect
Rb Rb
68
The reason why it works is because addition of time shifted versions of the
sinc pulse will note interfere with itself at integral multiples of Tb as illustrated
below.
Since the sinc function decays as 1/t, it is too slow and hence is not very
practical to use because even slight jitters might cause ISI.
In order to obtain a pulse that decays much faster the sharp transition edge
of the rectangular spectrum has to be smoothed.
Hence, making the signal decay faster comes at the expense of extra band-
width.
The new overall bandwidth required to transmit the reshaped pulse will be
(1 + α)Rb
BW = 0.5 Rb + fx =
2
The spectrum of the shaped signal is called Raised Cosine Spectrum.
69
The sinc pulse obtained after smoothening the transition band in the spec-
trum for few standard roll-off rates are illustrated.
Note that for maximum value of α i.e 1, the sinc pulse decays almost instan-
taneously and the signal is pretty much non-existent outside the major lobe,
which makes it desirable.
The signal bandwidth of any arbitrary M -ary scheme for different types of
pulses can be generalized as follows.
• If rectangular pulses are used, signal bandwidth is given by
2Rb
BW =
log2 M
70
Bandwidth efficiency or Spectral efficiency is the ratio of the bit-rate
to the signal bandwidth. Hence, it specifies the number of bits that can be
transmitted per second in 1 Hz of bandwidth usage.
Rb
=⇒ ηs =
BW
• Rectangular pulse : ηs = 0.5 log2 M
If the filter has such a frequency response, it will shape the signal such that
Nyquist criterion is obeyed and hence zero ISI transmission is achieved.
71
4 Information Theory
Information theory studies the quantification, storage, and communication
of digital information.
A digital source sequentially produces symbols from a given finite set of sym-
bols. For example, S set of M symbols: S = [s0 , s1 , s2 , ...sM −1 ].
72
Information content is measured in bits.
The above quantification of information says that symbols (or events) that
have high probability of occurrence carry less information and symbols (or
events) that have low probability of occurrence carry high information.
4.1.1 Entropy
Entropy of a digital source S is defined as the expected value of information
or the average information content present in the source. H(S) = E[I(S)]
M −1
X 1
=⇒ H(S) = pi log2
i=0
pi
Note that the entropy is a sum of non-negative terms, hence H(S) ≥ 0 and
it is measured in bits/symbol.
1
If pi = 1, then log2 pi
=0
1
If pi = 0, then log2 pi
= 0 (use L-Hospital’s rule to evaluate limit)
73
Therefore, the entropy is maximum when all the symbols are equally likely
to occur (this result can be extended to more than just binary sources).
In this case, the entropy of the source is also called ”differential entropy” and
can be calculated as follows.
Z ∞
1
H(S) = fS (x) log2 dx
−∞ fS (x)
The symbol rate of a source is the number of symbols transmitted per sec-
ond and is denoted by r. Note that the number of symbols can also be the
number of quantization levels.
Since the entropy of the source (H) is the average information content, it
gives the average number of bits present in each symbol. Hence, the relation
between the average information, information rate and symbol rate is given
by R = H r.
74
4.1.3 Joint Entropy
Consider two sources X = [s0 , s1 , ..., sM −1 ] and Y = [r0 , r1 , ...rN −1 ].
A joint probability distribution can be obtained from the two sources.
pij = P (X = si ∩ Y = rj ) = P (si , rj )
The entropies of individual sources i.e H(X) and H(Y ) can be calculated
from the usual entropy formula using the marginal probabilities.
• The joint entropy of two sources is always greater than or equal to the
individual entropies of the two sources.
=⇒ H(X, Y ) ≥ H(X); H(X, Y ) ≥ H(Y )
• The joint entropy of two sources is always lesser than or equal to the
sum of individual entropies of the two sources.
=⇒ H(X, Y ) ≤ H(X) + H(Y )
75
4.1.4 Conditional Entropy
Conditional entropy is the average information content present in one source,
given another source.
Consider two sources X having M symbols [s0 , s1 , ...sM −1 ] and Y having
N symbols [r0 , r1 , ...rN −1 ]. Then the conditional entropy on source Y given
source X is defined as,
M −1 N −1
X X 1
H(Y |X) = P (si ) P (rj |si ) log2
i=0 j=0
P (rj |si )
By taking P (si ) inside the second summation and using P (si , rj ) = P (si )P (rj |si ),
the equation becomes
M −1 N −1
X X 1
H(Y |X) = P (rj , si ) log2
i=0 j=0
P (rj |si )
Consider two sources X and Y . The mutual information between the two
sources is given by,
Using the relations between joint and conditional entropies, mutual informa-
tion can also be expressed as, I(X; Y ) = H(X) + H(Y ) − H(X, Y ).
76
If X denotes the set of symbols transmitted through a channel and Y denotes
the set of symbols received from a channel, then mutual information can be
interpreted as the amount of information in X obtained after observing Y .
77
4.1.6 Probability matrices
While performing calculations in information theory, it is convenient to rep-
resent the systems in matrix form.
78
The elements of posterior probability matrix [P (X|Y )] (which are helpful
in MAP decoding) are obtained by dividing the elements of joint matrix
[P (Y |X)] with the corresponding received symbol probabilities from [P (Y )].
The entorpies can be obtained more clearly from these probability matrices.
H(X) is calculated from [P (X)]. H(Y ) is calculated from [P (Y )].
79
2. Deterministic channel:
A deterministic channel is a channel such that for every transmit-
ted symbol, there is no uncertainty in which symbol is received i.e
H(Y |X) = 0 and hence I(X; Y ) = H(Y ).
In a deterministic channel matrix P (Y |X), every row has only one
non-zero element, which will be equal to 1.
3. Noiseless channel:
A noiseless channel is a channel that is both lossless and deterministic.
This means there will be certain one to one mapping between source
symbols and received symbols i.e H(Y |X) = H(X|Y ) = 0 and hence
I(X; Y ) = H(X) = H(Y ).
The noiseless channel matrix P (Y |X) is an identity matrix.
4. Useless channel:
A useless channel is a channel which has 0 mutual information and
hence 0 channel capacity (more on channel capacity to be explained).
This is also obvious since a good channel must have high capacity meaning
mutual information should be maximized.
=⇒ C = max[I(X; Y )]
=⇒ C = 1 − H(p)
Since H(p) = H(1 − p), it is obvious that C = 1 − H(1 − p).
80
The channel capacity will be maximum if p = 1 or p = 0 i.e it will be 1 bit
per channel use.
The channel capacity will be minimum if p = 0.5 i.e it will be 0 bits per
channel use.
where BW is the bandwidth of the channel and hence N is the average power
of the noise and interference over the bandwidth.
(note that the SNR is expressed as a linear power ratio, not as logarithmic
decibels)
The above expression is obtained by considering the fact that the maximum
number of distinguishable pulse levels that can be transmitted and received
reliably over a communications channel is limited by the dynamic range of
the signal amplitude and the precision with which the receiver can distinguish
amplitude levels.
The number of levels M is given by,
r r
N +S S
M= = 1+
N N
It can be observed that the channel capacity can also be expressed as,
C = 2BW log2 M
81
using the same expression (BW → ∞).
S
=⇒ C = 1.44
N0
N0 is the amplitude of the noise (AWGN) power spectral density.
Source coding refers to the process of encoding (or mapping) these symbols
into a sequence of digits like bits which is called the ”code”.
The goal of source coding would be to minimize the average number of bits
used to represent the symbols in a source.
82
00,01,10 and 11 respectively. Here, each code-word is of length 2.
A variable length code if not constructed properly will not be uniquely decod-
able. For example, for the same source illustrated before, if the code-words
are 0,1,00 and 11 respectively, it can be noted that given an arbitrary se-
quence of code-words, the original sequence of symbols can not be obtained.
The most convenient way to obtain uniquely decodable codes is to ensure that
the code-words are prefix-free. Meaning, no code-word is a prefix of another
code-word. Such codes are called ”Prefix-Free Codes” or ”Instantaneous
Codes” (since they can be decoded instantaneously without the necessity of
waiting for arrival of next code-word).
For example, for the same source illustrated before, if the code-words are
1,01,001 and 000 respectively, it can be noted that given an arbitrary se-
quence of code-words, the original sequence of symbols can be obtained.
The coding efficiency is defined as the ratio of the entropy of the source to
83
the average code-word length.
PM −1
H(s) i=0 pi log2 pi
η= =− P M −1
L i=0 pi li
The basic idea used is to transmit extra bits called ”Parity bits” along with
the data bits. These parity bits will contain some data about the data bits
that can help detect and correct errors. This technique is called ”Channel
Coding” or ”Error Correction Coding”.
=⇒ Code-word = Data (message) bits + Parity bits
If there are k data bits and m parity bits, then the length of the code word
will consist of n = k + m bits. Such a code is represented as (n, k) code.
84
Linear Block Code properties:
• The minimum distance of the code will be equal to the minimum weight
among all code-words of the code (excluding the all zero code-word).
Hamming Distance:
The Hamming distance between two code-words is the number of elements
(or bits) that are different between them. Hamming distance of any two
arbitrary code-words c1 and c2 (both of same length) is denoted as d(c1 , c2 ).
Example: c1 = 01101, c2 = 11100; =⇒ d(c1 , c2 ) = 2
Hamming Weight:
The Hamming weight of any code-word is the number of non-zero elements
(or bits) present in the code-word. Hamming weight of any code-word c is
denoted as w(c).
Example: c = 11010; =⇒ w(c) = 3
Note that the Hamming distance of two code-words is equal to the Hamming
weight of the difference between the code-words i.e d(c1 , c2 ) = w(c1 − c2 ).
The minimum weight of a code is the minimum Hamming weight of any non-
zero code-word in the code and is denoted by w∗ .
85
Generator matrix G is the matrix that converts a data sequence of length
k to an encoded sequence of length n.
Consider a message block (data sequence) given by (d1 ,d2 ,...dk ) which needs
to be encoded to a code-word given by (c1 ,c2 ,...ck , ck+1 ,...ck+m ).
Hence, the generator matrix takes input dk×1 and gives output cn×1 .
=⇒ c = dG. This means that the generator matrix G is of size k × n.
The first k bits in the code-word will be same as the message bits. The last
m bits i.e the parity bits will be linear combinations of the k message bits.
ck+1 = p11 d1 + p12 d2 + ...p1k dk , . . . . , ck+m = pm1 d1 + pm2 d2 + ...pmk dk .
This means that the generator matrix G has rank k.
The coefficients of the data bits that result in the parity bits can be expressed
in matrix form, called the ”Coefficient Matrix” P .
p11 p12 . . . p1k
=⇒ Pm×k = ... .. .. ..
. . .
pm1 pm2 . . . pmk
The generator matrix can be expressed by combining the above observations.
It will consist of an identity matrix of dimensions k followed by the transpose
of the coefficient matrix.
=⇒ Gk×n = [Ik : P T ].
Parity Check matrix H is the matrix that decodes the encoded sequence
back to the original data sequence.
H is obtained such that GH T = 0. Hence, it can be deduced that the parity
check matrix should be H = [P : In−k ].
This implies that the parity check matrix H is of size (n − k) × n.
86
If the transmitted code-word is c and the received code-word is r (both will
be rows of n elements), then the error pattern e = c + r, which can be mod-
ified as r = c + e.
The error pattern e will have 0 if there is no error in the corresponding bit
position i.e r and c are same and will have 1 if there is an error in the corre-
sponding bit position i.e r and c are different.
S = eH T will give the row of the parity check matrix which corresponds to
the position of the error. So the algorithm simply compares the obtained
syndrome S with each row of the matrix H T and the index of the row which
matches with S indicates the position of the error in r, which has to be in-
verted to obtain back c.
If none of the rows of H T matches with a non-zero S, then it means error has
occurred in more than one position and the algorithm has to check for linear
combinations of rows of H T which match with S to identify error positions.
An (n, k) LBC will have 2n−k distinct syndromes and 2n−k − 1 distinct non-
zero syndromes.
(7, 4) Hamming code consists of 7 bits overall with 4 message bits and 3 par-
ity bits. The parity bits occupy positions that are powers of 2 i.e positions
87
1,2 and 4. The remaining positions are occupied by the data bits.
Hence, in general the Hamming code can be represented as (d7 , d6 , d5 , p4 , d3 , p2 , p1 ).
• Write the bit numbers in binary: 1, 10, 11, 100, 101, 110, 111, etc.
• All bit positions that are powers of two (have a single 1 bit in the binary
form of their position) are parity bits: 1, 2, 4, 8, etc. (1, 10, 100, 1000)
• All other bit positions, with two or more 1 bits in the binary form of
their position, are data bits.
– Parity bit 1 covers all bit positions which have the least significant
bit set: bit 1 (the parity bit itself), 3, 5, 7, 9, etc.
– Parity bit 2 covers all bit positions which have the second least
significant bit set: bit 2 (the parity bit itself), 3, 6, 7, 10, 11, etc.
– Parity bit 4 covers all bit positions which have the third least
significant bit set: bits 4–7, 12–15, 20–23, etc.
– Parity bit 8 covers all bit positions which have the fourth least
significant bit set: bits 8–15, 24–31, 40–47, etc.
(In general each parity bit covers all bits where the AND of the parity position
and the bit position is non-zero)
The parity bits are calculated by finding the bits necessary to be placed in
their respective positions described earlier so as to obtain even parity for
their corresponding positions.
In (7,4) Hamming code:
88
After Hamming code is generated by adding the parity bits to the data bits
and transmitted, the received bit sequence is tested for errors.
If due to error any bit is flipped, then the corresponding parity will be found
to be odd instead of even and hence it can be concluded that error has been
detected.
Process of error correction:
• For all parity bits that satisfy even parity, set the corresponding binary
number bit to 0.
• For all parity bits that do not satisfy even parity (i.e error is detected),
set the corresponding binary number bit to 1.
89
in general if any one is wrong, it still means error has occurred.
For error correction, note that all 3 parity bits are wrong meaning the binary
value of the error location is 111 which corresponds to d7 . Therefore, d7 has
error and it should be 0 instead of 1.
(Note that if two errors have occurred, then Hamming code does not work)
A CRC for a sequence of data bits (message) is generated by the sender using
a particular algorithm and another sequence which is known by the receiver
as well called the ”divisor”.
CRC Generation:
• Perform binary division i.e the message with appended zeros divided
by the divisor.
90
Error Detection using CRC:
Once the encoded data is received, the receiver performs the same binary
division operation on the received data using the same divisor (note that the
common divisor is predetermined by the protocol).
91