0% found this document useful (0 votes)
28 views84 pages

Communication Systems Lab New

The document outlines the syllabus and practical experiments for the B.E. Mechatronics Engineering IV Semester at Trichy Engineering College, focusing on embedded systems and communication systems laboratory work. It includes detailed procedures for experiments on amplitude modulation, frequency modulation, analog sampling, time division multiplexing, and pulse code modulation. Each experiment aims to provide hands-on experience with various modulation techniques and signal processing concepts.

Uploaded by

rajiece.19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views84 pages

Communication Systems Lab New

The document outlines the syllabus and practical experiments for the B.E. Mechatronics Engineering IV Semester at Trichy Engineering College, focusing on embedded systems and communication systems laboratory work. It includes detailed procedures for experiments on amplitude modulation, frequency modulation, analog sampling, time division multiplexing, and pulse code modulation. Each experiment aims to provide hands-on experience with various modulation techniques and signal processing concepts.

Uploaded by

rajiece.19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 84

Page No:

TRICHY ENGINEERING COLLEGE


(A Unit of SS Group of Institutions)
(Approved by AICTE & Affiliated to Anna University, Chennai)
Sivagnanam Nagar, Konalai, Tiruchirappalli - 621 132.

B.E. MECHATRONICS ENGINEERING

IV SEMESTER
ANNA UNIVERSITY, CHENNAI
REGULATION- 2021

MR-3492 EMBEDDED SYSTEMS LABORATORY

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

SYLLABUS
EC8561 COMMUNICATION SYSTEMS LABORATORY LTPC
0 0 3 1.5

1. AM Modulation & De-Modulation


2. FM Modulation & De-Modulation
3. Pre-emphasis and De-emphasis
4. Signal Sampling and TDM
5. Pulse Code Modulation and Demodulation
6. Pulse Amplitude Modulation and Demodulation
7. Pulse Position Modulation and Demodulation and Pulse Width Modulation and Demodulation
8. Digital Modulation – ASK, PSK, FSK.
9. Delta Modulation and De-modulation
10. Simulation of ASK, FSK, and BPSK generation and Detection schemes
11. Simulation of DPSK, QPSK and QAM generation and Detection schemes
12. Simulation of Linear Block and Cyclic error control coding schemes

TOTAL= 45 PERIODS

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No : 1 AMPLITUDE MODULATION AND DEMODULATION


Date :

AIM:
To perform amplitude modulation and demodulation and to find the modulation index.

APPARATUS REQUIRED:

13. AM Modulation kit CT-1


14. AM Demodulation kit CT-2
15. CRO
16. Patch cords

THEORY:

AMPLITUDE MODULATION:

Amplitude modulation is defined as the system of modulation in which the instantaneous value of
carrier amplitude is varied in accordance with modulating signal. Here the information signal is the
modulating signal and the high frequency signal which is being modulated is the carrier signal.

The instantaneous value of modulating signal


em = Emsinωmt

The instantaneous value of carrier signal


ec = Ecsinωct

em = ec --Instantaneous amplitudes of message and carrier signals

Em = Ec -- Maximum amplitudes of message and carrier signals

ωm = ωc -- Angular frequencies of message and carrier


signals The equation for AM wave is V= Ec[ 1+m sinωmt]
The modulating signal voltage Em must be less than the carrier voltage Ec for amplitude
modulation.

The ratio of the modulating signal voltage to the carrier signal voltage is modulation index (or)
modulation factor (or) modulation coefficient (o)r degree of modulation.

Modulation index (m) = Em / Ec

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Modulation index is a number lying between 0 and 1 and is often expressed in terms of percentage
and called the percentage modulation.

AMPLITUDE DEMODULATION:

Demodulation is the reverse process of modulation and it converts the modulated carrier back to
the original information signal.The simple method of demodulating an AM signal is using
Envelope detector. In the demodulation process the diode as a half wave rectifier followed by an
active low pass filter is used. After the wave is rectified by the diode, the high frequency carrier is
filtered out by the active low pass filter .This method of demodulation is known as coherent
detection or synchronous demodulation.

PROCEDURE:

AMPLITUDE MODULATION:

1.Construct the modulation circuit with patch cords as noted by dotted lines on the kit CT-1
2.Switch ‘ON’ the unit.
3. Measure the carrier and modulating signals to the AM wave on the CRO.
4. Observe the percentage of modulation by adjusting the amplitudes of either modulating signal or
carrier wave.

AMPLITUDE DEMODULATION:

1.Construct the demodulation circuit with patch cords according to the dotted lines on the kit CT-2.
2.Connect the modulation output from kit CT-1 to the AM input point of kit CT-2.
3. Observe the waveforms at the output on CRO.
4. Adjust the 100KΩ pot at the input and notice the variation in the
output. 5.Adjust the 22KΩ pot to achieve a pure sine wave.
6. Compare the Modulating signal of Kit CT-1 with the output signal of kit CT-2.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

TABULATION:

AMPLITUDE MODULATION

S.No Signal Amplitude(V) Timeperiod(ms) Modulation index


1 Modulating signal
(Message signal)

2 Carrier signal m= Emax –Emin

Emax+Emin
3 Amplitude Emax =
Modulated signal m=
Emin=

Emax = Ec + Em

Emax = Ec - Em

MODEL GRAPH:

Trichy Engineering College,


Konalai,Trichy
Page No:

AMPLITUDE DEMODULATION:

S.No Signal Amplitude (V) Time period (ms)

1 AM signal

2 Modulating
signal

MODEL GRAPH

RESULT:
Thus the amplitude modulation and demodulation was performed and output waveforms are
verified successfully.
The modulation index is found to be =

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No: 2 FREQUENCY MODULATION AND DEMODULATION


Date :

AIM:
To perform frequency modulation and demodulation.

APPARATUS REQUIRED:

1. FM Modulation kit CT-3


2. FM Demodulation kit CT- 4
3. CRO
4. Patch cords

THEORY:

FREQUENCY MODULATION

Frequency modulation is defined as the system of modulation in which the frequency of the carrier
is varied in accordance with the modulating signal but the amplitude of the carrier is kept constant.
The amount of change in carrier frequency produced by the modulating signal is known as
frequency deviation. Maximum frequency deviation occurs at the maximum amplitude of the
modulating signal. The ratio of frequency deviation ∆f to the modulating frequency fm is called
as the modulation index of the FM wave denoted by mf.

mf = ∆f/ fm

The modulation index can have value either less than one or more than one.

The equation for FM wave is V= A sin [ωc t + mf sin ωm t]


Since in FM, amplitude of the carrier is constant, the transmitted power is constant. The main
advantage of FM over AM is the noise immunity.

FREQUENCY DEMODULATION
Frequency demodulation is the process that enables us to recover the original
modulating signal from a frequency modulated signal. The objective is to produce a transfer
characteristic that is inverse of that of the frequency modulator which can be realized directly or
indirectly. The direct method involves the use of a frequency discriminator whose instantaneous
output amplitude is directly proportional o the instantaneous frequency of the input FM signal. The
frequency discriminator consists of a slope circuit followed by a envelope detector. The indirect
method of frequency demodulation involve is done using a phase locked loop.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

PROCEDURE:

FREQUENCY MODULATION

1.Construct the modulation circuit with patch cords as noted by dotted lines on the kit CT-3
2.Switch ‘ON’ the unit.
3.Measure the carrier and modulating signals to the FM wave on the CRO.
4.Observe the variation in the output waveform by varying the AF generator.
5.Observe and plot the waveforms.

FREQUENCY DEMODULATION

1.Construct the demodulation circuit with patch cords according to the dotted lines on the kit CT-4.
2.Connect the modulation output from kit CT-3 to the FM input point of kit CT-4.
3. Observe the waveforms at the output on CRO.
4. Observe whether the output is proportional to the input of the modulation circuit.

TABULATION:
FREQUENCY MODULATION

S.No Signal Amplitude(V) Timeperiod(ms)


