You are on page 1of 37

Communication Systems Lab Manual

Department of Electronics, PAACET 1



















Part A:
Hardware Experiments



























Communication Systems Lab Manual


Department of Electronics, PAACET 2
Experiment No. 1
Pulse Code Modulation (PCM)


Aim: To design and set up a pulse code modulator.

Components and equipments required: Op-amps, ICs 4016, 7408, 7404, 311, 741, 7493, resistors,
signal generator, DC source, bread board and CRO.

Theory:
In the PCM circuit the input analog signal is regularly sampled at uniform intervals and
quantized rst and each quantized level is represented by a code number. It has excellent advantages
compared to PAM and PWM. The PCM circuit gives the binary code corresponding to the input
samples.
The sampling of the input analog signal is done by the PAM circuit. Clock frequency is
selected satisfying sampling theorem. DAC output and sampled output are compared by 311 IC. As
long as the sampled output is high, comparator output remains high and the counting progresses.
PCM is used in digital telephone systems and for digital audio in computers. Two limitations
of PCM are aliasing error and quantization error.

Procedure:
1. Verify the conditions of ICs and other discrete components and setup the circuit.
2. Observe the PCM output on the CRO screen.
Design:

Design of non-inverter circuit:
Let Gain = 1 + R
f
/R
i
= 2, so that the ratio R
f
/R
i
= 1, Take R
f
and R
i
= 22 k.
Design of DAC circuit:
Take R= 10 k, 2R= 22 k





Communication Systems Lab Manual


Department of Electronics, PAACET 3
Circuit Diagram:







Waveforms:


Result:
Designed and set up a pulse code modulator. Waveforms are also plotted.




Communication Systems Lab Manual


Department of Electronics, PAACET 4
Experiment No. 2
Delta Modulation