1 Modulating signal
(Message signal)

2 Carrier signal

3 Frequency modulated
signal

FREQUENCY DEMODULATION:

S.No Signal Amplitude (V) Time period (ms)

1 FM signal

2 Modulating
signal

Trichy Engineering College,


Konalai,Trichy
Page No:

MODEL GRAPH:

MODEL GRAPH:

RESULT:
Thus the frequency modulation and demodulation was performed and output waveforms are
verified successfully.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No: 3 ANALOG SAMPLING AND RECONSTRUCTION


Date :

AIM:
To sample the given analog signal and to reconstruct the sample.

APPARATUS REQUIRED:

1. Sampling kit-1
2. Patch cords.
3. Power supply
4.CRO.

THEORY:

Sampling of the signal is fundamental operation in signal processing. A continuous time signal is
first converted to discrete time signal by sampling process.
“A continuous-time signal may be completely represented in its samples and recovered back
if the sampling frequency is fs ≥ 2fm. Here fs is the sampling frequency and fm is the
maximum frequency present in the signal.”Basically there are three types of sampling
techniques- Instantaneous or ideal sampling, Naturally sampling , Flat top sampling. When the
sampling rate becomes exactly equal to 2fm samples per second, then it is called Nyquist rate.
Nyquist rate is also called minimum sampling rate. When a too low sampling rate is used while
coding an analog signal for digital transmission ,distortion is created which is known as aliasing.
To avoid aliasing – Pre- alias filter must be used to limit band of frequencies of signal to fm Hz
and also fs≥2fm.

PROCEDURE:

1. The connections are given as per the circuit diagram.


2.Connect the power supply.
3.Connect the 1 KHz sine wave or( 2KHz) input on board to buffer input.
4.Connect the sampling frequency clock in internal mode.
5.Connect the buffer output to naturally sampling input and observe the sampled input.
6.Repeat the procedure for flat-top sampling and sample and hold inputs.
7. Observe the waveforms.
8. Connect the sampled output to the input of LP and observe the reconstructed
output. 9.Draw the graphs.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

TABULATION:

S.No. Signal Amplitude(V) Time Reconstructed output


period(ms)
1 Analog signal Amplitude(V) Time
(ms)

2 Carrier signal

3 Sample and
hold
4 Fat top
sampling
5 Naturally
sampling

RESULT:
Thus the given analog frequencies are sampled using different samplig techniques and the input
analog signal is reconstructed .

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No: 4 TIME DIVISION MULTIPLEXING


Date :

AIM:
To perform time division multiplexing for the given analog frequencies and to demultipex it.

APPARATUS REQUIRED:

1. TDM kit-1
2. Patch cords
3. Power supply
4.CRO-1

THEORY:

The Sampling Theorem provides the basis for transmitting the information contained in a band
limited message signal m (t) as a sequence of samples of m (t) taken uniformly at a rate that is
usually slighter higher than the nyquist rate. An important feature of the sampling process is a
conservation of time. That is, the transmission the message samples engages the communication
channel s for only a fraction of the sampling interval on a periodic basis, and in this way some of
the time interval between adjacent samples is cleared for use by other independent message sources
on a time shared basis. We there by obtain a time division multiplexing (TDM) system, which
enables the joint utilization of a common communication channel by a plurality of independent
message sources without mutual interference among them.
The TDM system is highly sensitive to dispersion in the common
channel, that is, to variations of amplitude with frequency or lack of proportionality of phase with
frequency. Accordingly, accurate equalization of both magnitude and phase response of a channel is
necessary to ensure a satisfactory operation of the system. Unlike FDM, TDM is immune to non
linearities in the channel as a source of cross talk. The reason for this is, the different message
signals are not simultaneously applied to the channel.
The primary advantage of TDM is that several channels of information can be transmitted
simultaneously over a single cable.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

TABULATION:

S.no Frequency(Hz) Input Output

Amplitude(V) Time Amplitude(V) Time


period(ms) period(ms)
1

MODEL GRAPH:

The signal x(t) and its PAM signal

Trichy Engineering College,


Konalai,Trichy
Page No:

TDM of two signals

RESULT:

Thus the given two signals are multiplexed and the waveforms are plotted.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No: 5 PULSE CODE MODULATION AND DEMODUALTION


Date :

AIM:
To perform sampling ,multiplexing and reconstruction techniques in Pulse code modulation
and demodulation.

APPARATUS REQUIRED:

1.PCM modulation and demodulation kit.


2.Patch cords
3. CRO-1
4. Power supply.

THEORY:
In pulse code modulation (PCM) 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 operations performed in the transmitter of a PCM system are sampling,
quantizing and encoding. The low pass filter prior to sampling is included to prevent aliasing of the
message signal. The incoming message signal is sampled with a train of narrow rectangular pulses
so as to closely approximate the instantaneous sampling process. To ensure perfect reconstruction
of the message signal at the receiver, the sampling rate must be greater than twice the highest
frequency component W of the message signal in accordance with the sampling theorem.
The quantizing and encoding operations are usually performed in the same circuit,
which is called an analog-to-digital converter. The same circuit, which is called and analog-to-
digital converter. The sampled version of the message signal is then quantized, thereby providing a
new representation of the signal that is discrete in both time and amplitude. In combining the
process of sampling and quantization, the specification of a continuous message (baseband) signal
becomes limited to a discrete set of values, but not in the form best suited to transmission. To
exploit the advantages of sampling and quantizing for the purpose of making the transmitted signal
more robust to noise, interference and other channel impairments, we require the use of an encoding
process to translate the discrete set of sample values to a more appropriate form of signal.

PROCEDURE:

1. Connections are given as per the block diagram.


2.Connect the power supply in proper polarity to the
kit.
3. Connect the analog frequencies generated on board( 500 Hz and 1 KHz) to the input of the
sample and hold circuit. Observe the waveforms.
4. Connect the sample and hold output to the MUX input.
5. Connect the Tx DATA, Tx CLK, Tx SYNC to Rx DATA,Rx CLK and Rx SYNC.
6.Connect the DAC output to the input of Demux.
7.Connect the Demux output to the filter input.
8.Observe the waveform and plot the graph.
Trichy Engineering College,
Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

TABULATION:

S.No Signal Amplitude(V) Time(ms)

1 Clock signal

2 Input 0

3 Input 1

4 OUT 0

5 OUT 1

6 MUX output

7 CH0

8 CH1

Trichy Engineering College,


Konalai,Trichy
Page No:

9 OUT 0 (filter output)

10 OUT 1 (filter output)

RESULT:
Thus the sampling, multiplexing and reconstruction techniques in pulse code modulation
were performed and their output waveforms were plotted.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No: 6 LINE ENCODING AND DECODING


Date :

AIM:
To obtain and verify different line coding techniques.

APPARATUS REQUIRED:

1.Line encoder and decoder kit -1


2.Patch cords
3. CRO-1
4. Power supply.

THEORY:

We need to represent PCM binary digits by electrical pulses in order to transmit them through a
base band channel.

The most commonly used Line coding methods are given here.

1. NON RETURN TO ZERO SIGNALS:


These are easiest data formats that can be generated. They are called “Non-return to zero
because the signals do not return to zero with the clock. The frequency components
associated with these signals are half of the clock frequency. The following data formats
come under this category.

a. Non-return to zero – LEVEL NRZ – L


b. Non-return to zero – MARK NRZ – M
C. Non-return to zero – SPACE NRZ – S
a. Non-return to zero – LEVEL coding (NRZ – L)
This is the most extensively used waveform in digital logics. The data format is very smple
where all 1’s are represented by high and all 0’s are represented by lows. The data format is
directly got at the output of all digital data generation logics and hence very easy to generate.
Here all the transistors take place at the rising edge of the clock.

b. Non-return to zero –MARK coding (NRZ – M)


This waveform is extensively used in magnetic tape recording. In this data format, all one’s
are marked by change in levels and all zero’s by no transitions., and the transitions take
place at the rising edge of the clock.

Trichy Engineering College,


Konalai,Trichy
Page No:

c. Non-return to zero – SPACE coding (NRZ-S ):

This type of waveform is marked by change in levels for ‘zeros’ and no transition of for
‘ones’ and the transition take place at the rising edge of the clock. This format is also used in
magnetic tape recording

2) RETURN TO ZERO SIGNALS:

These signals are called “Return to zero signals”, since they return to ‘zero’ with the clock.
In this category, only one data format, i.e., the unipolar return to zero (URZ)

a. Unipolar Return to zero coding (URZ) :

With the URZ, a ‘one’ is represented by a half bit wide pulse and a ‘zero’ is represented by
the absence of a pulse.

3) BIPHASE SIGNALS (PHASE ENCODED SIGNALS) :


a) BiPhase – LEVEL (Manchester Coding)
b) Biphase – MARK and
c) Biphase – Space Signals
These schemes are used in magnetic recording, optical communications and in satellite
telemetry links. This phase encoded signals are special in the sense that they are composed
of both the in phase and out-of-phase components of the clock.

a. Manchester Coding (Biphase –L):


With the Biphase – L, a ‘one’ is represented by a half bit wide pulse positioned during the
first half of the bit interval and a ‘zero, is represented by a half bit wide pulse positioned
during the second half of the bit interval.

b. Biphase Mark Coding (Biphase –M):


With the Biphase – M, a transition occurs at the beginning of every bit interval. A ‘one’ is
represented by a second transition, one half bit later whereas a zero has no second transition.

c. Bi-Phase Space coding (Biphase –S):


With a Biphase – S also a transition occurs at the beginning of every bit interval. A ‘zero’ is
marked by a second transition, one half bit later, where as a ‘one’ has no second transition.

4 MULTI LEVEL SIGNALS:

Multilevel signals use three or more levels of voltages to represent the binary digits, ‘ones’
and ‘zeros’ – instead of the normal ‘highs’ and ‘lows’.

Trichy Engineering College,


Konalai,Trichy
Page No:

Return to zero – Alternate Mark Inversion (RZ-AMI) is the most commonly used multilevel
signal and under the category of multilevel signal .

Return to zero – Alternate Mark Inversion Coding (RZ-AMI):

This coding scheme is most often used in telemetry systems. This scheme comes under both the
category of return to zero scheme and multilevel scheme. The one’s are represented by pulse width
of half the bit duration existing in the alternate direction whereas zero’s are represented by absence
of the pulse.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

PROCEDURE:

1. The connections are given as per the circuit diagram.


2. Measure the clock signal and the data generator signal on board.
3. By varying the dip switches data can be set.
4. Measure the corresponding NRZ-L,NZ,CLK and CLK outputs.
5. Connect the NRZ-L,NRZ,CLK and CLK to the inputs of
Encoder. 6.Observe the various line coding outputs with reference to
NRZ-L 7.Connect the output to the corresponding decoder input.
8.Measure the decoded output which is the original NRZ output.
9.Plot the waveforms for all the line coding techniques.

RESULT:

Thus the various line encoding techniques are verified and decoded successfully.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP:NO: 7 DELTA MODULATION AND ADAPTIVE DELTA MODULATION


DATE:

AIM:
i) To experiment and verify Delta-Modulation and Demodulation techniques
ii) To experiment and verify adaptive delta modulation techniques.

APPARATUS REQUIRED:
1. ADM kit-1
2. CRO-1
3. Patch chords

THEORY:
DELTA-MODULATION

Delta modulation is a simplified PCM. The output of a delta modulator is a bit stream
of samples, at a relatively high rate the value of each bit being determined according as to whether
the input message sample amplitude has increased or decreased relative to the previous sample. It is
an example of differential pulse code modulation (DPCM).The operation of a delta modulator is to
periodically sample the input message, to make a comparison of the current sample with that
preceding it, and to output a single bit which indicates the sign of the difference between the two
samples. This in principle would require a sample-and-hold type circuit.

The system is in the form of a feedback loop. It is a continuous time to discrete time converter. In
fact, it is a form of analog to digital converter. The sampler block is clocked. The output from the
sampler is a bipolar signal, in the block diagram being either V volts.This is the delta modulated
signal.
The sawtooth waveform is subtracted from the message and the difference – an error signal – is the
signal appearing at the summer output. An amplifier is shown in the feedback loop. This controls
the loop gain and the size of the ‘teeth’ of the sawtooth waveform. The signal from the integrator,
which is a sawtooth approximation to the message, is adjusted with the amplifier to match it as

Trichy Engineering College,


Konalai,Trichy
Page No:

closely as possible. This is the delta modulated signal. The integral of the binary waveform is the
sawtooth approximation to the message. Lowpass filtering of the sawtooth gives a better
approximation to the message. But there will be accompanying noise and distortion, products of the
approximation process at the modulator. The unwanted products of the modulation process,
observed at the receiver, are of two kinds. These are due to ‘slope overload’ and ‘granularity’.

ADAPTIVE DELTA MODULATION

There is a conflict between the requirements for minimization of slope overload and the granular
noise. The one requires an increased step size, the other a reduced step size. There is a way to
overcome this problem which adjusts the step size according to the slope of the signal being
sampled. This is a variation of the basic delta modulation and is called the adaptive delta
modulation.
A large step size is required when sampling those parts of the input waveform of
steep slope. But a large step size worsens the granularity of the sampled signal when the waveform
being sampled is changing slowly. A small step size is preferred in regions where the message has a
small slope. This suggests the need for a controllable step size – the control being sensitive to the
slope of the sampled signal.

PROCEDURE:

DELTA MODULATION
1. Connect the AC supply o the kit. Ensure that the faults are in normal position.
2. Make connections and settings as shown in block ddiagram.
3. Connect the 250 Hz sine wave input of 0V peak-to peak through pot P1 and feed it to the input buffer
section. Connect the buffer output to delta modulator input.
4. Then sampling frequency of 8 KHz by pressing selection key.
5. Switch ON the power.
6. Then observe the Delta modulated output and compare it with the sampling frequency selected.
7. Observe the integrator output test point. It can be observed that as the clock rate is increased
amplitude of triangular waveform decreases. This is called minimum step size.
8 .It is observed that increasing the signal amplitude through the selected pot from 0-1V p-p makes the
integrator output to go upward and decreasing makes integrator output to go downwards.
9. Connect the delta modulator output to th input of delta demodulator section.
10. Connect the output of delta demodulator to the input of output buffer section. And give buffer
output to the second order low pass filter or fourth low pass filter.
11. Observe the waveforms and plot the graph.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

ADAPTIVE DELTA MODULATION:

1. Connect the AC supply to the kit.


2. Ensure that all faults are in normal position.
3. Make connections and settings as shown in block diagram.
4. Connect the 1 KHz and 2 V p-p sine wave to the input of the buffer
section. 5.Connect the buffer output to the CVSD modulator input.
6.Select the clockrate of 32 KHz by pressing the selection key.
7.Observe the CVSD output through CRO.
8. Connect the CVSD modulated ouput to the input of buffer output section and connect buffer output to
the input of second order or fourth order lowpass filter to reconnect the original signal.
9. Observe all the waveforms and plot the graph.

Trichy Engineering College,


Konalai,Trichy
Page No:

TABULATION:

S.NO Signal Amplitude Time period

RESULT:

Thus Delta modulation and demodulation and Adaptive delta modulation and demodulation
was performed and the output was verified successfully.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP:NO :8 ERROR CONTROL CODING USING


MATLAB DATE:

IMPLEMENTATION OF LINEAR BLOCK CODES


AIM:
Construct a ( 7,4 ) Linear block code whose generator matrix is given by

G = 1000111
0100110
0010101
0001011