Aim: To design, set up and study a delta modulator circuit.
Components and equipments required: Op-amps, 7474 IC, resistors. capacitors, signal generator,
DC supplies, bread board and CRO.
Theory:
Delta modulation (DM) is a differential PCM scheme in which the difference signal is
encoded into a single bit. This single bit is transmitted per sample to indicate whether the signal is
larger or smaller than the previous sample. Circuit for delta modulation is shown in gure. The
modulating signal m(t) and its quantized approximation
_____
) (t m are applied to the comparator.
Comparator provides a high level output when m(t) >
_____
) (t m and it provides low level output when
m(t) <
_____
) (t m .
The LM 311 chip is used in the circuit as the comparator. The output of the comparator is fed
to a sample and hold circuit made by a D ip op. The clock frequency to ip flop is selected at the
sampling rate. Pulses at the output of D ip flop are made bipolar by an op-amp comparator. Bipolar
pulses are converted to analog signal before feeding to the comparator using a RC low pass filter.

Procedure:
1. Verify the conditions of ICs and other discrete components.
2. Set up the circuit. Feed an input signal of 5 V, 200 Hz sine wave to the input. Set the
clock frequency at 2 kHz.
3. Observe the DM output and Vo simultaneously on the CRO screen.
Design:
Let the input signal amplitude = 5 V and frequency = 200 Hz i.e.., m(t) = 5 sin 400t
Maximum slope of m(t) = 2fA = 2200x5
To avoid slope over load error, slope of
_____
) (t m should be more than that of m(t).
V
CC
/RC > E
m

m
V
CC
/RC >

2fA = 2200x5
Selecting V
cc
= 15 V and C = 0.01 F, we get R < 228 k. Take R = 1 k.

Threshold voltage V
T
= V
R2
= 1.35 V
R2 + R1
R2 Vcc
= l.35 V Take R
2
= l k. Then R
1
= 10k.
Let the clock frequency be 2 kHz.
Communication Systems Lab Manual


Department of Electronics, PAACET 5
Circuit Diagram:




Waveforms:







Result:
Designed and set up a Delta modulator. Waveforms are also plotted.




Communication Systems Lab Manual


Department of Electronics, PAACET 6
Experiment No. 3
Binary Amplitude Shift Keying (BASK) and Demodulator


Aim: To design and set up an Amplitude Shift Keying (ASK) generator and demodulator.

Components and equipments required: DC sources, CRO, bread board, signal generator, op-amp,
transistor, capacitors, potentiometer and resistors.

Theory:
The modulation process of switching the amplitude, frequency or phase of the carrier in
accordance with the message data are called Amplitude Shift Keying, Frequency Shift Keying and
Phase Shift Keying respectively. In ASK system the carrier frequency is switched between two preset
amplitudes according to the binary input. When the input is at logic 1, a finite number of cycles of a
sinusoidal signal are granted and when the input is at logic 0, same numbers of cycles of sinusoidal
signal having different amplitude are generated.
Referring the circuit diagram, the two switches in the analog multiplexer IC 4016 are used to
multiplex two signals. Input to one of the switches is a sinusoidal signal with peak amplitude 5 V.
This signal is applied to a voltage divider circuit. The resistors are chosen such that V
out
= V
in
.
Choose R
1
= R
2
= 1k and amplitude is reduced by half (2.5 V). When the modulating signal is at
logic 1, 5 Vpp sine wave appears at the output and when the modulating signal is at logic 0, 2.5 Vpp
sine wave appears at the output.
Demodulator can be set up by an envelope detector and a comparator. Comparator gives
either high or low output according to the amplitude of the signal at the inverting terminal. The
circuit consists of diode and RC network that picks the amplitude variations and 324 op-amp
functions as a comparator. Capacitor charges to the positive peaks of sine wave half cycle through
diode and discharges through R. Before discharging fully, next peak appears and capacitor charges
further the obtained low frequency signal is converted to a square wave by the comparator.
Potentiometer is used to adjust the reference voltage. BASK is susceptible to noise because it does
not have constant amplitudes.

Procedure:

1. Set up the circuit part by part and verify the functions.
Communication Systems Lab Manual


Department of Electronics, PAACET 7
2. Join both the circuits and feed a square wave of low frequency at the input and observe the
ASK output on CRO.
3. Set up the demodulator circuit and feed the ASK signal to its input and observe demodulated
output.
Design:
Voltage divider Network:

Vout =
2 1
2 *
R R
R Vin
+
, Take R1 = R2 = 1 k

Therefore, Vout = Vin

Transistor as a NOT gate:

Select BC107 transistor, its hfe = 100, Ic= 2 mA

R
C
= V
CC
- V
CEsat
/ I
C
= (5 0.3) / 2mA = 2.35 k, Take R
C
= 1 k
Base current Ib should be greater than Ic/hfe to function as a NOT gate.
Take I
B
= 10* Ic/hfe = 0.2 mA

R
B
= V
in
V
BEsat
/ I
B
= (5 0.6) / 0.2mA = 22 k, Take R
B
= 10 k

Circuit Diagram:

ASK Modulator


Communication Systems Lab Manual


Department of Electronics, PAACET 8
ASK Demodulator








Waveforms:




Result:
Designed and set up a BASK modulator and demodulator. Waveforms are also plotted.


Communication Systems Lab Manual


Department of Electronics, PAACET 9
Experiment No. 4
Binary Frequency Shift Keying (BFSK)


Aim: To design and set up a Binary Frequency Shift Keying (BFSK) generator.

Components and equipments required: DC sources, CRO, bread board, signal generators and
resistors.

Theory:
In BFSK system the carrier frequency is switched in between two preset frequencies
according to the binary input. The frequencies corresponding to logic 1 and logic 0 states are called
mark and space frequencies.
CD 4016 is a quad bilateral switch. The modulating signal input is fed to one control pin of
4016 and the inverted input is fed to the control pin of the other 4016. Two sinusoidal signals having
two different frequencies are fed to the inputs of the two switches of 4016. The outputs of the two
bilateral switches are joined and the FSK output is taken.

Procedure:
1. Set up the circuit after testing the components.
2. Feed two different frequency sine waves at the input and verify the output.
Design:

Transistor as a NOT gate:

Select BC107 transistor, its hfe = 100, Ic= 2 mA

R
C
= V
CC
- V
CEsat
/ I
C
= (5 0.3) / 2mA = 2.35 k, Take R
C
= 1 k
Base current Ib should be greater than Ic/hfe to function as a NOT gate.
Take I
B
= 10* Ic/hfe = 0.2 mA

R
B
= V
in
V
BEsat
/ I
B
= (5 0.6) / 0.2mA = 22 k, Take R
B
= 10 k







Communication Systems Lab Manual


Department of Electronics, PAACET 10
Circuit Diagram:

Waveforms:




Result:
Designed and set up a BFSK modulator. Waveforms are also plotted.









Communication Systems Lab Manual


Department of Electronics, PAACET 11
Experiment No. 5
Binary Phase Shift Keying (BPSK)


Aim: To set up a Binary Phase Shift Keying (BPSK) circuit.

Components and equipments required: ICs 4016, 7404, 741, bread board and resistors.

Theory:
In the BPSK modulation system phase of the carrier wave is inverted according to logic level
of the input data. When the modulating input is at logic 1 level, the sinusoid has one xed phase and
when the modulating input is at the other level, the phase of the sinusoid changes.
Two switches inside the quad analog switch CD 4016 are used in the circuit. Op-amp
functioning as an inverting amplifier and having unity gain is used to invert the phase of the input
sine wave by 180
o
. Sine wave can be obtained either from function generator or using a wien bridge
oscillator using op-amp.
BFSK has constant amplitude as in the case of BFSK signal. Therefore the noise can be
removed easily.
Procedure:
1. Set up the circuit as shown in gure.
2. Feed the sine wave and clock from the function generator.
3. Keep the clock frequency lower than the sine wave frequency and observe the output.
Design:
Op-amp circuit functions as an inverting amplier with gain 1
Gain = R
F
/R
i
= 1
Take R
F
and R
i
4.7k each.
Transistor as a NOT gate:

Select BC107 transistor, its hfe = 100, Ic= 2 mA

R
C
= V
CC
- V
CEsat
/ I
C
= (5 0.3) / 2mA = 2.35 k, Take R
C
= 1 k
Base current Ib should be greater than Ic/hfe to function as a NOT gate.
Take I
B
= 10* Ic/hfe = 0.2 mA

R
B
= V
in
V
BEsat
/ I
B
= (5 0.6) / 0.2mA = 22 k, Take R
B
= 10 k

Communication Systems Lab Manual


Department of Electronics, PAACET 12
Circuit Diagram:

Waveforms:






Result:
Designed and set up a BPSK modulator and demodulator. Waveforms are also plotted.













Communication Systems Lab Manual


Department of Electronics, PAACET 13
Experiment No. 6
Error Checking and Correcting Codes


Aim: To design and set up a non-systematic Hamming code generator to encode and detect error in a
4 bit message word.

Components and equipments required: ICs 7486, 7404, 7442, trainer kit and LEDs.

Theory:
Various types of equipments used in computer systems such as key boards, printers, magnetic
storage devices, video terminals transmit and receive data in the form of codes.
Hamming code is one of the block codes. In this system one error can be detected and
corrected. In linear block code n is the number of bits in the coded word, k is the number of bits in
uncoded word and r = n - k is the number of parity bits. The relation between the n, r, M and k are as
given below.
The number of bits in the coded word is n = 2
r
1.
The number of valid uncoded words are M = 2
k

A nonsystematic code can be constructed by placing the parity check bits at positions, 2i
where i = 0, 1,2,..r-1 of the code word. Thus the code word structure is P1 P2 M1 P3 M2 M3 M4
where P1, P2 and P3 are parity bits and M1, M2, M3 and M4 are message bits.
Construction of the error correcting code:
1. Write the BCD of length (n - k) = r for decimal numbers from 1 to n.
2. Arrange the sequences in bit-reverse order in matrix form.
3. Transpose the matrix in step no.2 to get the H matrix.

Procedure:

1. Set up the encoder
2. Take any one of the valid 16 code words.
3. Feed 7 bit code word to the syndrome block. LED will not glow indicating no error since S
will be [0 0 0].
Communication Systems Lab Manual


Department of Electronics, PAACET 14
4. Introduce an error in any position in the received code word and observe the LED glow indi-
cating the position of error.
5. Repeat the step no. 4 by introducing one error at a time at other positions in the code word.
Design:

Take n=7, k=4 and r=n-k= 3.
Step 1: Write BCD of length 3 for numbers 1 to 7.
(
(
(
(
(
(
(
(
(

111
110
101
100
011
010
001

Step 2: Reversing the bits we get,
(
(
(
(
(
(
(
(
(

111
011
101
001
110
010
100

Step 3: Take transpose of the above matrix to get H matrix.

(
(
(

0001111
0110011
1010101


Code Words [T] are selected such that TH
T
= 0.
i.e., [P
1
P
2
M
1
P
3
M
2
M
3
M
4
]
(
(
(
(
(
(
(
(
(

111
011
101
001
110
010
100
= 0

This gives, P
1
M
1
M
2
M
4
= 0
P
2
M
1
M
3
M
4
= 0
P
3
M
2
M
3
M
4
= 0
Communication Systems Lab Manual


Department of Electronics, PAACET 15
or,
P
1
= M
1
M
2
M
4

P
2
= M
1
M
3
M
4

P
3
= M
2
M
3
M
4

Step 4: Realize the equations using EXOR gates.

Decoding
The Syndrome used to detect the error = [S] = RH
T
where S is of length n - k.
i.e., S
1
S
2
S
3
,
Let [R] be the received word = [r
1
r
2
r
3
r
4
r
5
r
6
r
7
] where r
i
= 0 or 1.

S = [ S
1
S
2
S
3
] = RH
T
= [r
1
r
2
r
3
r
4
r
5
r
6
r
7
]
(
(
(
(
(
(
(
(
(

111
011
101
001
110
010
100

i.e., S
1
= r
1
+ r
3
+ r
5
+ r
7
,
S
2
= r
2
+ r
3
+ r
6
+ r
7
,
S
3
= r
4
+ r
5
+ r
6
+ r
7
,

Realize the circuit using EXOR gates.

In this type of construction, the syndrome obtained directly indicates the position of error. Only
single error pattern can be corrected using Hamming code. [S
1
S
2
S
3
] can express seven single error
pattern and one pattern for no error (all zeros).

S = RH
T
= (T + E) H
T
= TH
T
+ EH
T
= EH
T
since TH
T
= 0.

If the rst position is in error, then E = [1 0 0 0 0 0 0].
Then using H matrix, we get, S = [S
1
S
2
S
3
] = [1 0 0]
then S
3
S
2
S
1
= 0 0 1 = decimal 1.
If second position is in error, then E = [0 1 0 0 0 0 0] and using H matrix, we get, S = [S
1
S
2
S
3
] = [0
1 0] then S
3
S
2
S
1
= 010 = decimal 2.
If third position is in error, then E = [0 0 1 0 0 0 0] and using H matrix, we get, S = [S
1
S
2
S
3
] =
[1 1 0 ] then S
3
S
2
S
1
= 0 1 1 = decimal 3 and so on.
So, [S
3
S
2
S
1
] gives the BCD equivalent of the decimal number indicating the position of error.
Decoding part can be connected separately from encoding.
Communication Systems Lab Manual


Department of Electronics, PAACET 16
Circuit Diagram:
Encoder



Decoder and error detector









Communication Systems Lab Manual


Department of Electronics, PAACET 17
Observations:

Encoder:

Message Bits Code Word
M1 M2 M3 M4 P1 P2 M1 P3 M2 M3 M4
0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 0 1 0 0 1
0 0 1 0 0 1 0 1 0 1 0
0 0 1 1 1 0 0 0 0 1 1
0 1 0 0 1 0 0 1 1 0 0
0 1 0 1 0 1 0 0 1 0 1
0 1 1 0 1 1 0 0 1 1 0
0 1 1 1 0 0 0 1 1 1 1
1 0 0 0 1 1 1 0 0 0 0
1 0 0 1 0 0 1 1 0 0 1
1 0 1 0 1 0 1 1 0 1 0
1 0 1 1 0 1 1 0 0 1 1
1 1 0 0 0 1 1 1 1 0 0
1 1 0 1 1 0 1 0 1 0 1
1 1 1 0 0 0 1 0 1 1 0
1 1 1 1 1 1 1 1 1 1 1

Error Detector:

Received Code Word Syndrome
r7 r6 r5 r4 r3 r2 r1 S2 S1 S0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 1
0 0 0 0 0 1 0 0 1 0
0 0 0 0 1 0 0 0 1 1
0 0 0 1 0 0 0 1 0 0
0 0 1 0 0 0 0 1 0 1
0 1 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 1 1 1


Result:
Designed and set up a non-systematic Hamming code generator to encode and detect error in
a 4 bit message word.
Communication Systems Lab Manual


Department of Electronics, PAACET 18
Experiment No. 7
4 Channel Digital Multiplexing
(using PRBS signal and digital multiplexer)

Aim: To study 4 channel digital multiplexing using PRBS generator and 74153 digital MUX.

Components and equipments required: ICs 7495, 74153, 7486, 7404, digital trainer kit, and bread-
board.

Theory:

Pseudo Random Binary Sequences are generated using a linear feedback shift register. A
LFSR is a shift register whose input bit is a linear function of its previous state. The only linear
functions of single bits are XOR and XNOR. Thus it is a shift register whose input bit is drive by the
XOR of some bits of the shift register output.
The initial value of LFSR is called the seed and because the operation of the register is
deterministic the sequence of values produced by the register is completely determined by its current
value. Likewise, because the register has a finite number of possible states, cycle will repeat.
However, an LFSR with a well-chosen feedback function can provide sequence of bits which appears
random as well as having a very long cycle. If the register size is n stages, maximum length of the
sequence will be 2
n
-1. The sequence repeats after every 2
n
-1 clock pulses. PRBS output is available
at any output.
The PRBS output and its inverted form are given as two inputs to a 4:1 MUX. The other two
inputs are tied to V
cc
and GND. According to the select lines, one of the input appears at output.

Procedure:

1. Set up circuit on the bread board. Apply 1 kHz clock pulses and observe the PRBS
output from Q0 output. The PRBS repeats after every 15
th
clock cycle.
2. Set up the circuit using 7495 and 74153. Apply clock pulses and observe the output.
3. Give the PRBS output and its inverted form are given as inputs to a 4:1 MUX.
4. The other two inputs are given Vcc and GND.
5. Observe MUX output for various combinations of select lines.







Communication Systems Lab Manual


Department of Electronics, PAACET 19
Circuit Diagram:

Observation:

PRBS Output:

MUX Truth Table:

Select Lines Output
S1 S0 V
0

0 0
0 1
1 0
1 1


Result:
Studied 4 channel digital multiplexing using PRBS generator and 74153 digital MUX.
Communication Systems Lab Manual


Department of Electronics, PAACET 20















Part B:
Matlab Experiments



























Communication Systems Lab Manual


Department of Electronics, PAACET 21
Experiment No. 1
Implementation of LMS Algorithm

Aim: To study the implementation of LMS algorithm for adaptive equalization.

Platform Used: Matlab

Theory:
Least mean squares (LMS) algorithms are a class of adaptive filter used to mimic a desired
filter by finding the filter coefficients that relate to producing the least mean squares of the error
signal (difference between the desired and the actual signal). It is a stochastic gradient descent
method in that the filter is only adapted based on the error at the current time.

The LMS algorithm changes (adapts) the filter tap weights so that e(n) is minimized in the
mean-square sense. When the processes x(n) & d(n) are jointly stationary, this algorithm converges
to a set of tap-weights which, on average, are equal to the Wiener-Hopf solution. The LMS algorithm
is a practical scheme for realizing Wiener filters, without explicitly solving the Wiener-Hopf
equation. Features of LMS algorithm are simplicity in implementation and stable and robust
performance against different signal conditions. Drawback is its slow convergence due to eigenvalue
spread.
The output y(n) of the adaptive equalizer in response to the input sequence x(n) is given as,
y(n) =

=

N
k
k n x wk
0
) ( .
where wk is the weight of kth tap and (N+1) is the total number of taps. This is shown in figure
below,
Communication Systems Lab Manual


Department of Electronics, PAACET 22

The adaptation may be achieved by observing the error between the desired pulse shape and
actual pulse shape at the filter output, measured at the sampling instants and then using this error to
estimate the direction in which the weights of the filter should be changed so as to approach the
optimum set of values.
Let e(n) denotes the error signal, then
e(n) = d(n) - y(n)
Where d(n) is the desired response and y(n) is the output response. In LMS algorithm e(n)
activates the adjustment applied to the weights, as the algorithm proceeds from one iteration to
another.
In words LMS algorithm is expressed as,
( )
|
|
.
|

\
|
+
|
|
.
|

\
|
=
|
|
.
|

\
|
signal kth tap to
applied signal Input
* parameter size Step
weight kth tap
of value Old
weight kth tap of
value Updated

i.e, w
k
(n+1) = w
k
(n) + * x(n-k) * e(n)
where, k = 0,1,2,.N and N is the number of iterations.
Steps:
1. Initialise the algorithm by setting w(1) = 0, i.e, set all the tap weights of equalizer to zero at
n=1.
2. For n = 1,2,. compute y(n) = x
T
(n) * w(n) ;
e(n) = d(n) y(n) ;
w(n+1) = w(n) + * x(n) * e(n) , where is step size parameter.
3. Continue the iterative computation until the equalizer reaches a steady state by which we
mean that the actual mean square of the equalizer essentially reaches a constant value.
Communication Systems Lab Manual


Department of Electronics, PAACET 23
Program:

%%%% LEAST MEAN SQUARE ALGORITHM %%%%

clc;
clear all;
close all;

sysorder = input('Enter the System Order ');
N = input('Enter the number of iterations ');
x = randn(N,1); % Input to the filter
b = fir1(sysorder-1,0.5); % FIR system to be identified
n = 0.1*randn(N,1); % Uncorrelated noise signal
d = filter(b,1,x) + n;
% Desired signal = Output of FIR filter + Uncorrelated noise signal
w = zeros(sysorder,1); % Initially filter weights are zeros

for n = sysorder:N
u = x(n:-1:n-sysorder+1);
y(n) = w' * u; % Output of Adaptive filter
e(n) = d(n) - y(n);
% Error signal = Desired signal - Adaptive filter output
mu = 0.008;
w = w + mu*u*e(n); % Updating new filter weights
end

hold on
plot(d,'g')
plot(y,'r')
semilogy((abs(e)),'m');
title('System Output');
xlabel('Samples');
ylabel('True and Estimated Outputs');
legend('Desired','Output','Error');
axis([0 N -2 2.5])

figure
plot(b,'k+');
hold on
plot(w,'r*')
legend('Actual Weights','Estimated Weights');
title('Comparison of Actual weights and Estimated weights');


Observations:
Enter the System Order 5
Enter the number of iterations 100





Communication Systems Lab Manual


Department of Electronics, PAACET 24
Waveforms:



Result:
LMS algorithm for adaptive equalization was implemented and studied.
Communication Systems Lab Manual


Department of Electronics, PAACET 25
Experiment No. 2
Time Delay Estimation using Correlation Function

Aim: To implement a matlab program for estimating time delay using correlation function

Platform Used: Matlab

Theory:

A pulse x(t) is transmitted, the reflected signal from an object is returned to the receiver. The
returned signal s(t) is delayed (say, D seconds), noisy and attenuated. The objective is to measure
(estimate) the time delay between the transmitted and the returned signal.
Analysis

Let the transmitted signal be x(t), then the returned signal r(t) may be modeled as,
r(t) = o . x(t-D) + w(t)
where, w(t) is assumed to be the additive noise during transmission.
o is the attenuation factor (<1).
D is the delay which is the time taken for the signal to travel from the transmitter to the target and
back to the receiver.
A common method of estimating the time delay D is to compute the cross correlation
function of the received signal with the transmitted signal x(t) i.e,
Rrx = E {r(t)x(t+t)}
= E {[o x(t-D) + w(t)][ x(t+t)}]}
= E {o x(t-D) x(t+t)+ w(t) x(t+t)}]}
Hence, Rrx (t) = o Rxx (t-D) + Rwx (t) , where E is the expectation operation.
Therefore the cross correlation Rrx (t) is equal to the sum of the scaled autocorrelation
function of the transmitted signal (i.e, o Rxx (t)) and the cross correlation function between x(t) and
contaminated noise signal w(t). If we now assume that the noise signal w(t) and transmitted signal
x(t) are uncorrelated then,
Rwx (t) = 0
Hence the cross correlation function between the transmitted signal and the received signal
may be written as:
Rrx (t) = o Rxx (t-D)
Therefore if we plot Rrx (t), it will only have one peak value that will occur at t = D.
Communication Systems Lab Manual


Department of Electronics, PAACET 26
Procedure:

1. Generate a single pulse for transmitted signal as shown below.

2. Delay the signal by, say 32 samples, and reduce its amplitude by an attenuation factor of, say
o = 0.8. This is xd(n) as shown below.

3. Generate N=256 samples of Gaussian random signal and this is w(n).
4. Generate the simulated received signal by adding transmitted signal x(n) and noise signal
w(n), i.e,
r(n) = o x(n-D) + sigman. w(n)
where sigman is the noise amplitude (initially set this to 1).
5. Using subplots, plot these signals x(n), xd(n) and r(n) in a single figure. Label and grid each
plot accordingly.
6. Estimate the cross correlation sequence R
rx
(n) and plot this in another figure.
7. From this plot estimate the delay.
















Communication Systems Lab Manual


Department of Electronics, PAACET 27
Program:

%%%% TIME DELAY ESTIMATION USING CORRELATION FUNCTION %%%%

% Delay a signal pulse of pulse width 4 by 32 and add gaussian noise
% Assume total samples as 256
clc;
clear all;
close all;

x = 5*[ones(1,4) zeros(1,252)]; % Signal pulse of width 4, total samples
256
subplot(311)
plot(x)
grid
title('Original Input');

alpha = 0.8; % attenuation factor
xd = 5*alpha*[zeros(1,32) ones(1,4) zeros(1,220)]; % Attenuated delayed
pulse, delay of 32
subplot(312)
plot(xd)
grid
title('Delayed attenuated Input Signal');

w = randn(1,256); % Gaussian noise signal
rcv = xd+w; % Received signal = Delayed attenuated signal + Gaussian
noise signal
subplot(313)
plot(rcv)
grid
title('Received Signal');

[y lags]= xcorr(rcv,x); % Evaluating the Cross correlation
% Maximum peak pulse occurs at 32
L = length(y);
figure
stem(lags(L/2:end),y(L/2:end));
grid
title('Cross Correlation Plot');













Communication Systems Lab Manual


Department of Electronics, PAACET 28
Waveforms:
0 50 100 150 200 250 300
0
5
Original Input
0 50 100 150 200 250 300
0
2
4
Delayed attenuated Input Signal
0 50 100 150 200 250 300
-10
0
10
Received Signal


0 50 100 150 200 250 300
-40
-20
0
20
40
60
80
100
Cross Correlation Plot

Result:
Estimated the time delay using cross correlation function.
Communication Systems Lab Manual


Department of Electronics, PAACET 29
Experiment No. 3
Study of Eye Diagram of PAM Transmission System

Aim: To study the eye diagram of a PAM transmission system.

Platform Used: Matlab

Theory:

x(t) = ) ( h . kT t k a
k

=

To generate PAM, we choose to represent the input to the transmit filter hT(t) as a train of
impulse functions,
x(t) = ) ( . kT t k a
k

=
o
Consequently filter output x(t) is a train of pulses, each required shape say, raised cosine
given by,

Eye diagram, allow to measure interference in the channel output. Practically this is done by
displaying channel output on a scope which is triggered using symbol clock. The overlaid pulses
from all the different symbol periods will lead to crisscrossed display with an eye in the middle. The
wider the opening of eye, the lower will be the inter symbol interference.
For the general case of M-ary PAM, the constellation points are evenly spaced along the
constellation axis at locations
M +1,M + 3,..,1, +1,,M+3,M+1

For each value of M, we get M-1 eye openings in the eye-diagram. M can have the values M
= 2,4,8,16.. In general M = 2
k
, k = 1,2,3.
Communication Systems Lab Manual


Department of Electronics, PAACET 30
Program:

%%%% EYE DIAGRAM OF PAM TRANSMISSION SYSTEM %%%%

clc;
clear all;
clear all;

Fs=20; % Sampling Frequency
Fd=1;
Pd=500;
M=input('Enter the value of M: ');
% Input message
x=randint(Pd,1,M); % Random vector containing integers between 0 and M-1
a=length(x); % Length of input message vector

for k = 1:a
for t = 0:(M-1)
if (x(k)== t)
y(k) = ((2*t)+1)-M; % PAM Signal
end
end
end

alpha = 0.001;
msg_a = y + alpha*y.^2; % Attenuated Input message
rcv_a = rcosflt(msg_a,Fd,Fs); % Raised Cosine Filter
N = Fs/Fd;
eyediagram(rcv_a,N);


Observations:

Enter the value of M: 4












Communication Systems Lab Manual


Department of Electronics, PAACET 31
Waveforms:

-0.5 0 0.5
-5
-4
-3
-2
-1
0
1
2
3
4
5
Time
A
m
p
l
i
t
u
d
e
Eye Diagram


Result:
Studied the eye diagram of a PAM transmission system





















Communication Systems Lab Manual


Department of Electronics, PAACET 32
Experiment No. 4
Generation of QAM Signal and Constellation Graph

Aim: To generate QAM signal and study the constellation.

Platform Used: Matlab

Theory:
QAM is a 2D generalization of M-ary PAM, having two orthogonal pass band basis
functions.


ith message s
i
in | | 2 , 1 | | plane is denoted as
|
.
|

\
|
2
min ,
,
2
min , d bi d ai
where dmin is the distance
between any two message parts in the constellation and ai, bi are integers where i = 1,2,..., M. Also,
let Eo
d
=
2
min
, where Eo is the energy of the signal with lowest amplitude.
The transmitted QAM for symbol k is

where k=0,
thus consists of two phase quadrature carriers with each one being modulated by a set
of discrete amplitudes, hence the name QAM.
In the case of even numbers of bits per symbol, L= . The QAM square constellation
naturally comes from a square matrix with ordered pair of co-ordinates.






Communication Systems Lab Manual


Department of Electronics, PAACET 33
Program:

%%%% QAM SIGNAL GENERATION AND ITS CONSTELLATION %%%%

clc;
clear all;
close all;

M=16;
% Input message
x=randint(50,1,M); % Random vector containing integers between 0 and M-1
stem(x);
xlabel('Time');
ylabel('Amplitude');
title('Random Input Signal');
L=sqrt(M);
n=length(x);
y=0+0i;

for k = 1:n
for t = 0:(M-1)
if (x(k)==t)
for a = 0:L-1
if (t>=a*L && t<(a+1)*L)
y(k)= ((2*a)+1-L) + 1i*((L-1)-2*(t-(a*L))); % QAM
Signal
end
end
end
end
end

scatterplot(y); % Constellation Plot
y1 = qammod(x,M); % Check using inbuilt function
scatterplot(y1);


Observations:

M = 16
L = 4

( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
(
(
(
(





=
3 , 3 3 , 1 3 , 1 3 , 3
1 , 3 1 , 1 1 , 1 1 , 3
1 , 3 1 , 1 1 , 1 1 , 3
3 , 3 3 , 1 3 , 1 3 , 3
, b a





Communication Systems Lab Manual


Department of Electronics, PAACET 34
Waveforms:
0 5 10 15 20 25 30 35 40 45 50
0
5
10
15
Time
A
m
p
l
i
t
u
d
e
Random Input Signal

-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
3
Q
u
a
d
r
a
t
u
r
e
In-Phase
Scatter plot

Result:
Generated a 16-ary QAM signal and studied its constellation.

Communication Systems Lab Manual


Department of Electronics, PAACET 35
Experiment No. 5
Phase Shift Method of SSB Generation using Simulink

Aim: To study single side band generation using phase shift method.

Platform Used: Matlab Simulink

Theory:


About the software:
Simulink is a software package that enables to model, simulate and analyze dynamic
system, ie a system whose output and state change with time. Simulink can be used to explain the
behavior of a wide range of real world systems including electrical circuits, mechanical,
thermodynamic system.
Simulating a dynamic system is a 2 step process with simulink. Model editor is used
to create a model of the system to be simulated. The model graphically depicts the time dependent
mathematical relationship among the system input.





Communication Systems Lab Manual


Department of Electronics, PAACET 36
Procedure:

1. Start Matlab Simulink and open Model editor.
2. Open the simulation library browsers and place the required block of the model editor by
drag and place operation.
3. Change the parameters of the block by double-clicking in each block and change the parame-
ter values as specified in the theory.
4. Save the model by giving suitable file name.
5. Click Simulation Configuration Parameters Solver Change
- Start and Stop Time
- Type Fixed Step
- Mode Single Tasking
6. Click Simulation Start Simulation.
Simulink Model:







Communication Systems Lab Manual


Department of Electronics, PAACET 37
Block Parameters:

Message Signal: Amplitude- 2V, Frequency- 100 Hz, Phase- 0
Carrier Signal: Amplitude- 2V, Frequency-2000 Hz, Phase- 0
Message (90 Shift): Amplitude- 2V, Frequency-100 Hz, Phase- pi/2 rad
Carrier (90 Shift): Amplitude- 2V, Frequency-2000 Hz, Phase- pi/2 rad

Spectrum Scope: axis properties- One-sided (0 to Fs/2)
Y axis lower limit- 0
Check Buffer input

Waveforms:



Result:
Studied single side band generation using Simulink and generated lower side band using
phase shift method.

You might also like