Determine all code words and the minimum weight of the code.
APPARATUS REQUIRED:
MATLAB 7.0 software package
THEORY:
Linear Block Codes:
It is one of the error control coding technique. Linear codes means that sum of any
two code vector gives another code vector. Also it is a systematic code. Block codes in which the
message bits are transmitted in unaltered form are called systematic code.
Consider an (n,k) linear block code in which, ‘k’ is a message bit, ‘n’ is block length
and b = n-k is a parity check bit.
b0,b1,b2,b3…..............bn-k-1 m0, m1, m2, m3….........mk-1

Structure of Code word


Message vector m = [m0, m1, m2….................mk-1]
Parity Check vector b = [b0, b1, b2…................bn-k-1]
Code vector X = [x0, x1, x2…............xn-1]
B=mxP
Where,

Trichy Engineering College,


Konalai,Trichy
Page No:

P00 P10............................................. Pn-k-1,0


P01 P11 .………………Pn-k-1,1
.
P = .
.
P0, k-1 P1,k-1 …………….. Pn-k-1, k-1

Define the k by n generator matrix


G = [ P:Ik ]
Define the (n-k) by k sub matrix
H = [ Ik:pT ]
Parity check vector
B= mxP
Code vector X = Message Vector Parity check vector

ALGORITHM :
 From the given (n,k) block code assign the values of ‘k’ nothing but number of
message bits.
 Assign the given generator matrix.
 Compute the check vector, then arrange code vector by combining message &
check vector.
 Find the weight of the code that is by finding minimum hamming weight of the
code which is nothing but the number of non zero bits in a code vector.
 Find the minimum weight of the code, from that we can understand that the
given block code can able to detect & correct how many bits.
 Display the all possible code vector and weight of the code.

Trichy Engineering College,


Konalai,Trichy
Page No:

PROGRAM:

close all;
clear all;
clc;
k=4;
for i=1:2^k
for j= k: -1:1
if rem(i-1,2^(-j+k+1))>=2^(-j+k)
u(i,j) = 1
else

u(i,j)=0;
end
echo off;
end
end
echo on;
g = [1000111;
0100110;
0010101;
0001011]
c=rem(u*g,2);

disp(c);
w_min=min(sum((c(2:2^k,:)’));
disp(w_min);

Trichy Engineering College,


Konalai,Trichy
Page No:

OUTPUT :

0000000
0001011
0010101
0011110
0100110
0101101
0110011

0111000
1000111
1001100
1010010
1011001
1100001

1101010
1110100
1111111

w_min=min(sum((c(2:2^k,:)’));
disp(w_min);
3

RESULT:

Thus the error control coding techniques are executed using MATLAB program.

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.NO:9
DATE: BINARY PHASE SHIFT KEYING

Aim: To generate and demodulate binary phase shift keyed (PSK) signal using MATLAB

Apparatus required:

Matlab 7.1

Theory:
Generation of PSK signal
PSK is a digital modulation scheme that conveys data by changing, or modulating, the phase of a
reference signal (the carrier wave). PSK uses a finite number of phases, each assigned a unique pattern
of binary digits. Usually, each phase encodes an equal number of bits. Each pattern of bits forms the
symbol that is represented by the particular phase. The demodulator, which is designed specifically for
the symbol-set used by the modulator, determines the phase of the received signal and maps it back to
the symbol it represents, thus recovering the original data.
In a coherent binary PSK system, the pair of signal S 1(t) and S2 (t) used to represent binary symbols 1 &
0 are defined by
S1 (t) = √2Eb/ Tb Cos 2πfct
S2 (t) =√2Eb/Tb (2πfct+π) = - √ 2Eb/Tb Cos 2πfct where 0 ≤ t< Tb
and Eb = Transmitted signed energy for bit
The carrier frequency fc =n/Tb for some fixed integer n.

Antipodal Signal:
The pair of sinusoidal waves that differ only in a relative phase shift of 180° are called antipodal signals.
BPSK Transmitter
Binary Wave Product BPSK signal
(Polar form)
c1 (t) = √2/Tb cos 2πfct

Trichy Engineering College,


Konalai,Trichy
Page No:

The input binary symbols are represented in polar form with symbols 1 & 0 represented by constant
amplitude levels √Eb & -√Eb. This binary wave is multiplied by a sinusoidal carrier in a product
modulator. The result in a BSPK signal.

BSPK Receiver:

The received BPSK signal is applied to a correlator which is also supplied with a locally generated
reference signal c1 (t). The correlated o/p is compared with a threshold of zero volts. If x> 0, the receiver
decides in favour of symbol 1. If x< 0, it decides in favour of symbol 0.

Algorithm
Initialization commands
PSK modulation
1. Generate carrier signal.
2. Start FOR loop
3. Generate binary data, message signal in polar form
4. Generate PSK modulated signal.
5. Plot message signal and PSK modulated signal.
6. End FOR loop.
7. Plot the binary data and carrier.

PSK demodulation
1. Start FOR loop
Perform correlation of PSK signal with carrier to get decision variable
Make decision to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’
Plot the demodulated binary data.

Trichy Engineering College,


Konalai,Trichy
Page No:

Program
% PSK modulation
clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1;
t=0:Tb/100:Tb;
fc=2;
c=sqrt(2/Tb)*sin(2*pi*fc*t);
%generate message signal
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
else
m(i)=0;
m_s=-1*ones(1,length(t));
end
message(i,:)=m_s;
%product of carrier and message signal
bpsk_sig(i,:)=c.*m_s;
%Plot the message and BPSK modulated signal
subplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r');
title('message signal(POLAR form)');xlabel('t--->');ylabel('m(t)');
grid on; hold on;
subplot(5,1,4);plot(t,bpsk_sig(i,:));
title('BPSK signal');xlabel('t---
>');ylabel('s(t)'); grid on; hold on;
t1=t1+1.01; t2=t2+1.01;
end
Trichy Engineering College,
Konalai,Trichy
Page No:

hold off
%plot the input binary data and carrier signal
subplot(5,1,1);stem(m);
title('binary data bits');xlabel('n--->');ylabel('b(n)');
grid on;
subplot(5,1,3);plot(t,c);
title('carrier signal');xlabel('t--->');ylabel('c(t)');
grid on;
PSK Demodulation
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
%correlator
x=sum(c.*bpsk_sig(i,:));
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+1.01;
t2=t2+1.01;
end
%plot the demodulated data bits
subplot(5,1,5);stem(demod);
title('demodulated data');xlabel('n--->');ylabel('b(n)');
grid on

Trichy Engineering College,


Konalai,Trichy
Page No:

Result
The program for Binary Phase Shift Keying modulation and demodulation has been simulated in
MATLAB and necessary graphs are plotted.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP .No: 9 FREQUENCY SHIFT KEYING


DATE:

Aim: To generate and demodulate frequency shift keyed (FSK) signal using MATLAB

Apparatus required.
Matlab 7.1

Theory
Generation of FSK
Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is
transmitted through discrete frequency changes of a carrier wave. The simplest FSK is binary FSK
(BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s and 1s) information. With this
scheme, the "1" is called the mark frequency and the "0" is called the space frequency.
In binary FSK system, symbol 1 & 0 are distinguished from each other by transmitting one of the two
sinusoidal waves that differ in frequency by a fixed amount.
Si (t) = √2E/Tb cos 2πf1t 0≤ t ≤Tb
0 elsewhere
Where i=1, 2 & Eb=Transmitted energy/bit
Transmitted freq= ƒi = (nc+i)/Tb, and n = constant (integer), Tb = bit interval
Symbol 1 is represented by S1 (t)
Symbol 0 is represented by S0 (t)
BFSK Transmitter

The input binary sequence is represented in its ON-OFF form, with symbol 1 represented by
constant amplitude of √Eb with & symbol 0 represented by zero volts. By using inverter in the
lower channel, we in effect make sure that when symbol 1is at the input, The two frequency
f1& f2 are chosen to be equal integer multiples of the bit rate 1/T b.By summing the upper &
lower channel outputs, we get BFSK signal.

Trichy Engineering College,


Konalai,Trichy
Page No:

The receiver consists of two correlators with common inputs which are supplied with locally
generated coherent reference signals c1(t) and c2 (t).
The correlator outputs are then subtracted one from the other, and the resulting difference x is
compared with a threshold of zero volts. If x >0, the receiver decides in favour of symbol 1
and if x <0, the receiver decides in favour of symbol 0.

Algorithm
Initialization commands
FSK modulation
1. Generate two carriers signal.
2. Start FOR loop
3. Generate binary data, message signal and inverted message signal
4. Multiply carrier 1 with message signal and carrier 2 with inverted message signal
5. Perform addition to get the FSK modulated signal
6. Plot message signal and FSK modulated signal.
7. End FOR loop.
8. Plot the binary data and carriers.

FSK demodulation
1. Start FOR loop
2. Perform correlation of FSK modulated signal with carrier 1 and carrier 2 to get two
decision variables x1 and x2.
3. Make decisionon x = x1-x2 to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’.
4. Plot the demodulated binary data.

Trichy Engineering College,


Konalai,Trichy
Page No:

Program
% FSK Modulation
clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1; fc1=2;fc2=5;
t=0:(Tb/100):Tb;
c1=sqrt(2/Tb)*sin(2*pi*fc1*t);
c2=sqrt(2/Tb)*sin(2*pi*fc2*t);
%generate message signal
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:(Tb/100):t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
invm_s=zeros(1,length(t));
else
m(i)=0;
m_s=zeros(1,length(t));
invm_s=ones(1,length(t));
end
message(i,:)=m_s;
%Multiplier
fsk_sig1(i,:)=c1.*m_s;
fsk_sig2(i,:)=c2.*invm_s;
fsk=fsk_sig1+fsk_sig2;
%plotting the message signal and the modulated signal
subplot(3,2,2);axis([0 N -2 2]);plot(t,message(i,:),'r');
title('message signal');xlabel('t- - ->');ylabel('m(t)');grid on;hold on;
subplot(3,2,5);plot(t,fsk(i,:));
title('FSK signal');xlabel('t- - ->');ylabel('s(t)');grid on;hold on;
t1=t1+(Tb+.01); t2=t2+(Tb+.01);
end
hold off
%Plotting binary data bits and carrier signal
subplot(3,2,1);stem(m);
title('binary data');xlabel('n- - ->'); ylabel('b(n)');grid on;
subplot(3,2,3);plot(t,c1);
title('carrier signal-1');xlabel('t- - ->');ylabel('c1(t)');grid on;
subplot(3,2,4);plot(t,c2);
title('carrier signal-2');xlabel('t- - ->');ylabel('c2(t)');grid on; 13

Trichy Engineering College,


Konalai,Trichy
Page No:

% FSK Demodulation
t1=0;t2=Tb
for i=1:N
t=[t1:(Tb/100):t2]
%correlator
x1=sum(c1.*fsk_sig1(i,:));
x2=sum(c2.*fsk_sig2(i,:));
x=x1-x2;
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end t1=t1+
(Tb+.01);
t2=t2+(Tb+.01);
end
%Plotting the demodulated data bits
subplot(3,2,6);stem(demod);
title(' demodulated data');xlabel('n- - ->');ylabel('b(n)'); grid on;

Result
The program for FSK modulation and demodulation has been simulated in MATLAB and necessary
graphs are plotted.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.No: 10 QUADRATURE PHASE SHIFT KEYING


DATE:

Aim: To generate and demodulate quadrature phase shifted (QPSK) signal using MATLAB

Apparatus required:
Matlab 7.1

Theory
Generation of Quadrature phase shift keyed (QPSK) signal
QPSK is also known as quaternary PSK, quadriphase PSK, 4-PSK, or 4-QAM. It is a phase
modulation technique that transmits two bits in four modulation states.
Phase of the carrier takes on one of four equally spaced values such as π/4, 3π/4, 5π/4 and7π/4.
Si(t) = √2E/T cos {2 πƒct + (2i – 1) π/4} , 0≤ t ≤T
0 , elsewhere
Where i = 1,2,3,4, & E= Tx signal energy per symbol
T= symbol duration
Each of the possible value of phase corresponds to a pair of bits called dibits.
Thus the gray encoded set of dibits: 10,00,01,11
Si (t) = √2E/Tcos [(2i – 1)π/4] cos (2πfct) - √2E/Tsin [(2i –1) π/4)] sin (2πfct) ,0≤ t ≤Tb
0 , else where
There are two orthononormal basis
functions c1 (t) = √2/T cos 2πƒct, 0≤ t ≤Tb
c2 (t) = √2/T sin 2πƒct, 0≤ t ≤Tb

Trichy Engineering College,


Konalai,Trichy
Page No:

Algorithm
Initialization commands
QPSK modulation
1. Generate quadrature carriers.
2. Start FOR loop
3. Generate binary data, message signal(bipolar form)
4. Multiply carrier 1 with odd bits of message signal and carrier 2 with even bits of message signal
5. Perform addition of odd and even modulated signals to get the QPSK modulated signal
6. Plot QPSK modulated signal.
7. End FOR loop.
8. Plot the binary data and carriers.

QPSK demodulation
1. Start FOR loop
2. Perform correlation of QPSK modulated signal with quadrature carriers to get two
decision variables x1 and x2.

3. Make decision on x1 and x2 and multiplex to get demodulated binary data.


Trichy Engineering College,
Konalai,Trichy
Page No:

If x1>0and x2>0, choose ‘11’. If x1>0and x2<0, choose ‘10’. If x1<0and x2>0, choose ‘01. If
x1<0and x2<0, choose ‘00’.
End FOR loop
Plot demodulated data

Program

% QPSK Modulation
clc;
clear all;
close all;
%GENERATE QUADRATURE CARRIER SIGNAL
Tb=1;t=0:(Tb/100):Tb;fc=1;
c1=sqrt(2/Tb)*cos(2*pi*fc*t);
c2=sqrt(2/Tb)*sin(2*pi*fc*t);
%generate message signal
N=8;m=rand(1,N);
t1=0;t2=Tb
for i=1:2:(N-1)
t=[t1:(Tb/100):t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
else
m(i)=0;
m_s=-1*ones(1,length(t));
end
%odd bits modulated signal
odd_sig(i,:)=c1.*m_s;
if m(i+1)>0.5 18
m_s=ones(1,length(t));
else
m(i+1)=0;
m_s=-1*ones(1,length(t));
end
%even bits modulated signal
even_sig(i,:)=c2.*m_s;
%qpsk signal
qpsk=odd_sig+even_sig;
%Plot the QPSK modulated signal
subplot(3,2,4);plot(t,qpsk(i,:));
title('QPSK signal');xlabel('t- - ->');ylabel('s(t)');grid on; hold on;
t1=t1+(Tb+.01); t2=t2+(Tb+.01);
end
hold off
%Plot the binary data bits and carrier signal
subplot(3,2,1);stem(m);
title('binary data bits');xlabel('n- - ->');ylabel('b(n)');grid on;
subplot(3,2,2);plot(t,c1);
title('carrier signal-1');xlabel('t- - ->');ylabel('c1(t)');grid on;
subplot(3,2,3);plot(t,c2);
Trichy Engineering College,
Konalai,Trichy
Page No:

title('carrier signal-2');xlabel('t- - ->');ylabel('c2(t)');grid on;

% QPSK Demodulation
t1=0;t2=Tb
for i=1:N-1
t=[t1:(Tb/100):t2]
%correlator
x1=sum(c1.*qpsk(i,:));
x2=sum(c2.*qpsk(i,:));
%decision device
if (x1>0&&x2>0)
demod(i)=1;
demod(i+1)=1;
elseif (x1>0&&x2<0)
demod(i)=1;
demod(i+1)=0;
elseif (x1<0&&x2<0)
demod(i)=0;
demod(i+1)=0;
elseif (x1<0&&x2>0)
demod(i)=0;
demod(i+1)=1;
end
t1=t1+(Tb+.01); t2=t2+(Tb+.01);
end
subplot(3,2,5);stem(demod);
title('qpsk demodulated bits');xlabel('n--- ->');ylabel('b(n)');grid on;

Trichy Engineering College,


Konalai,Trichy
Page No:

Trichy Engineering College,


Konalai,Trichy
Page No:

EX:NO: 11 QUADRATURE AMPLITUDE MODULATION


DATE:

Aim:
To generate the signal constellation for Quadrature amplitude modulation(QAM) signal using
MATLAB

Apparatus required:
Matlab7.1

Theory:
• QAM is a combination of ASK and PSK
– Two different signals sent simultaneously on the same carrier frequency
– M=4, 16, 32, 64, 128, 256
– As an example of QAM, 12 different phases are combined with two
different amplitudes
– Since only 4 phase angles have 2 different amplitudes, there are a total of 16
combinations
– With 16 signal combinations, each baud equals 4 bits of information (2 ^ 4 = 16)
– Combine ASK and PSK such that each signal corresponds to multiple bits
– More phases than amplitudes
– Minimum bandwidth requirement same as ASK or PSK

Trichy Engineering College,


Konalai,Trichy
Page No:

MATLAB: QAM

clc;clear all;
%create a random digital
message M=64; %alphabet size
x=randint(100e3,1,M);
%%
%use 16-QAM modulation to produce y
y=modulate(modem.qammod(M),x);
%%
%%transmit signal through an AWGN Channel
ynoisy=awgn(y,27,'measured');
%%
%Create scattet plot from noisy data
scatterplot(ynoisy),grid;
%%
%Demodulate ynoisy to recover the message.
z=demodulate(modem.qamdemod(M),ynoisy);
figure (2);
subplot(2,1,1);
stem(x(1:10),'filled'),grid;title('transmitted data')
subplot(2,1,2);
stem(z(1:10),'filled'),grid;title('received data');
%%
%Check symbole error rate.
[num ty]=symerr(x,z)

MODEL GRAPH:

Scatter plot

2
Quadra

-2

-4

-6

-8
-5 0 5
In-Phase

Trichy Engineering College,


Konalai,Trichy
Page No:

transmitted data
60

40

20

0
0 2 4 6 8 10

received data
60

40

20

0
0 2 4 6 8 10

RESULT:

Thus the signal constellation for Quadrature amplitude modulation(QAM) signal was generated
using MATLAB.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.NO:12 BER Simulation of DPSK modulation


DATE:

Aim: To simulate bit error rate performance of DPSK modulation using Matlab.

Apparatus required

Theory
DPSK involves 2 basic operations at the transmitter, differential encoding of the i/p binary wave and
phase shift keying, hence the name DPSK. To send symbol 0 we phase advance the current signal
waveform by 1800 and to send symbol 1 we leave the phase of the current signal unchanged. In the
differential encoding at the transmitter input starts with an arbitrary first bit serving as reference and
thereafter the sequence is generated using
dk-1' previous value of differentially encoded
digit. bk' i/p binary digit at time kTb.
dk-1 ,bk' logical inversion.

Assuming reference bit added to {dk} is a'1'. {dk} is thus generated and used to phase shift key a carrier
with phase angles 0 and ?.

BER -Bit Error Rate

In digital transmission, the number of bit errors is the number of received bits of a data stream over a
communication channel that have been altered due to noise, interference, distortion or bit
synchronization errors.The bit error rate or bit error ratio (BER) is the number of bit errors divided by
the total number of transferred bits during a studied time interval. BER is a unitless performance
measure, often expressed as a percentage.In a communication system, the receiver side BER may be
affected by transmission channel noise, interference, distortion, bit synchronization problems,
attenuation, wireless multipath fading, etc. The BER may be analyzed using stochastic computer
simulations. If a simple transmission channel model and data source model is assumed, the BER may
also be calculated using Binary symmetric channel (used in analysis of decoding error probability in
case of non-bursty bit errors on the transmission channel) and Additive white gaussian noise (AWGN)
channel without fading.

Trichy Engineering College,


Konalai,Trichy
Page No:

Algorithm
Initialization commands
1. Generate the input data randomly
2. Implement differential encoding
3. Do BPSK modulation
4. Add AWGN noise
5. Calculate the no of bits in error
6. Plot the BER graph

Program

N = 10^4 % number of bits or symbols


rand('state',100); % initializing the rand() function
randn('state',200); % initializing the randn() function
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
ipD = mod(filter(1,[1 -1],ip),2); % %differential encoding y[n]=y[n-1]+x[n]
s = 2*ipD-1; % BPSK modulation 0 -> -1; 1 -> 0
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
Eb_N0_dB = [-3:10]; % multiple Eb/N0 values
for ii = 1:length(Eb_N0_dB)
y = s + 10^(-Eb_N0_dB(ii)/20)*n; % additive white gaussian noise
ipDHat_coh = real(y) > 0; % coherent demodulation
ipHat_coh = mod(filter([1 -1],1,ipDHat_coh),2); %differential decoding
nErr_dbpsk_coh(ii) = size(find([ip - ipHat_coh]),2); % counting the number of errors
end
simBer_dbpsk_coh = nErr_dbpsk_coh/N;
theoryBer_dbpsk_coh = erfc(sqrt(10.^(Eb_N0_dB/10))).*(1 -.5*erfc(sqrt(10.^(Eb_N0_dB/10))));

close all
figure
semilogy(Eb_N0_dB,theoryBer_dbpsk_coh,'b.-');
hold on
semilogy(Eb_N0_dB,simBer_dbpsk_coh,'mx-');
axis([-2 10 10^-6 0.5])
grid on
legend('theory', 'simulation');
xlabel('Eb/No, dB')
ylabel('Bit Error Rate')
title('Bit error probability curve for coherent demodulation of DBPSK')

Trichy Engineering College,


Konalai,Trichy
Page No:

Bit error probability curve for coherent demodulation of DBPSK

theory
-1 simulation
10

-2
10

-3
Bit Error

10

-4
10

-5
10

-6
10
-2 0 2 4 6 8 10
Eb/No, dB

RESULT:

The Bit Error rate simulation of DPSK modulation was done using Matlab.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP.NO:13 EQUALIZATION –ZERO FORCING AND LMS ALGORITHMS


DATE:

AIM
To simulate and verify Zero forcing and LMS-Least Mean Square Equalization algorithms.

Apparatus required:
Matlab 7.1

THEORY:
In digital communications, its purpose is to reduce intersymbol interference to allow recovery of the
transmit symbols. It may be a simple linear filter or a complex algorithm. The following equalizer
types are commonly used in digital communications:

 Linear Equalizer: processes the incoming signal with a linear filter


o MMSE equalizer: designs the filter to minimize E[|e|2], where e is the error signal, which is
the filter output minus the transmitted signal.[1]
o Zero Forcing Equalizer: approximates the inverse of the channel with a linear filter.
 Decision Feedback Equalizer:
 Blind Equalizer:
 Adaptive Equalizer:
 Viterbi Equalizer:
 Turbo equalizer:
 Zero Forcing Equalizer refers to a form of linear equalization algorithm used in communication
systems which applies the inverse of the frequency response of the channel. The Zero-Forcing
Equalizer applies the inverse of the channel frequency response to the received signal, to restore the
signal after the channel.[1] It has many useful applications. The name Zero Forcing corresponds to
bringing down the intersymbol interference (ISI) to zero in a noise free case. This will be useful
when ISI is significant compared to noise. For a channel with frequency response F(f)the zero
forcing equalizer C(f)is constructed by C9f)=1/F(f). Thus the combination of channel and equalizer
gives a flat frequency response and linear phase F(f)C(f)=1.

Least-Mean-Square Algorithm:
Adaptation may be achieved
1. By observing the error b/w desired pulse shape and actual pulse shape
2. Using this error to estimate the direction in which the tap-weight should be changed
This second item is often the more limiting condition. These problems are addressed in the linear
MMSE equalizer by making a small modification to the denominator of C(f): C(f)=1/F(k)+1, where
k is related to the channel response and the signal SNR.

MATLAB CODE:
%Zero forcing equalizer.
T = 1; % Bit period
tau = 1; % Time constant of channel
dt = 0.01; % Sampling time in simulation N = 100;
% Number of bits to generate clear t1 t2 c
xy

Trichy Engineering College,


Konalai,Trichy
Page No:

% Create output pulse: rectangular pulse convolved with first-order


% low-pass filter impulse response.

t1 = (dt:dt:T)';
c(1:100,1) = 1 - exp(-t1/tau); t2 =
(T+dt:dt:T+5*tau)';
c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau); figure(1)
plot([t1; t2], c)
xlabel('Time (sec)')
ylabel('c(t)') title('Smeared pulse c(t)')

% Generate bit stream b =

rand(N,1);
z0 = find(b < 0.5);
z1 = find(b >= 0.5);
b(z0) = -1*ones(size(z0)); b(z1) =
+1*ones(size(z1));

% Create received signal with ISI nT = T/dt;


nc = length(c);
nx = N*nT;
x = zeros(nx, 1); for
n=1:N
i1 = (n-1)*nT;
y = [zeros(i1,1); b(n)*c; zeros(N*nT-i1-nc,1)]; x = x + y(1:nx);
end

% Plot eye diagram

figure(2)
t3 = dt:dt:2; plot(t3,
x(1:200)); hold on
for n=3:2:N
plot(t3, x((n-1)*nT+1:(n+1)*nT)); end
hold off xlabel('Time (sec)')
title('EYE DIAGRAM WITH NO EQUALIZATION')

% Compute number of bit errors xT =

x(nT:nT:nx);
dz0 = find(xT < 0); dz1 =
find(xT >= 0);

db = b;
db(dz0) = -1*ones(size(dz0)); db(dz1) =
+1*ones(size(dz1));

err = find(db ~= b);

Trichy Engineering College,


Konalai,Trichy
Page No:

fprintf('No equalizer: %d bits out of %d in error\n', length(err), N);

% Define length of zero-forcing equalizer Ne = 5*tau/T;

% Get samples of c(t) to solve for ZF equalizer weights

cT = c(nT:nT:nc);
csamp = [zeros(2*Ne,1); cT; zeros(2*Ne+1-length(cT),1)];

% Construct the matrix on the left side of ZF equalizer equation C = zeros(2*Ne+1,2*Ne+1);


for ne = 1:2*Ne+1
C(ne,:) = csamp(2*Ne+ne:-1:ne)'; end

% Right side of ZF equalizer weight equation r = [zeros(Ne,1); 1;

zeros(Ne,1)];

% Solve for ZF equalizer weights w = C \ r;

% Process the received signal with the ZF equalizer

nw = length(w);
z99 = [1; zeros(nT-1,1)];
hzf = kron(w, z99); % Impulse response of equalizer yall = conv(x, hzf); % Do
the equalization filtering y = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1);

% Eye diagram of equalized signal figure(3)


plot(t3, y(1:200));
hold on
for n=3:2:N
plot(t3, y((n-1)*nT+1:(n+1)*nT)); end
hold off xlabel('Time (sec)')
title('EYE DIAGRAM AFTER ZF EQUALIZER')

% Compute number of bit errors yT =

y(nT:nT:nx);
dz0 = find(yT < 0); dz1 =
find(yT >= 0);

db = b;
db(dz0) = -1*ones(size(dz0)); db(dz1) =
+1*ones(size(dz1));

Trichy Engineering College,


Konalai,Trichy
Page No:

err = find(db ~= b);

fprintf('ZF equalizer: %d bits out of %d in error\n', length(err), N);

%Adaptive equalizer based on LMS algorithm.


T = 1; % Bit period
tau = 3; % Time constant of channel
SNR = 100; % Ratio of signal power to noise power (NOT in dB)

dt = 0.01; % Sampling time in simulation


N = 250; % Number of training bits to generate Ndata = 100; %
Number of data bits to generate

clear t1 t2 c x y

% Create output pulse: rectangular pulse convolved with first-order


% low-pass filter impulse response.

t1 = (dt:dt:T)';
c(1:100,1) = 1 - exp(-t1/tau); t2 =
(T+dt:dt:T+5*tau)';
c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau);

% The following channel is different from RC LPF

% c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau).*(1+((t2-T-dt).^2)/20); figure(1)


plot([t1; t2], c)
xlabel('Time (sec)')
ylabel('c(t)') title('Smeared pulse c(t)')

% Generate bit stream b =

rand(N,1);
z0 = find(b < 0.5);
z1 = find(b >= 0.5);
b(z0) = -1*ones(size(z0)); b(z1) =
+1*ones(size(z1));

% Create received signal with ISI nT = T/dt;


nc = length(c); nx =
N*nT;
x = zeros(nx, 1); for
n=1:N
i1 = (n-1)*nT;
y = [zeros(i1,1); b(n)*c; zeros(N*nT-i1-nc,1)]; x = x + y(1:nx);
end

% Add noise of the specified level

Trichy Engineering College,


Konalai,Trichy
Page No:

sp = sum(x.*x)/length(x); % Signal power np = sp/SNR;


% Noise power
noise = sqrt(np) * randn(length(x),1);
x = x + noise;

% Plot eye diagram

figure(2)
t3 = dt:dt:2; plot(t3,
x(1:200)); hold on
for n=3:2:N
plot(t3, x((n-1)*nT+1:(n+1)*nT)); end
hold off xlabel('Time (sec)')
title('EYE DIAGRAM WITH NO EQUALIZATION')

% Define length of equalizer Ne =

5*tau/T;

% Get samples of c(t) to solve for ZF equalizer weights

cT = c(nT:nT:nc);
csamp = [zeros(2*Ne,1); cT; zeros(2*Ne+1-length(cT),1)];

% Construct the matrix on the left side of ZF equalizer equation C = zeros(2*Ne+1,2*Ne+1);


for ne = 1:2*Ne+1
C(ne,:) = csamp(2*Ne+ne:-1:ne)'; end

% Right side of ZF equalizer weight equation r = [zeros(Ne,1); 1;

zeros(Ne,1)];

% Solve for ZF equalizer weights wzf = C \ r;

Trichy Engineering College,


Konalai,Trichy
Page No:

MODEL GRAPH
Smeared pulse c(t)
0.35

0.3

0.25

0.2
c

0.15

0.1

0.05

0
0 2 4 6 8 10 12 14 16
Time (sec)

EYE DIAGRAM WITH NO EQUALIZATION


1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)

EYE DIAGRAM AFTER ZF EQUALIZER


1.5

0.5

-0.5

-1

-1.5
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)

Trichy Engineering College,


Konalai,Trichy
Page No:

MATLAB CODE: LMS ALGORITHM

%Adaptive equalizer based on LMS algorithm.

T = 1; % Bit period
tau = 3; % Time constant of channel
SNR = 100; % Ratio of signal power to noise power (NOT in dB)

dt = 0.01; % Sampling time in simulation


N = 250; % Number of training bits to generate Ndata = 100;
% Number of data bits to generate

clear t1 t2 c x y

% Create output pulse: rectangular pulse convolved with first-order


% low-pass filter impulse response.

t1 = (dt:dt:T)';
c(1:100,1) = 1 - exp(-t1/tau); t2 =
(T+dt:dt:T+5*tau)';
c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau);

% The following channel is different from RC LPF

% c(101:100+length(t2),1) = c(100)*exp(-(t2-T)/tau).*(1+((t2-T-dt).^2)/20); figure(1)


plot([t1; t2], c)
xlabel('Time (sec)')
ylabel('c(t)') title('Smeared pulse c(t)')

% Generate bit stream b =

rand(N,1);
z0 = find(b < 0.5);
z1 = find(b >= 0.5);
b(z0) = -1*ones(size(z0)); b(z1) =
+1*ones(size(z1));

% Create received signal with ISI nT = T/dt;


nc = length(c); nx =
N*nT;
x = zeros(nx, 1); for
n=1:N
i1 = (n-1)*nT;
y = [zeros(i1,1); b(n)*c; zeros(N*nT-i1-nc,1)]; x = x + y(1:nx);
end

% Add noise of the specified level

Trichy Engineering College,


Konalai,Trichy
Page No:

sp = sum(x.*x)/length(x); % Signal power np = sp/SNR;


% Noise power
noise = sqrt(np) * randn(length(x),1);
x = x + noise;

% Plot eye diagram

figure(2)
t3 = dt:dt:2; plot(t3,
x(1:200)); hold on
for n=3:2:N
plot(t3, x((n-1)*nT+1:(n+1)*nT)); end
hold off xlabel('Time (sec)')
title('EYE DIAGRAM WITH NO EQUALIZATION')

% Define length of equalizer Ne =

5*tau/T;

% Get samples of c(t) to solve for ZF equalizer weights

cT = c(nT:nT:nc);
csamp = [zeros(2*Ne,1); cT; zeros(2*Ne+1-length(cT),1)];

% Construct the matrix on the left side of ZF equalizer equation C = zeros(2*Ne+1,2*Ne+1);


for ne = 1:2*Ne+1
C(ne,:) = csamp(2*Ne+ne:-1:ne)'; end

% Right side of ZF equalizer weight equation r = [zeros(Ne,1); 1;

zeros(Ne,1)];

% Solve for ZF equalizer weights

wzf = C \ r;
% LMS algorithm to estimate the equalizer weights in real-time
% using the training data

mu = 0.2;
xT = x(nT:nT:nx);
w = zeros(2*Ne+1,1); % Initialize weights to zero wold = w;
wrec = w;
for k=(Ne+1):(N-Ne)
xk = xT((k+Ne):-1:(k-Ne));
yk = w'*xk;
ek = b(k) - yk;
w = wold + mu*ek*xk; wrec
= [wrec, w]; wold = w;
end

Trichy Engineering College,


Konalai,Trichy
Page No:

% Process the received signal with the LMS equalizer

nw = length(w);
z99 = [1; zeros(nT-1,1)];
hzf = kron(wzf, z99); % Impulse response of ZF equalizer yall = conv(x,
hzf); % Do the equalization filtering yzf =
yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1);

h = kron(w, z99); % Impulse response of LMS equalizer yall =


conv(x, h); % Do the equalization filtering
y = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1);

% Eye diagrams of equalized signal figure(3)


plot(t3, yzf(1:200)); hold on
for n=3:2:N
plot(t3, yzf((n-1)*nT+1:(n+1)*nT)); end
hold off xlabel('Time (sec)')
title('EYE DIAGRAM AFTER ZF EQUALIZER')

figure(4)
plot(t3, y(1:200)); hold on
for n=3:2:N
plot(t3, y((n-1)*nT+1:(n+1)*nT)); end
hold off xlabel('Time (sec)')
title('EYE DIAGRAM AFTER LMS EQUALIZER')

figure(5)
plot(wrec')
xlabel('TRAINING SAMPLE NUMBER')
ylabel('WEIGHT VALUE')
title('EVOLUTION OF LMS EQUALIZER WEIGHTS')

% Now that training is over, do data transmission.

% Generate bit stream

b = rand(Ndata,1); z0 =
find(b < 0.5); z1 = find(b >=
0.5);
b(z0) = -1*ones(size(z0)); b(z1) =
+1*ones(size(z1));

% Create received signal with ISI nx =

Ndata*nT;
x = zeros(nx, 1);
for n=1:Ndata
i1 = (n-1)*nT;
y = [zeros(i1,1); b(n)*c; zeros(Ndata*nT-i1-nc,1)];

Trichy Engineering College,


Konalai,Trichy
Page No:

x = x + y(1:nx); end

% Add noise of the specified level

noise = sqrt(np) * randn(length(x),1); x = x + noise;

% Perform equalization

yall = conv(x, hzf); % ZF


yzf = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1);

yall = conv(x, h); % Wiener


y = yall((Ne*nT+1):(length(yall)-(Ne+1)*nT)+1);

% Compute number of bit errors xT =

x(nT:nT:nx);
dz0 = find(xT < 0);
dz1 = find(xT >= 0);

db = b;
db(dz0) = -1*ones(size(dz0)); db(dz1) =
+1*ones(size(dz1));

err = find(db ~= b);

fprintf('No equalizer: %d bits out of %d in error\n', length(err), N); yT = yzf(nT:nT:nx);


dz0 = find(yT < 0); dz1 =
find(yT >= 0);

db = b;
db(dz0) = -1*ones(size(dz0)); db(dz1) =
+1*ones(size(dz1)); err = find(db ~= b);
fprintf('ZF equalizer: %d bits out of %d in error\n', length(err), Ndata);

yT = y(nT:nT:nx); dz0 =
find(yT < 0); dz1 = find(yT
>= 0);

db = b;
db(dz0) = -1*ones(size(dz0)); db(dz1) =
+1*ones(size(dz1));

err = find(db ~= b);

fprintf('LMS equalizer: %d bits out of %d in error', length(err), Ndata); fprintf(' (with %d training bits)\n',
N);

MODEL GRAPH

Trichy Engineering College,


Konalai,Trichy
Page No:

Smeared pulse c(t)


0.35

0.3

0.25

0.2
c

0.15

0.1

0.05

0
0 2 4 6 8 10 12 14 16
Time (sec)

EYE DIAGRAM WITH NO EQUALIZATION


1

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)

Trichy Engineering College,


Konalai,Trichy
Page No:

EYE DIAGRAM AFTER ZF EQUALIZER


2

1.5

0.5

-0.5

-1

-1.5

-2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)

EYE DIAGRAM AFTER LMS EQUALIZER


2

1.5

0.5

-0.5

-1

-1.5
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)

Trichy Engineering College,


Konalai,Trichy
Page No:

EVOLUTION OF LMS EQUALIZER WEIGHTS


4

1
WEIGHT

-1

-2

-3
0 50 100 150 200 250
TRAINING SAMPLE NUMBER

RESULT:

Thus the Zero forcing and LMS equalization algorithms are verified successfully.

Trichy Engineering College,


Konalai,Trichy
Page No:

EXP NO.14 . SIMULATION OF ERROR CONTROL USING


CYCLICCODE DATE:

AIM:
a. To generate parity check matrix & generator matrix for a (7,4) Hamming code.
b. To generate parity check matrix given generator polynomial g(x) = 1+x+x3.
c. To determine the code vectors.
d. To perform syndrome decoding

PROGRAM:

Generation of parity check matrix and generator matrix for a (7, 4) Hamming code.

[h,g,n,k] = hammgen(3);
Generation of parity check matrix for the generator polynomial g(x) = 1+x+x3.

h1 = hammgen(3,[1011]);
Computation of code vectors for a cyclic code
clc;
close all;
n=7;
k=4;
msg=[1 0 0 1; 1 0 1 0; 1 0 1 1];
code = encode(msg,n,k,'cyclic');

msg code Syndrome decoding


clc;
close all;
q=3;
n=2^q-1;
k=n-q;
parmat = hammgen(q); % produce parity-check matrix
trt = syndtable(parmat); % produce decoding table
recd = [1 0 1 1 1 1 0 ] %received vector
syndrome = rem(recd * parmat',2);
syndrome_de = bi2de(syndrome, 'left-msb'); %convert to decimal
disp(['Syndrome = ',num2str(syndrome_de),.....
' (decimal), ',num2str(syndrome),' (binary) ']); corrvect = trt(1+syndrome_de, :);%correction vector
correctedcode= rem(corrvect+recd,2);
parmat
corrvect
correctedcode

Trichy Engineering College,


Konalai,Trichy
Page No:

RESULT: Thus encoding and decoding of block codes are performed using MATLAB.

Trichy Engineering College,


Konalai,Trichy

You might also like