SlideShare a Scribd company logo
1
JANSONS INSTITUTE OF TECHNOLOGY
Karumathampatti, Coimbatore
Department of Electronics and Communication Engineering
Laboratory Manual
(As per Anna University Regulation 17)
EC 8561 – Communication Systems Laboratory
V Semester
2
Syllabus
(Anna University Regulation 17)
EC 8561 – Communication Systems Laboratory
LIST OF EXPERIMENTS:
1. Signal Sampling and reconstruction
2. Time Division Multiplexing
3. AM Modulator and Demodulator
4. FM Modulator and Demodulator
5. Pulse Code Modulation and Demodulation
6. Delta Modulation and Demodulation
7. Line coding schemes
8. Simulation of ASK, FSK, and BPSK generation schemes
9. Simulation of DPSK, QPSK and QAM generation schemes
10. Simulation of signal constellations of BPSK, QPSK and QAM
11. Simulation of ASK, FSK and BPSK detection schemes
12. Simulation of Linear Block and Cyclic error control coding schemes
13. Simulation of Convolutional coding scheme
14. Communication link simulation
3
List of Experiments
S.No EXPERIMENTS MARKS
OBTAINED
PAGE
NO
1 Signal Sampling and reconstruction
1
2 Time Division Multiplexing
6
3 AM Modulator and Demodulator
11
4
FM Modulator and Demodulator
16
5 Pulse Code Modulation and Demodulation
21
6 Delta Modulation and Demodulation
25
7 Observation (simulation) of signal constellations of BPSK, QPSK and
QAM
29
8 Line coding schemes
33
9 FSK and PSK schemes (Simulation)
36
10 Simulation of DPSK 39
11 Error control coding schemes - Linear Block Codes (Simulation)
47
12 Communication link simulation
51
13 Equalization – Zero Forcing & LMS algorithms (simulation)
54
1
Exp-No: 01
Date:
AIM:
SIGNAL SAMPLING AND RECONSTRUCTION
To perform the process of sampling for an analog signal and to reconstruct the sampled
signals using pulse modulation techniques.
APPARATUS REQUIRED:
1. Trainer kit
2. Patch Cords with inserting pins
3. Digital Storage Oscilloscope
4. DSO probes, Power chords.
THEORY:
In pulse modulation techniques, the message signal is modulated by some parameters of
pulse train. These parameters are amplitude and width.
Pulse amplitude modulation is defined as an analog modulation technique in which the
signal is sampled at regular intervals such that each sample is proportional to the amplitude
of the signal, at the instant of sampling. Pulse width modulation is defined as an analog
modulation technique in which the width of each pulse is made proportional to the
instantaneous amplitude of the signal at the sampling instant. PWM is also called as PDM/pulse
division modulation.
Sample and Hold circuits are used internally in Analog to Digital conversion. We might
also use them to hold a given signal value from any particular sensor on a robot, for analysis and
later use.The Sample and Hold circuit uses two buffers to keep a voltage level stored in a
capacitor. Excellent Sample and Hold circuits like the LF398 are available on a single chip for
cheap and easy use.
PROCEDURE:
1. Connect the power cord of the trainer unit to AC 220V, 50 Hz supply.
2. Switch ON the trainer kit. The neon lamp will glow indicating that the unit is ready for
operation.
3. Observe the waveforms of Modulating Signal Generator and Clock Signal
Generator in an Oscilloscope.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
2
4. Using patch cords, connect the Modulating Signal to the sockets marked ‗MOD
INPUT; in the PWM Modulator.
5. Using patch cords, connect the Clock Signal to the sockets marked ‗CLOCK
INPUT‘ in the PWM Modulator.
6. Vary the Modulating Signal & Clock Signal to obtain a Pulse Width Modulated Output
across the sockets marked ‗PWMOUTPUT‘
7. For reconstruction, connect the ‗PWM OUTPUT‘ from the Pulse Width Modulation
to the sockets marked ‗PWM INPUT‗ in the Demodulation.
8. Observe the demodulated output waveform across sockets marked ‗DEMOD OUTPUT‘.
MODEL GRAPH:
PWM:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
3
KIT DIAGRAM:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
4
TABULATION:
S.NO SIGNAL AMPLITUDE (V) TIME (s)
1. Modulating signal
2. Sampling Signal
3. Sampled Output
4. Reconstructed output
GRAPH:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
5
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
6
Exp-No: 2
Date:
AIM:
Simulation of TIME DIVISION MULTIPLEXING
To Perform the simulation of time division multiplexing.
THEORY:
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. Unlike FDM, TDM is immune to non linearity 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.
In the circuit diagram the 555 timer is used as a clock generator. This timer is a highly
stable device for generating accurate time delays. In this circuit this timer generates clock signal,
which is of 100 KHz frequency (approximately). This clock signal is connected to the IC 7476.It
divides the clock signal frequency into three parts and those are used as selection lines for
multiplexer. Inbuilt signal generator is provided with sine, square and triangle outputs with
variable frequency. These three signals can be used as inputs to the multiplexer. IC 4052 is a 4 to
1 Analog Multiplexer. It selects one-of-four signal sources as a result of unique three bit binary
code at the select inputs.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
7
SOFTWARE REQUIRED:
MATLAB
PROCEDURE:
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window Figure window
PROGRAM:
clc;
closeall;
clearall;
% Signal generation
x=0:.5:4*pi; % siganal taken upto 4pi
sig1=8*sin(x); % generate 1st sinusoidal signal
l=length(sig1);
sig2=8*triang(l); % Generate 2ndtraingularSigal
%DisplayofBothSignal
subplot(2,2,1);
plot(sig1);
title('Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,2,2);
plot(sig2);
title('Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
%DisplayofBothSampledSignal
subplot(2,2,3);
stem(sig1);
title('Sampled Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,2,4);
stem(sig2);
title('Sampled Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
l1=length(sig1);
l2=length(sig2);
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
8
fori=1:l1
sig(1,i)=sig1(i); %MakingBothrowvectortoamatrix
sig(2,i)=sig2(i);
end
% TDM ofboth quantize signal
tdmsig=reshape(sig,1,2*l1);
%DisplayofTDMSignal
figure
stem(tdmsig);
title('TDM Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
% Demultiplexing of TDM Signal
demux=reshape(tdmsig,2,l1);
fori=1:l1
sig3(i)=demux(1,i); % Converting The matrix into row vectors
sig4(i)=demux(2,i);
end
% display of demultiplexed signal
figure
subplot(2,1,1)
plot(sig3);
title('Recovered Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,1,2)
plot(sig4);
title('Recovered Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
9
OUTPUT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
10
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
11
Exp-No:3
Date:
AIM
AM MODULATION AND DEMODULATION
To transmit a modulating signal after amplitude modulation using AM transmitter and
receive the signal back after demodulating using AM receiver.
APPARATUS REQUIRED:
1. AM transmitter trainer kit
2. AM receiver trainer kit
3. DSO
4. Patch cords
THEORY:
A continuous-wave goes on continuously without any intervals and it is the baseband message signal,
which contains the information. This wave has to be modulated.
According to the standard definition, ―The amplitude of the carrier signal varies in accordance
with the instantaneous amplitude of the modulating signal.‖ Which means, the amplitude of the
carrier signal containing no information varies as per the amplitude of the signal containing information,
at each instant.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
12
AMPLITUDE MODULATION:
Amplitude Modulation is a process by which amplitude of the carrier signal is
varied in accordance with the instantaneous value of the modulating signal, but frequency and
phase of carrier wave remains constant.
The modulating and carrier signal are given by
Vm(t) = Vm sin�
mt
VC(t) = VC sin�
Ct
The modulation index is given by, ma = Vm / VC.
Vm = Vmax – Vmin and VC = Vmax + Vmin
The amplitude of the modulated signal is given by,
VAM(t) = VC (1+ma sin�
mt) sin�
Ct
Where
Vm = maximum amplitude of modulating signal
VC = maximum amplitude of carrier signal
Vmax = maximum variation of AM signal
Vmin = minimum variation of AM signal
PROCEDURE:
1. The circuit wiring is done as shown in diagram
2. A modulating signal input given to the Amplitude modulator
3. Now increase the amplitude of the modulating signal to the required level.
4. The amplitude and the time duration of the modulating signal are observed using
CRO.
5. Finally the amplitude modulated output is observed from the output of amplitude
modulator stage and the amplitude and time duration of the AM wave are noted
down.
6. Calculate the modulation index by using the formula and verify them. The final
demodulated signal is viewed using an CRO at the output of audio power amplifier
stage. Also the amplitude and time duration of the demodulated wave are noteddown.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
13
MODEL GRAPH:
KIT DIAGRAM:
14
TABULATION:
UNDER MODULATION:
Waveform Amplitude (V) Time Period (sec)
Message
Carrier
Modulated
Demodulated
CRITICAL MODULATION:
Waveform Amplitude (V) Time Period (sec)
Message
Carrier
Modulated
Demodulated
OVER MODULATION:
Waveform Amplitude (V) Time Period (sec)
Message
Carrier
Modulated
Demodulated
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
15
GRAPH:
16
RESULT:
17
Exp-No: 04
Date:
AIM
FREQUENCY MODULATION AND DEMODULATION
To transmit a modulating signal after frequency modulation using FM transmitter and
receive the signal back after demodulation using FM receiver.
APPARATUS REQUIRED:
1. FM transmitter trainer kit
2. FM receiver trainer kit
3. DSO
4. Patch cords
THEORY:
Frequency modulation (FM) is a form of modulation that represents information as variations in the
instantaneous frequency of a carrier wave. (Contrast this with amplitude modulation, in which the
amplitude of the carrier is varied while its frequency remains constant.) In analog applications, the carrier
frequency is varied in direct proportion to changes in the amplitude of an input signal. Shifting the carrier
frequency among a set of discrete values can represent digital data, a technique known as frequency-shift
keying. FM is commonly used at VHF radio frequencies for high-fidelity broadcasts of music and speech
(see FM broadcasting). Normal (analog) TV sound is also broadcast using FM. A narrowband form is
used for voice communications in commercial and amateur radio settings. The type of FM used in
broadcast is generally called wide-FM, or W-FM. In two-way radio, narrowband narrow-fm (N-FM) is
used to conserve bandwidth. In addition, it is used to send signals into space.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
18
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
FM is also used at intermediate frequencies by most analog VCR systems, including VHS,
to record the luminance (black and white) portion of the video signal. FM is the only feasible
method of recording video to and retrieving video from magnetic tape without extreme
distortion, as video signals have a very large range of frequency components — from a few hertz
to several megahertz, too wide for equalizers to work with due to electronic noise below -60 dB.
FM also keeps the tape at saturation level, and therefore acts as a form of noise reduction, and a
simple limiter can mask variations in the playback output, and the FM capture effect removes
print-through and pre-echo. A continuous pilot-tone, if added to the signal — as was done on
V2000 and many Hi-band formats — can keep mechanical jitter under control and assist time
base correction.
PROCEDURE:
1. The circuit wiring is done as shown in diagram
2. A modulating signal input given to the Frequency modulator
3. Now increase the modulated signal to the required level.
4. The amplitude and the time duration of the modulating signal are observed using
CRO.
5. Finally the frequency modulated output is observed from the output of frequency
modulator stage and the amplitude and time duration of the FM wave are noteddown.
19
t (sec)
Model Graph:
Frequency Modulation :
Demodulated Signal
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
t (sec)
t (sec)
t (sec)
Amplitude
(V)
Amplitude
(V)
20
KIT DIAGRAM:
Frequency Modulation :
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
21
FM Demodulation:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
22
TABULATION:
Waveform Amplitude (V) Time Period (sec)
Message
Carrier
Modulated
Demodulated
GRAPH:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
23
RESULT:
24
Exp-No: 05
Date:
AIM
Pulse Code Modulation and Demodulation
To perform the operation of Pulse Code Modulation and demodulation and observe the
output waveforms.
APPARATUS REQUIRED
PCM kit, Power supply, DSO and connecting probes
THEORY
Pulse code modulation is a process of converting an analog signal into digital. The voice
or any data input is first sampled using a sampler (which is a simple switch) and then quantized.
Quantization is the process of converting a given signal amplitude to an equivalent binary
number with fixed number of bits. This quantization can be either midtread or mid-raise and it
can be uniform or non-uniform based on the requirements. For example in speech signals, the
higher amplitudes will be less frequent than the low amplitudes. So higher amplitudes are given
less step size than the lower amplitudes and thus quantization is performed non-uniformly. After
quantization the signal is digital and the bits are passed through a parallel to serial converter and
then launched into the channel serially.
At the demodulator the received bits are first converted into parallel frames and each
frame is de-quantized to an equivalent analog value. This analog value is thus equivalent to a
sampler output. This is the demodulated signal.
PROCEDURE:
1. Make connections as shown in the circuit diagram.
2. Set the input signal and carrier signal.
3. Obtain PCM signal
4. Tabulate the output data and draw the graph.
5. Justify the obtained output
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
25
KIT DIADRAM:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
26
MODEL GRAPH:
TABULATION:
Waveform Amplitude (V) Time Period (sec)
Message
Carrier
Modulated
Demodulated
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
27
GRAPH:
RESULT:
28
Exp-No: 06
Date:
DELTA MODULATION AND DEMODULATION
AIM
To study and to plot the characteristics of Delta modulation and demodulation.
APPARATUS REQUIRED:
DM kit, Power supply, DSO and connecting probes
THEORY:
Delta modulation is the DPCM technique of converting an analog message signal to a
digital sequence. The difference signal between two successive samples is encoded into a single
bit code. It is a one - bit version of differential pulse code modulation, it provides staircase
approximation for the given input baseband signal. The difference between the input and
staircase approximation is quantized into two levels called, ± ∆.A comparator senses whether or
not the instantaneous level of the analog input signal is greater or less than the feedback signal
(staircase approximation). The comparator output is clocked by a flip flop to form a
continuous NRZ digital data stream. This digital data is converted back to analog staircase
signal using DAC and feed to the comparator. The feedback signal never stands still; it always
travels up or down by a fixed amount (± ∆ ) in any clock period. Because of its fixed
feedback output slope, the linear delta modulator is less than ideal for encoding human
voice, also the accumulator (or) feedback section cannot track large, high frequency signals
with its fixedslope.
The delta demodulator is a simple one which have only feedback system of delta
modulator and a low-pass filter. The demodulator recovers staircase approximation from the
encoded signal and which will be smoothened by a low pass filter to get back original
analog information.
.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
29
KIT DIAGRAM:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
30
PROCEDURE:
1. Make connections as shown in the circuit diagram.
2. Set the input signal and carrier signal.
3. Obtain DM signal
4. Tabulate the output data and draw the graph.
5. Justify the obtained output .
MODEL GRAPH:
TABULAR COLUMN:
Name of the signal Amplitude in V Time period in Sec
Modulating Signal
Carrier Signal
Modulated Signal
Demodulated Signal
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
31
GRAPH:
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
32
Exp-No: 07
Date:
LINE CODING SCHEMES
AIM
To study about different line coding schemes.
SOFTWARE USED:
MATLAB
THEORY:
NON-RETURN TO ZERO signal are the easiest formats that can be generated. These signals do
not return to zero with the clock. The frequency component associated with these signals are half
that of the clock frequency. The following data formats come under this category. Non-return to
zero encoding is commonly used in slow speed communications interfaces for both synchronous
and asynchronous transmission. Using NRZ, logic 1 bit is sent as a high value and logic 0 bit is
sent as a low value.
a) NON-RETURN TO ZERO-LEVEL (NRZ-L)
This is the most extensively used waveform in digital logics. All „ones‟ are represented by
„high‟ and all „zeros‟ by „low‟. The data format is directly available at the output of all digital
data generation logics and hence very easy to generate. Here all the transitions take place at the
rising edge of the clock.
b) NON-RETURN TO ZERO-MARK (NRZ-M)
These waveforms are extensively used in tape recording. All „ones‟ are marked by change in
levels and all‟zeros‟ by no transitions, and the transitions take place at the rising edge of the
clock.
c) NON-RETURN TO ZERO-SPACE (NRZ-S)
This type of waveform is marked by change in levels for „zeros‟ and no transition for „ones‟
and the transitions take place at the rising edge of the clock. This format is also used in magnetic
tape recording.
d) UNIPOLAR AND BIPOLAR
Unipolar signals are those signals, which have transition between 0 to +VCC. Bipolar signals are
those signals, which have transition between +VCC to –VCC.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
33
e) BIPHASE – LINE CODING (BIPHASE -L):
With the Biphase – L 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.
f) 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, half bit later, whereas a zero has no second transition.
g) BIPHASE SPACE CODING(BIPHASE-S):
With a Biphase-S, a transition occurs at the beginning of every bit interval. A „zero‟ is marked
by a second transition, one half bit later; „one‟ has no second transition.
h) 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); With the URZ a „one‟
is represented by a half bit wide pulse and a „zero‟ is represented by the absence of pulse.
i) MULTILEVEL SIGNALS:
Multilevel signals use three or more levels of voltages to represent the binary digits, „one‟ and
„zero‟ – instead of normal „highs‟ and „lows‟ Return to zero – alternative mark inversion (RZ -
AMI) is the most commonly used multilevel signal. This coding scheme is most often used in
telemetry systems. In this scheme, „one‟ are represented by equal amplitude of alternative
pulses, which alternate between a +5 and -5. These alternating pulses return to 0 volt, after every
half bit interval. The‖Zeros‟ are marked by absence of pulses.
PROCEDURE:
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window Figure window
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
34
PROGRAM:
clc;
close all;
clear all;
x=[1 0 1 1 0 1];
nx=size(x,2);
sign=1;
i=1;
while i<nx+1
t = i:0.001:i+1-0.001;
if x(i)==1
unipolar_code=square(t*2*pi,100);
polar_code=square(t*2*pi,100);
bipolar_code=sign*square(t*2*pi,100);
sign=sign*-1;
manchester_code=-square(t*2*pi,50);
else
end
unipolar_code=0;
polar_code=-square(t*2*pi,100);
bipolar_code=0;
manchester_code=square(t*2*pi,50);
subplot(4,1,1);
plot(t,unipolar_code);
ylabel('unipolar code');
hold on;
grid on;
axis([1 10 -2 2]);
subplot(4,1,2);
plot(t,polar_code);
ylabel('polar code');
hold on;
grid on;
axis([1 10 -2 2]);
subplot(4,1,3);
plot(t,bipolar_code);
ylabel('bipolar code');
hold on;
grid on;
axis([1 10 -2 2]);
subplot(4,1,4);
plot(t,manchester_code);
ylabel('manchester code');
hold on;
grid on;
axis([1 10 -2 2]);
i=i+1;
end
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
35
OUTPUT:
RESULT:
36
Exp-No: 8
Date:
Simulation of ASK, FSK, BPSK generation schemes
AIM :
To study simulation of ASK, FSK, BPSK techniques.
SOFTWARE USED:
MATLAB
PROCEDURE:
7. Open MATLAB
8. Open new M-file
9. Type the program
10. Save in current directory
11. Compile and Run the program
12. For the output see command window Figure window
PROGRAM:
ASK generation:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
37
clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1; fc=10;
t=0:Tb/100:1;
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=zeros(1,length(t));
end
message(i,:)=m_s;
%product of carrier and message
ask_sig(i,:)=c.*m_s;
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
%plot the message and ASK signal
subplot(5,1,2);
axis([0 N -2 2]);
plot(t,message(i,:),'r');
title('message signal');
xlabel('t--->');
ylabel('m(t)');grid on
hold on
subplot(5,1,4);
plot(t,ask_sig(i,:));
title('ASK signal');
xlabel('t--->');
ylabel('s(t)');
grid on
hold on
end
hold off
%Plot the carrier signal and input binary data
subplot(5,1,3);plot(t,c);
title('carrier signal');
xlabel('t--->');ylabel('c(t)');
grid on
subplot(5,1,1);stem(m);
title('binary data bits');
xlabel('n--->');ylabel('b(n)');
grid on
BPSK MODULATION
clc;
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
38
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
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);
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
39
title('carrier signal');
xlabel('t--->');ylabel('c(t)');
grid on;
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
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
40
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;
OUTPUT:
ASK modulation
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
41
BPSK modulation
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
42
FSK modulation
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
43
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
44
Exp-No: 09
Date:
Simulation of DPSK, QPSK AND QAM generation schemes
AIM:
To write a program in MATLAB for design of DPSK, QPSK, QAM.
SOFTWARE USED:
MATLAB
PROCEDURE:
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window Figure window
PROGRAM:
DPSK:
clear all;
close all;
i=10;
j=5000;
a=round(rand(1,i));
t=linspace(0,10,j);
fc=5;
SNR=10;
st1=t;
for n=1:10
for m=j/i*(n-1)+1:j/i*n
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
45
if a(n)<1
st1(m)=0;
else
st1(m)=1;
end
end
end
figure(1)
subplot(211)
plot(t,st1);
title('Original Input Bit');
axis([0,10,-1,2]);
b=zeros(1,i);
b(1)=a(1);
for n=2:10
if a(n)==1
if b(n-1)==1
b(n)=0;
else
b(n)=1;
end
else
b(n)=b(n-1);
end
end
st2=t;
for n=1:10
for m=j/i*(n-1)+1:j/i*n
if b(n)==0
st2(m)=0;
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
46
else
st2(m)=1;
end
end
end
subplot(212);
plot(t,st2);
title('Differentially Encoded Bitstream');
axis([0,10,-1,2]);
st3=t;
for n=1:j
if st2(n)==1
st3(n)=0;
else
st3(n)=1;
end
end
figure(2)
subplot(311);
plot(t,st3);
title('Inverse of Differentially Encoded Bitstream')
axis([0,10,-1,2]);
s1=sin(2*pi*fc*t);
subplot(312)
plot(t,s1);
axis([0,10,-2,2]);
title('Carrier for Differentially Encoded Bitstream ')
s2=-s1;
subplot(313)
plot(t,s2);
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
47
axis([0,10,-2,2]);
title('Carrier for Inverse of Differentially Encoded Bitstream ')
d1=st2.*s1;
d2=st3.*s2;
figure(3);
subplot(311);
plot(t,d1);
axis([0,10,-2,2]);
title('DPSK of Differentially Encoded Bitstream')
subplot(312)
plot(t,d2);
axis([0,10,-2,2]);
title('DPSK of Inverse of Differentially Encoded Bitstream')
e_dpsk=d1+d2;
subplot(313)
plot(t,e_dpsk);
axis([0,10,-2,2]);
title('DPSK Waveform')
awgn_dpsk=awgn(e_dpsk,SNR,'measured','dB');
figure(4)
subplot(311)
plot(t,awgn_dpsk);
axis([0,10,-2,2]);
title('DPSK waveform with AWGN')
[B1,A1]=butter(1,[3/(500/2) 7/(500/2)]);
awgn_dpsk1=filter(B1,A1,awgn_dpsk);
subplot(312);
plot(t,awgn_dpsk1);
axis([0,10,-2,2]);
title('Bandpass matched Filter output');
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
48
dem_dpsk=awgn_dpsk1.*sin(2*pi*fc*t);
subplot(313)
plot(t,dem_dpsk);
axis([0,10,-2,2]);
title('Demodulated DPSK Waveform')
[b1,a1]=butter(1,2/(500/2),'low');
al_dpsk=filter(b1,a1,dem_dpsk);
figure(5)
subplot(311)
plot(t,al_dpsk);
axis([0,10,-2,2]);
title('Low Pass Filter Output')
st=zeros(1,i);
for m=0:i-1
for j=m*500+1:(m+1)*500
if al_dpsk(1,m*500+250)<0
st(m+1)=0;
else
st(m+1)=1;
end
end
end
dpsk=zeros(1,j);
for m=0:i-1
for j=m*500+1:(m+1)*500
if al_dpsk(1,j)<0
dpsk(1,j)=0;
else
dpsk(1,j)=1;
end
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
49
end
end
subplot(312);
plot(t,dpsk);
axis([0,10,-1,2]);
title('Differentially Decoded Bitstream')
error=dpsk-st2;
error=abs(error);
errorrate=sum(error)/5000
dt=zeros(1,i);
dt(1)=st(1);
for n=2:10
if (st(n)-st(n-1))<=0&&(st(n)-st(n-1))>-1
dt(n)=0;
else
dt(n)=1;
end
end
st=t;
for n=1:10
if dt(n)<1;
for m=j/i*(n-1)+1:j/i*n
st(m)=0;
end
else
for m=j/i*(n-1)+1:j/i*n
st(m)=1;
end
end
end
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
50
subplot(313)
plot(t,st);
title('Retrieved Bitstream');
axis([0,10,-1,2])
QPSK:
QPSK
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 21
m(i+1)=1;
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);
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
51
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);
title('carrier signal-2');xlabel('t --->');ylabel('c2(t)');grid on;
subplot(3,2,3);plot(t,c2);
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;
QAM code
t=0:0.0001:1;
%Message 1
m1=cos(2*pi*50*t);
%Message 2
m2=sin(2*pi*100*t);
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
52
%Carrier
c1=cos(2*pi*1000*t);
%Quadrature Carrier
c2=sin(2*pi*1000*t);
mod1=m1.*c1;
mod2=m2.*c2;
mod=mod1+mod2;
subplot(5,1,1)
plot(t,m1);
title('Message 1');
subplot(5,1,2)
plot(t,m2);
title('Message 2');
subplot(5,1,3)
plot(t,mod);
title('Modulated Signal');
%Demodulation with Carrier
demod1=mod.*c1;
%Demodulation with Quadrature Carrier
demod2=mod.*c2;
[a b]=butter(5,2*55*0.0001);
msg1=filter(a,b,demod1);
[a b]=butter(5,2*105*0.0001);
msg2=filter(a,b,demod2);
subplot(5,1,4)
plot(t,msg1);
title('Message 1 retrieved');
subplot(5,1,5)
plot(t,msg2);
title('Message 2 retrieved');
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
53
OUTPUT:
DPSK:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
54
QPSK:
55
QAM:
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
56
Exp-No: 10
Date:
SIMULATION OF SIGNAL CONSTELLATIONS OF BPSK, QPSK AND
QAM
AIM:
To write a program in MATLAB for design of BPSK, QPSK, QAM.
SOFTWARE USED:
MATLAB
PROCEDURE:
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window Figure winDOW
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
57
PROGRAM:
% Setting up parameters for modulation type
data = randint(1000,1,[1,0]); % generating binary data of 1000 bits with ones
and zeros
mod_type=input('Enter the modulation type[1 for BPSK,2 for QPSK,3 for 16QAM,4
for 64QAM]: ');
norm_factor=[1.0;0.7071;0.3162;0.1543]; % normalization factors,
1.0:BPSK,0.7071:QPSK,0.3162:16QAM,0.1543:64QAM
nc=[1;2;4;6]; % number of bits per subcarrier, 1:BPSK,2:QPSK,4:16QAM,6:64QAM
input_seq = data;
k=norm_factor(mod_type);
mode=nc(mod_type);
% Selecting constellation point as per modulation type
switch mode
case 1
b=k*[1 -1];
case 2
b=k*[1+1i -1+1i 1-1i -1-1i];
case 4
b=k*[1+1i 1+3i 1-1i 1-3i 3+1i 3+3i 3-1i 3-3i -1+1i -1+3i -1-1i -1-3i -3+1i -
3+3i -3-1i -3-3i];
end
count=1;
count1=1;
for i=1:(ceil(length(input_seq)/mode))
temp=0;
for j=1:mode
temp=bitor(temp,bitshift(input_seq(count),(j-1)));
count=count+1;
if(count>length(input_seq))
break;
end
end
map_out(count1)=b(temp+1);
count1=count1+1;
end
figure;plot(real(map_out),imag(map_out),'r.');title('constellation');
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
58
OUTPUT:
BPSK:
QPSK:
QAM:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
59
RESULT:
60
Exp-No:
11 Date:
AIM :
Simulation of ASK, FSK, BPSK detection schemes
To study simulation of ASK, FSK, BPSK detection techniques.
SOFTWARE USED:
MATLAB
PROCEDURE:
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window Figure window
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
61
PROGRAM:
ASK DEMODULATION
t1=0;t2=Tb
for i=1:N
t=[t1:Tb/100:t2]
%correlator
x=sum(c.*ask_sig(i,:));
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
end
%plot demodulated binary data bits
subplot(5,1,5);stem(demod);
title('ASK demodulated signal');
xlabel('n--->');ylabel('b(n)');
grid on
BPSK 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
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
62
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;
OUTPUT:
ASK demodulation
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
63
PSK demodulation
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
64
FSK demodulation
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
65
Exp-No: 12
Date:
SIMULATION OF LINEAR BLOCK AND CYCLIC ERROR CONTROL CODING
SCHEMES
AIM :
To study simulation of error control coding schemes - linear block and cyclic code
techniques.
SOFTWARE USED:
MATLAB
PROGRAM:
LINEAR CODE:
clc;
clear all;
% Input Generator Matrix
g=input('Enter The Generator Matrix: ')
disp ('G = ')
disp ('The Order of Linear block Code for given Generator Matrix is:')
[n,k] = size(transpose(g))
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
end
end
u;
disp('The Possible Codewords are :')
c = rem(u*g,2)
disp('The Minimum Hamming Distance dmin for given Block Code is= ')
d_min = min(sum((c(2:2^k,:))'))
% Code Word
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
66
r = input('Enter the Received Code Word:')
p = [g(:,n-k+2:n)];
h = [transpose(p),eye(n-k)];
disp('Hammimg Code')
ht = transpose(h)
disp('Syndrome of a Given Codeword is :')
s = rem(r*ht,2)
for i = 1:1:size(ht)
if(ht(i,1:3)==s)
r(i) = 1-r(i);
break;
end
end
disp('The Error is in bit:')
i
disp('The Corrected Codeword is :')
r
CYCLIC ERROR CONTROL CODE:
clc;
clear all;
close all;
n=7;
k=4;
genpoly=cyclpoly(n,k,'max');
berf=[];
for i=1:10
b=0;
for j=1:50
msg=randint(500,k,[0,1]);
code=encode(msg,n,k,'cyclic/binary',genpoly);
t=0:0.1:10;
snr=0;
y=awgn(code,i);
y(find(y>0))=1;
y(find(y<0))=1;
msgop=decode(y,n,k,'cyclic/binary',genpoly);
[number,b1]=biterr(msgop,msg);
b=b+b1;
end
berf(i)=b/50;
end
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
67
semilogy(1:10,berf);
title('performance analysis in awgn for cyclic codes');
xlabel ('snr (db)');
ylabel ('BER');
OUTPUT:
Enter The Generator Matrix: [1 0 0 0 1 0 1;0 1 0 0 1 1 1;0 0 1 0 1 1 0;0 0 0 1 0 1 1]
g =
1 0 0 0 1 0 1
0 1 0 0 1 1 1
0 0 1 0 1 1 0
0 0 0 1 0 1 1
G = The Order of Linear block Code for given Generator Matrix is:
n =7
k =4
The Possible Codewords are :
c =
0 0 0 0 0 0 0
0 0 0 1 0 1 1
0 0 1 0 1 1 0
0 0 1 1 1 0 1
0 1 0 0 1 1 1
0 1 0 1 1 0 0
0 1 1 0 0 0 1
0 1 1 1 0 1 0
1 0 0 0 1 0 1
1 0 0 1 1 1 0
1 0 1 0 0 1 1
1 0 1 1 0 0 0
1 1 0 0 0 1 0
1 1 0 1 0 0 1
1 1 1 0 1 0 0
1 1 1 1 1 1 1
The Minimum Hamming Distance dmin for given Block Code is=
d_min =3
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
68
Enter the Received Code Word:[1 0 0 0 1 0 0]
r =1 0 0 0 1 0 0
Hammimg Code
ht =1 0 1
1 1 1
1 1 0
0 1 1
1 0 0
0 1 0
0 0 1
Syndrome of a Given Codeword is :
s = 0 0 1
The Error is in bit:
i = 7
The Corrected Codeword is :
r = 1 0 0 0 1 0 1
OUTPUT FOR CYCLIC CODE:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
69
RESULT:
70
Exp.No:13
Date:
AIM:
Simulation of Convolutional coding scheme
To study the simulation of convolutional coding scheme.
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUE OF TECHNOLOGY
III
YEAR
71
SOFTWARE REQUIRED:
MATLAB
PROCEDURE:
1. Open MATLAB
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. For the output see command window Figure window
PROGRAM:
function [Conv_out] = conv_encoder(Conv_In)
Conv_In= [1 1 0 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 0]; % x=[1 0 1 1 0 0 0];
m1=0;
m2=0;
m3=0;
m4=0;
%m_in m1 m2 m3 m4
%[1 0 1 0 1] =x0
%[1 1 0 1 1] =x1
%[1 1 1 1 1] =x2;
for k = 1:length(Conv_In)
% 1st polynomial
% x0= [1 0 1 0 1]
m_in = Conv_In(k);
temp1 = bitxor(m_in,m2);
x0 = bitxor(temp1,m4);
% 2nd polynomial
temp1 = bitxor(m_in,m1);
temp2 = bitxor(temp1,m3);
x1 = bitxor(temp2,m4);
%3rd polynomial
temp1 = bitxor(m_in,m1);
temp2 = bitxor(temp1,m2);
temp3 = bitxor(temp2,m3);
x2 = bitxor(temp3,m4);
Conv_out((3*k)-2) = x0;
Conv_out((3*k)-1) = x1;
Conv_out(3*k) = x2;
%%%Shifiting
m4=m3;
m3=m2;
m2=m1;
m1=m_in;
end
72
OUTPUT:
ans =
Columns 1 through 15
1 1 1 1 0 0 1 1 0 0 0 1 1 1 1
Columns 16 through 30
1 0 1 1 1 1 0 0 1 0 0 1 0 0 0
Columns 31 through 45
0 0 1 0 0 1 1 1 1 1 0 1 1 1 1
Columns 46 through 60
0 0 1 0 0 1 1 1 1 1 0 1 0 0 0
73
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
74
Exp-No: 14
Date:
AIM:
COMMUNICATION LINK SIMULATION
To design a Model for establishing communication link using Simulink.
SOFTWARE USED:
MATLAB
PROCEDURE:
1. Open the MATLAB Software.
2. Click on the Simulink icon. In that window select File -new Model to create your model
3. Select the components required for your design from the Simulink library.
4. After saving the design, click on the Run button to view the output.
CIRCUIT DIAGRAM:
THEORY:
A Communication can be established by the transmission of signals between two entities
through a communication channel. A binary generator is used as a source of signal which will be
producing signals in terms of ones and zeros. Here Hamming encoder is used for encoding the
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
75
signal and the encoded signal is further modulated by using the QPSK modulator, after which the
signal is transmitted through a channel, where there are the possibilities of addition of noise. By
selecting a Hamming decoder and QPSK demodulator the source signal without any distortion is
recovered back, which is shown at the output.
OUTPUT:
Source Signal Signal before Transmission
Signal After Passing Through Signal Received
Communication Channel
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR
76
RESULT:
COMMUNICATION SYSTEMS LAB MANUAL
JANSONS INSTITUTE OF TECHNOLOGY
III
YEAR

More Related Content

PPTX
Equalization
PPTX
Pulse Modulation ppt
PPSX
Phase shift keying(PSK)
PPS
Pulse modulation
PPTX
Modulation techniques
PDF
Decimation and Interpolation
PDF
Line coding
Equalization
Pulse Modulation ppt
Phase shift keying(PSK)
Pulse modulation
Modulation techniques
Decimation and Interpolation
Line coding

What's hot (20)

PDF
Frequency Modulation and Demodulation
PPT
Multiplexing : FDM
PPTX
Pulse modulation
PPT
Digital Communication: Information Theory
PPTX
Large scale path loss 1
PPTX
Digital modulation techniques
PDF
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
PPTX
Properties of dft
PPT
Time Division Multiplexing
PPTX
M ary psk and m ary qam ppt
PPTX
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
PPTX
Delta modulation
PPT
Digital modulation techniques
PPTX
Digital modulation technique
PPTX
Digital modulation techniques...
PDF
Analog communication
PPTX
Super heterodyne receiver
PPSX
Multirate digital signal processing
Frequency Modulation and Demodulation
Multiplexing : FDM
Pulse modulation
Digital Communication: Information Theory
Large scale path loss 1
Digital modulation techniques
Sampling Theorem, Quantization Noise and its types, PCM, Channel Capacity, Ny...
Properties of dft
Time Division Multiplexing
M ary psk and m ary qam ppt
DIGITAL COMMUNICATION: ENCODING AND DECODING OF CYCLIC CODE
Delta modulation
Digital modulation techniques
Digital modulation technique
Digital modulation techniques...
Analog communication
Super heterodyne receiver
Multirate digital signal processing
Ad

Similar to Cs manual 2021 (20)

PDF
Adc lab
PDF
DIGITAL COMMUNICATIONS LABiddooydgdgdgxgkdkkgxgxhxxhhd.pdf
PPT
Unit-4 Pulse analog Modulation.ppt
PDF
ADC LAB BY PROF. KRISHNANAIK AND SUMAN FROM CDU
DOCX
Dc lab Manual
PPT
ADVANCED COMMUNICATION BLOCK DIAGRAM System
PDF
Principles of-mobile-communication-2011
PDF
Ilovepdf merged
DOCX
DOC
Analog Communication Lab Manual
PDF
Iaetsd stbc-ofdm downlink baseband receiver for mobile wman
PPT
Digital communication systems
PPTX
Communication engineering notes uniit ii
PDF
Efitra1006
PDF
Te 4 pulse_modulation
DOC
Analog Communication Engineering Lab Manual
PDF
dsp.pdf
PDF
lecturenote_1681299989Chapter 5- digital transmission.pdf
PDF
Energy Efficient Optimum Sampling Rate for Analogue Signals with Extremely Wi...
Adc lab
DIGITAL COMMUNICATIONS LABiddooydgdgdgxgkdkkgxgxhxxhhd.pdf
Unit-4 Pulse analog Modulation.ppt
ADC LAB BY PROF. KRISHNANAIK AND SUMAN FROM CDU
Dc lab Manual
ADVANCED COMMUNICATION BLOCK DIAGRAM System
Principles of-mobile-communication-2011
Ilovepdf merged
Analog Communication Lab Manual
Iaetsd stbc-ofdm downlink baseband receiver for mobile wman
Digital communication systems
Communication engineering notes uniit ii
Efitra1006
Te 4 pulse_modulation
Analog Communication Engineering Lab Manual
dsp.pdf
lecturenote_1681299989Chapter 5- digital transmission.pdf
Energy Efficient Optimum Sampling Rate for Analogue Signals with Extremely Wi...
Ad

Recently uploaded (20)

PPT
Total quality management ppt for engineering students
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
Current and future trends in Computer Vision.pptx
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
Artificial Intelligence
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
Soil Improvement Techniques Note - Rabbi
Total quality management ppt for engineering students
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
86236642-Electric-Loco-Shed.pdf jfkduklg
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Information Storage and Retrieval Techniques Unit III
Current and future trends in Computer Vision.pptx
Visual Aids for Exploratory Data Analysis.pdf
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Categorization of Factors Affecting Classification Algorithms Selection
III.4.1.2_The_Space_Environment.p pdffdf
Artificial Intelligence
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Safety Seminar civil to be ensured for safe working.
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Soil Improvement Techniques Note - Rabbi

Cs manual 2021

  • 1. 1 JANSONS INSTITUTE OF TECHNOLOGY Karumathampatti, Coimbatore Department of Electronics and Communication Engineering Laboratory Manual (As per Anna University Regulation 17) EC 8561 – Communication Systems Laboratory V Semester
  • 2. 2 Syllabus (Anna University Regulation 17) EC 8561 – Communication Systems Laboratory LIST OF EXPERIMENTS: 1. Signal Sampling and reconstruction 2. Time Division Multiplexing 3. AM Modulator and Demodulator 4. FM Modulator and Demodulator 5. Pulse Code Modulation and Demodulation 6. Delta Modulation and Demodulation 7. Line coding schemes 8. Simulation of ASK, FSK, and BPSK generation schemes 9. Simulation of DPSK, QPSK and QAM generation schemes 10. Simulation of signal constellations of BPSK, QPSK and QAM 11. Simulation of ASK, FSK and BPSK detection schemes 12. Simulation of Linear Block and Cyclic error control coding schemes 13. Simulation of Convolutional coding scheme 14. Communication link simulation
  • 3. 3 List of Experiments S.No EXPERIMENTS MARKS OBTAINED PAGE NO 1 Signal Sampling and reconstruction 1 2 Time Division Multiplexing 6 3 AM Modulator and Demodulator 11 4 FM Modulator and Demodulator 16 5 Pulse Code Modulation and Demodulation 21 6 Delta Modulation and Demodulation 25 7 Observation (simulation) of signal constellations of BPSK, QPSK and QAM 29 8 Line coding schemes 33 9 FSK and PSK schemes (Simulation) 36 10 Simulation of DPSK 39 11 Error control coding schemes - Linear Block Codes (Simulation) 47 12 Communication link simulation 51 13 Equalization – Zero Forcing & LMS algorithms (simulation) 54
  • 4. 1 Exp-No: 01 Date: AIM: SIGNAL SAMPLING AND RECONSTRUCTION To perform the process of sampling for an analog signal and to reconstruct the sampled signals using pulse modulation techniques. APPARATUS REQUIRED: 1. Trainer kit 2. Patch Cords with inserting pins 3. Digital Storage Oscilloscope 4. DSO probes, Power chords. THEORY: In pulse modulation techniques, the message signal is modulated by some parameters of pulse train. These parameters are amplitude and width. Pulse amplitude modulation is defined as an analog modulation technique in which the signal is sampled at regular intervals such that each sample is proportional to the amplitude of the signal, at the instant of sampling. Pulse width modulation is defined as an analog modulation technique in which the width of each pulse is made proportional to the instantaneous amplitude of the signal at the sampling instant. PWM is also called as PDM/pulse division modulation. Sample and Hold circuits are used internally in Analog to Digital conversion. We might also use them to hold a given signal value from any particular sensor on a robot, for analysis and later use.The Sample and Hold circuit uses two buffers to keep a voltage level stored in a capacitor. Excellent Sample and Hold circuits like the LF398 are available on a single chip for cheap and easy use. PROCEDURE: 1. Connect the power cord of the trainer unit to AC 220V, 50 Hz supply. 2. Switch ON the trainer kit. The neon lamp will glow indicating that the unit is ready for operation. 3. Observe the waveforms of Modulating Signal Generator and Clock Signal Generator in an Oscilloscope. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 5. 2 4. Using patch cords, connect the Modulating Signal to the sockets marked ‗MOD INPUT; in the PWM Modulator. 5. Using patch cords, connect the Clock Signal to the sockets marked ‗CLOCK INPUT‘ in the PWM Modulator. 6. Vary the Modulating Signal & Clock Signal to obtain a Pulse Width Modulated Output across the sockets marked ‗PWMOUTPUT‘ 7. For reconstruction, connect the ‗PWM OUTPUT‘ from the Pulse Width Modulation to the sockets marked ‗PWM INPUT‗ in the Demodulation. 8. Observe the demodulated output waveform across sockets marked ‗DEMOD OUTPUT‘. MODEL GRAPH: PWM: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 6. 3 KIT DIAGRAM: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 7. 4 TABULATION: S.NO SIGNAL AMPLITUDE (V) TIME (s) 1. Modulating signal 2. Sampling Signal 3. Sampled Output 4. Reconstructed output GRAPH: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 8. 5 RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 9. 6 Exp-No: 2 Date: AIM: Simulation of TIME DIVISION MULTIPLEXING To Perform the simulation of time division multiplexing. THEORY: 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. Unlike FDM, TDM is immune to non linearity 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. In the circuit diagram the 555 timer is used as a clock generator. This timer is a highly stable device for generating accurate time delays. In this circuit this timer generates clock signal, which is of 100 KHz frequency (approximately). This clock signal is connected to the IC 7476.It divides the clock signal frequency into three parts and those are used as selection lines for multiplexer. Inbuilt signal generator is provided with sine, square and triangle outputs with variable frequency. These three signals can be used as inputs to the multiplexer. IC 4052 is a 4 to 1 Analog Multiplexer. It selects one-of-four signal sources as a result of unique three bit binary code at the select inputs. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 10. 7 SOFTWARE REQUIRED: MATLAB PROCEDURE: 1. Open MATLAB 2. Open new M-file 3. Type the program 4. Save in current directory 5. Compile and Run the program 6. For the output see command window Figure window PROGRAM: clc; closeall; clearall; % Signal generation x=0:.5:4*pi; % siganal taken upto 4pi sig1=8*sin(x); % generate 1st sinusoidal signal l=length(sig1); sig2=8*triang(l); % Generate 2ndtraingularSigal %DisplayofBothSignal subplot(2,2,1); plot(sig1); title('Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,2,2); plot(sig2); title('Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); %DisplayofBothSampledSignal subplot(2,2,3); stem(sig1); title('Sampled Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,2,4); stem(sig2); title('Sampled Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); l1=length(sig1); l2=length(sig2); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 11. 8 fori=1:l1 sig(1,i)=sig1(i); %MakingBothrowvectortoamatrix sig(2,i)=sig2(i); end % TDM ofboth quantize signal tdmsig=reshape(sig,1,2*l1); %DisplayofTDMSignal figure stem(tdmsig); title('TDM Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); % Demultiplexing of TDM Signal demux=reshape(tdmsig,2,l1); fori=1:l1 sig3(i)=demux(1,i); % Converting The matrix into row vectors sig4(i)=demux(2,i); end % display of demultiplexed signal figure subplot(2,1,1) plot(sig3); title('Recovered Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,1,2) plot(sig4); title('Recovered Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 12. 9 OUTPUT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 13. 10 RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 14. 11 Exp-No:3 Date: AIM AM MODULATION AND DEMODULATION To transmit a modulating signal after amplitude modulation using AM transmitter and receive the signal back after demodulating using AM receiver. APPARATUS REQUIRED: 1. AM transmitter trainer kit 2. AM receiver trainer kit 3. DSO 4. Patch cords THEORY: A continuous-wave goes on continuously without any intervals and it is the baseband message signal, which contains the information. This wave has to be modulated. According to the standard definition, ―The amplitude of the carrier signal varies in accordance with the instantaneous amplitude of the modulating signal.‖ Which means, the amplitude of the carrier signal containing no information varies as per the amplitude of the signal containing information, at each instant. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 15. 12 AMPLITUDE MODULATION: Amplitude Modulation is a process by which amplitude of the carrier signal is varied in accordance with the instantaneous value of the modulating signal, but frequency and phase of carrier wave remains constant. The modulating and carrier signal are given by Vm(t) = Vm sin� mt VC(t) = VC sin� Ct The modulation index is given by, ma = Vm / VC. Vm = Vmax – Vmin and VC = Vmax + Vmin The amplitude of the modulated signal is given by, VAM(t) = VC (1+ma sin� mt) sin� Ct Where Vm = maximum amplitude of modulating signal VC = maximum amplitude of carrier signal Vmax = maximum variation of AM signal Vmin = minimum variation of AM signal PROCEDURE: 1. The circuit wiring is done as shown in diagram 2. A modulating signal input given to the Amplitude modulator 3. Now increase the amplitude of the modulating signal to the required level. 4. The amplitude and the time duration of the modulating signal are observed using CRO. 5. Finally the amplitude modulated output is observed from the output of amplitude modulator stage and the amplitude and time duration of the AM wave are noted down. 6. Calculate the modulation index by using the formula and verify them. The final demodulated signal is viewed using an CRO at the output of audio power amplifier stage. Also the amplitude and time duration of the demodulated wave are noteddown. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 17. 14 TABULATION: UNDER MODULATION: Waveform Amplitude (V) Time Period (sec) Message Carrier Modulated Demodulated CRITICAL MODULATION: Waveform Amplitude (V) Time Period (sec) Message Carrier Modulated Demodulated OVER MODULATION: Waveform Amplitude (V) Time Period (sec) Message Carrier Modulated Demodulated COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 20. 17 Exp-No: 04 Date: AIM FREQUENCY MODULATION AND DEMODULATION To transmit a modulating signal after frequency modulation using FM transmitter and receive the signal back after demodulation using FM receiver. APPARATUS REQUIRED: 1. FM transmitter trainer kit 2. FM receiver trainer kit 3. DSO 4. Patch cords THEORY: Frequency modulation (FM) is a form of modulation that represents information as variations in the instantaneous frequency of a carrier wave. (Contrast this with amplitude modulation, in which the amplitude of the carrier is varied while its frequency remains constant.) In analog applications, the carrier frequency is varied in direct proportion to changes in the amplitude of an input signal. Shifting the carrier frequency among a set of discrete values can represent digital data, a technique known as frequency-shift keying. FM is commonly used at VHF radio frequencies for high-fidelity broadcasts of music and speech (see FM broadcasting). Normal (analog) TV sound is also broadcast using FM. A narrowband form is used for voice communications in commercial and amateur radio settings. The type of FM used in broadcast is generally called wide-FM, or W-FM. In two-way radio, narrowband narrow-fm (N-FM) is used to conserve bandwidth. In addition, it is used to send signals into space. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 21. 18 COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR FM is also used at intermediate frequencies by most analog VCR systems, including VHS, to record the luminance (black and white) portion of the video signal. FM is the only feasible method of recording video to and retrieving video from magnetic tape without extreme distortion, as video signals have a very large range of frequency components — from a few hertz to several megahertz, too wide for equalizers to work with due to electronic noise below -60 dB. FM also keeps the tape at saturation level, and therefore acts as a form of noise reduction, and a simple limiter can mask variations in the playback output, and the FM capture effect removes print-through and pre-echo. A continuous pilot-tone, if added to the signal — as was done on V2000 and many Hi-band formats — can keep mechanical jitter under control and assist time base correction. PROCEDURE: 1. The circuit wiring is done as shown in diagram 2. A modulating signal input given to the Frequency modulator 3. Now increase the modulated signal to the required level. 4. The amplitude and the time duration of the modulating signal are observed using CRO. 5. Finally the frequency modulated output is observed from the output of frequency modulator stage and the amplitude and time duration of the FM wave are noteddown.
  • 22. 19 t (sec) Model Graph: Frequency Modulation : Demodulated Signal COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR t (sec) t (sec) t (sec) Amplitude (V) Amplitude (V)
  • 23. 20 KIT DIAGRAM: Frequency Modulation : COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 24. 21 FM Demodulation: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 25. 22 TABULATION: Waveform Amplitude (V) Time Period (sec) Message Carrier Modulated Demodulated GRAPH: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 27. 24 Exp-No: 05 Date: AIM Pulse Code Modulation and Demodulation To perform the operation of Pulse Code Modulation and demodulation and observe the output waveforms. APPARATUS REQUIRED PCM kit, Power supply, DSO and connecting probes THEORY Pulse code modulation is a process of converting an analog signal into digital. The voice or any data input is first sampled using a sampler (which is a simple switch) and then quantized. Quantization is the process of converting a given signal amplitude to an equivalent binary number with fixed number of bits. This quantization can be either midtread or mid-raise and it can be uniform or non-uniform based on the requirements. For example in speech signals, the higher amplitudes will be less frequent than the low amplitudes. So higher amplitudes are given less step size than the lower amplitudes and thus quantization is performed non-uniformly. After quantization the signal is digital and the bits are passed through a parallel to serial converter and then launched into the channel serially. At the demodulator the received bits are first converted into parallel frames and each frame is de-quantized to an equivalent analog value. This analog value is thus equivalent to a sampler output. This is the demodulated signal. PROCEDURE: 1. Make connections as shown in the circuit diagram. 2. Set the input signal and carrier signal. 3. Obtain PCM signal 4. Tabulate the output data and draw the graph. 5. Justify the obtained output COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 28. 25 KIT DIADRAM: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 29. 26 MODEL GRAPH: TABULATION: Waveform Amplitude (V) Time Period (sec) Message Carrier Modulated Demodulated COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 31. 28 Exp-No: 06 Date: DELTA MODULATION AND DEMODULATION AIM To study and to plot the characteristics of Delta modulation and demodulation. APPARATUS REQUIRED: DM kit, Power supply, DSO and connecting probes THEORY: Delta modulation is the DPCM technique of converting an analog message signal to a digital sequence. The difference signal between two successive samples is encoded into a single bit code. It is a one - bit version of differential pulse code modulation, it provides staircase approximation for the given input baseband signal. The difference between the input and staircase approximation is quantized into two levels called, ± ∆.A comparator senses whether or not the instantaneous level of the analog input signal is greater or less than the feedback signal (staircase approximation). The comparator output is clocked by a flip flop to form a continuous NRZ digital data stream. This digital data is converted back to analog staircase signal using DAC and feed to the comparator. The feedback signal never stands still; it always travels up or down by a fixed amount (± ∆ ) in any clock period. Because of its fixed feedback output slope, the linear delta modulator is less than ideal for encoding human voice, also the accumulator (or) feedback section cannot track large, high frequency signals with its fixedslope. The delta demodulator is a simple one which have only feedback system of delta modulator and a low-pass filter. The demodulator recovers staircase approximation from the encoded signal and which will be smoothened by a low pass filter to get back original analog information. . COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 32. 29 KIT DIAGRAM: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 33. 30 PROCEDURE: 1. Make connections as shown in the circuit diagram. 2. Set the input signal and carrier signal. 3. Obtain DM signal 4. Tabulate the output data and draw the graph. 5. Justify the obtained output . MODEL GRAPH: TABULAR COLUMN: Name of the signal Amplitude in V Time period in Sec Modulating Signal Carrier Signal Modulated Signal Demodulated Signal COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 34. 31 GRAPH: RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 35. 32 Exp-No: 07 Date: LINE CODING SCHEMES AIM To study about different line coding schemes. SOFTWARE USED: MATLAB THEORY: NON-RETURN TO ZERO signal are the easiest formats that can be generated. These signals do not return to zero with the clock. The frequency component associated with these signals are half that of the clock frequency. The following data formats come under this category. Non-return to zero encoding is commonly used in slow speed communications interfaces for both synchronous and asynchronous transmission. Using NRZ, logic 1 bit is sent as a high value and logic 0 bit is sent as a low value. a) NON-RETURN TO ZERO-LEVEL (NRZ-L) This is the most extensively used waveform in digital logics. All „ones‟ are represented by „high‟ and all „zeros‟ by „low‟. The data format is directly available at the output of all digital data generation logics and hence very easy to generate. Here all the transitions take place at the rising edge of the clock. b) NON-RETURN TO ZERO-MARK (NRZ-M) These waveforms are extensively used in tape recording. All „ones‟ are marked by change in levels and all‟zeros‟ by no transitions, and the transitions take place at the rising edge of the clock. c) NON-RETURN TO ZERO-SPACE (NRZ-S) This type of waveform is marked by change in levels for „zeros‟ and no transition for „ones‟ and the transitions take place at the rising edge of the clock. This format is also used in magnetic tape recording. d) UNIPOLAR AND BIPOLAR Unipolar signals are those signals, which have transition between 0 to +VCC. Bipolar signals are those signals, which have transition between +VCC to –VCC. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 36. 33 e) BIPHASE – LINE CODING (BIPHASE -L): With the Biphase – L 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. f) 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, half bit later, whereas a zero has no second transition. g) BIPHASE SPACE CODING(BIPHASE-S): With a Biphase-S, a transition occurs at the beginning of every bit interval. A „zero‟ is marked by a second transition, one half bit later; „one‟ has no second transition. h) 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); With the URZ a „one‟ is represented by a half bit wide pulse and a „zero‟ is represented by the absence of pulse. i) MULTILEVEL SIGNALS: Multilevel signals use three or more levels of voltages to represent the binary digits, „one‟ and „zero‟ – instead of normal „highs‟ and „lows‟ Return to zero – alternative mark inversion (RZ - AMI) is the most commonly used multilevel signal. This coding scheme is most often used in telemetry systems. In this scheme, „one‟ are represented by equal amplitude of alternative pulses, which alternate between a +5 and -5. These alternating pulses return to 0 volt, after every half bit interval. The‖Zeros‟ are marked by absence of pulses. PROCEDURE: 1. Open MATLAB 2. Open new M-file 3. Type the program 4. Save in current directory 5. Compile and Run the program 6. For the output see command window Figure window COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 37. 34 PROGRAM: clc; close all; clear all; x=[1 0 1 1 0 1]; nx=size(x,2); sign=1; i=1; while i<nx+1 t = i:0.001:i+1-0.001; if x(i)==1 unipolar_code=square(t*2*pi,100); polar_code=square(t*2*pi,100); bipolar_code=sign*square(t*2*pi,100); sign=sign*-1; manchester_code=-square(t*2*pi,50); else end unipolar_code=0; polar_code=-square(t*2*pi,100); bipolar_code=0; manchester_code=square(t*2*pi,50); subplot(4,1,1); plot(t,unipolar_code); ylabel('unipolar code'); hold on; grid on; axis([1 10 -2 2]); subplot(4,1,2); plot(t,polar_code); ylabel('polar code'); hold on; grid on; axis([1 10 -2 2]); subplot(4,1,3); plot(t,bipolar_code); ylabel('bipolar code'); hold on; grid on; axis([1 10 -2 2]); subplot(4,1,4); plot(t,manchester_code); ylabel('manchester code'); hold on; grid on; axis([1 10 -2 2]); i=i+1; end COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 39. 36 Exp-No: 8 Date: Simulation of ASK, FSK, BPSK generation schemes AIM : To study simulation of ASK, FSK, BPSK techniques. SOFTWARE USED: MATLAB PROCEDURE: 7. Open MATLAB 8. Open new M-file 9. Type the program 10. Save in current directory 11. Compile and Run the program 12. For the output see command window Figure window PROGRAM: ASK generation: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 40. 37 clc; clear all; close all; %GENERATE CARRIER SIGNAL Tb=1; fc=10; t=0:Tb/100:1; 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=zeros(1,length(t)); end message(i,:)=m_s; %product of carrier and message ask_sig(i,:)=c.*m_s; t1=t1+(Tb+.01); t2=t2+(Tb+.01); %plot the message and ASK signal subplot(5,1,2); axis([0 N -2 2]); plot(t,message(i,:),'r'); title('message signal'); xlabel('t--->'); ylabel('m(t)');grid on hold on subplot(5,1,4); plot(t,ask_sig(i,:)); title('ASK signal'); xlabel('t--->'); ylabel('s(t)'); grid on hold on end hold off %Plot the carrier signal and input binary data subplot(5,1,3);plot(t,c); title('carrier signal'); xlabel('t--->');ylabel('c(t)'); grid on subplot(5,1,1);stem(m); title('binary data bits'); xlabel('n--->');ylabel('b(n)'); grid on BPSK MODULATION clc; COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 41. 38 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 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); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 42. 39 title('carrier signal'); xlabel('t--->');ylabel('c(t)'); grid on; 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 COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 43. 40 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; OUTPUT: ASK modulation COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 44. 41 BPSK modulation COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 45. 42 FSK modulation COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 46. 43 RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 47. 44 Exp-No: 09 Date: Simulation of DPSK, QPSK AND QAM generation schemes AIM: To write a program in MATLAB for design of DPSK, QPSK, QAM. SOFTWARE USED: MATLAB PROCEDURE: 1. Open MATLAB 2. Open new M-file 3. Type the program 4. Save in current directory 5. Compile and Run the program 6. For the output see command window Figure window PROGRAM: DPSK: clear all; close all; i=10; j=5000; a=round(rand(1,i)); t=linspace(0,10,j); fc=5; SNR=10; st1=t; for n=1:10 for m=j/i*(n-1)+1:j/i*n COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 48. 45 if a(n)<1 st1(m)=0; else st1(m)=1; end end end figure(1) subplot(211) plot(t,st1); title('Original Input Bit'); axis([0,10,-1,2]); b=zeros(1,i); b(1)=a(1); for n=2:10 if a(n)==1 if b(n-1)==1 b(n)=0; else b(n)=1; end else b(n)=b(n-1); end end st2=t; for n=1:10 for m=j/i*(n-1)+1:j/i*n if b(n)==0 st2(m)=0; COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 49. 46 else st2(m)=1; end end end subplot(212); plot(t,st2); title('Differentially Encoded Bitstream'); axis([0,10,-1,2]); st3=t; for n=1:j if st2(n)==1 st3(n)=0; else st3(n)=1; end end figure(2) subplot(311); plot(t,st3); title('Inverse of Differentially Encoded Bitstream') axis([0,10,-1,2]); s1=sin(2*pi*fc*t); subplot(312) plot(t,s1); axis([0,10,-2,2]); title('Carrier for Differentially Encoded Bitstream ') s2=-s1; subplot(313) plot(t,s2); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 50. 47 axis([0,10,-2,2]); title('Carrier for Inverse of Differentially Encoded Bitstream ') d1=st2.*s1; d2=st3.*s2; figure(3); subplot(311); plot(t,d1); axis([0,10,-2,2]); title('DPSK of Differentially Encoded Bitstream') subplot(312) plot(t,d2); axis([0,10,-2,2]); title('DPSK of Inverse of Differentially Encoded Bitstream') e_dpsk=d1+d2; subplot(313) plot(t,e_dpsk); axis([0,10,-2,2]); title('DPSK Waveform') awgn_dpsk=awgn(e_dpsk,SNR,'measured','dB'); figure(4) subplot(311) plot(t,awgn_dpsk); axis([0,10,-2,2]); title('DPSK waveform with AWGN') [B1,A1]=butter(1,[3/(500/2) 7/(500/2)]); awgn_dpsk1=filter(B1,A1,awgn_dpsk); subplot(312); plot(t,awgn_dpsk1); axis([0,10,-2,2]); title('Bandpass matched Filter output'); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 51. 48 dem_dpsk=awgn_dpsk1.*sin(2*pi*fc*t); subplot(313) plot(t,dem_dpsk); axis([0,10,-2,2]); title('Demodulated DPSK Waveform') [b1,a1]=butter(1,2/(500/2),'low'); al_dpsk=filter(b1,a1,dem_dpsk); figure(5) subplot(311) plot(t,al_dpsk); axis([0,10,-2,2]); title('Low Pass Filter Output') st=zeros(1,i); for m=0:i-1 for j=m*500+1:(m+1)*500 if al_dpsk(1,m*500+250)<0 st(m+1)=0; else st(m+1)=1; end end end dpsk=zeros(1,j); for m=0:i-1 for j=m*500+1:(m+1)*500 if al_dpsk(1,j)<0 dpsk(1,j)=0; else dpsk(1,j)=1; end COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 52. 49 end end subplot(312); plot(t,dpsk); axis([0,10,-1,2]); title('Differentially Decoded Bitstream') error=dpsk-st2; error=abs(error); errorrate=sum(error)/5000 dt=zeros(1,i); dt(1)=st(1); for n=2:10 if (st(n)-st(n-1))<=0&&(st(n)-st(n-1))>-1 dt(n)=0; else dt(n)=1; end end st=t; for n=1:10 if dt(n)<1; for m=j/i*(n-1)+1:j/i*n st(m)=0; end else for m=j/i*(n-1)+1:j/i*n st(m)=1; end end end COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 53. 50 subplot(313) plot(t,st); title('Retrieved Bitstream'); axis([0,10,-1,2]) QPSK: QPSK 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 21 m(i+1)=1; 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); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 54. 51 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); title('carrier signal-2');xlabel('t --->');ylabel('c2(t)');grid on; subplot(3,2,3);plot(t,c2); 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; QAM code t=0:0.0001:1; %Message 1 m1=cos(2*pi*50*t); %Message 2 m2=sin(2*pi*100*t); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 55. 52 %Carrier c1=cos(2*pi*1000*t); %Quadrature Carrier c2=sin(2*pi*1000*t); mod1=m1.*c1; mod2=m2.*c2; mod=mod1+mod2; subplot(5,1,1) plot(t,m1); title('Message 1'); subplot(5,1,2) plot(t,m2); title('Message 2'); subplot(5,1,3) plot(t,mod); title('Modulated Signal'); %Demodulation with Carrier demod1=mod.*c1; %Demodulation with Quadrature Carrier demod2=mod.*c2; [a b]=butter(5,2*55*0.0001); msg1=filter(a,b,demod1); [a b]=butter(5,2*105*0.0001); msg2=filter(a,b,demod2); subplot(5,1,4) plot(t,msg1); title('Message 1 retrieved'); subplot(5,1,5) plot(t,msg2); title('Message 2 retrieved'); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 56. 53 OUTPUT: DPSK: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 58. 55 QAM: RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 59. 56 Exp-No: 10 Date: SIMULATION OF SIGNAL CONSTELLATIONS OF BPSK, QPSK AND QAM AIM: To write a program in MATLAB for design of BPSK, QPSK, QAM. SOFTWARE USED: MATLAB PROCEDURE: 1. Open MATLAB 2. Open new M-file 3. Type the program 4. Save in current directory 5. Compile and Run the program 6. For the output see command window Figure winDOW COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 60. 57 PROGRAM: % Setting up parameters for modulation type data = randint(1000,1,[1,0]); % generating binary data of 1000 bits with ones and zeros mod_type=input('Enter the modulation type[1 for BPSK,2 for QPSK,3 for 16QAM,4 for 64QAM]: '); norm_factor=[1.0;0.7071;0.3162;0.1543]; % normalization factors, 1.0:BPSK,0.7071:QPSK,0.3162:16QAM,0.1543:64QAM nc=[1;2;4;6]; % number of bits per subcarrier, 1:BPSK,2:QPSK,4:16QAM,6:64QAM input_seq = data; k=norm_factor(mod_type); mode=nc(mod_type); % Selecting constellation point as per modulation type switch mode case 1 b=k*[1 -1]; case 2 b=k*[1+1i -1+1i 1-1i -1-1i]; case 4 b=k*[1+1i 1+3i 1-1i 1-3i 3+1i 3+3i 3-1i 3-3i -1+1i -1+3i -1-1i -1-3i -3+1i - 3+3i -3-1i -3-3i]; end count=1; count1=1; for i=1:(ceil(length(input_seq)/mode)) temp=0; for j=1:mode temp=bitor(temp,bitshift(input_seq(count),(j-1))); count=count+1; if(count>length(input_seq)) break; end end map_out(count1)=b(temp+1); count1=count1+1; end figure;plot(real(map_out),imag(map_out),'r.');title('constellation'); COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 61. 58 OUTPUT: BPSK: QPSK: QAM: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 63. 60 Exp-No: 11 Date: AIM : Simulation of ASK, FSK, BPSK detection schemes To study simulation of ASK, FSK, BPSK detection techniques. SOFTWARE USED: MATLAB PROCEDURE: 1. Open MATLAB 2. Open new M-file 3. Type the program 4. Save in current directory 5. Compile and Run the program 6. For the output see command window Figure window COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 64. 61 PROGRAM: ASK DEMODULATION t1=0;t2=Tb for i=1:N t=[t1:Tb/100:t2] %correlator x=sum(c.*ask_sig(i,:)); %decision device if x>0 demod(i)=1; else demod(i)=0; end t1=t1+(Tb+.01); t2=t2+(Tb+.01); end %plot demodulated binary data bits subplot(5,1,5);stem(demod); title('ASK demodulated signal'); xlabel('n--->');ylabel('b(n)'); grid on BPSK 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 COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 65. 62 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; OUTPUT: ASK demodulation COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 66. 63 PSK demodulation COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 67. 64 FSK demodulation RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 68. 65 Exp-No: 12 Date: SIMULATION OF LINEAR BLOCK AND CYCLIC ERROR CONTROL CODING SCHEMES AIM : To study simulation of error control coding schemes - linear block and cyclic code techniques. SOFTWARE USED: MATLAB PROGRAM: LINEAR CODE: clc; clear all; % Input Generator Matrix g=input('Enter The Generator Matrix: ') disp ('G = ') disp ('The Order of Linear block Code for given Generator Matrix is:') [n,k] = size(transpose(g)) 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 end end u; disp('The Possible Codewords are :') c = rem(u*g,2) disp('The Minimum Hamming Distance dmin for given Block Code is= ') d_min = min(sum((c(2:2^k,:))')) % Code Word COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 69. 66 r = input('Enter the Received Code Word:') p = [g(:,n-k+2:n)]; h = [transpose(p),eye(n-k)]; disp('Hammimg Code') ht = transpose(h) disp('Syndrome of a Given Codeword is :') s = rem(r*ht,2) for i = 1:1:size(ht) if(ht(i,1:3)==s) r(i) = 1-r(i); break; end end disp('The Error is in bit:') i disp('The Corrected Codeword is :') r CYCLIC ERROR CONTROL CODE: clc; clear all; close all; n=7; k=4; genpoly=cyclpoly(n,k,'max'); berf=[]; for i=1:10 b=0; for j=1:50 msg=randint(500,k,[0,1]); code=encode(msg,n,k,'cyclic/binary',genpoly); t=0:0.1:10; snr=0; y=awgn(code,i); y(find(y>0))=1; y(find(y<0))=1; msgop=decode(y,n,k,'cyclic/binary',genpoly); [number,b1]=biterr(msgop,msg); b=b+b1; end berf(i)=b/50; end COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 70. 67 semilogy(1:10,berf); title('performance analysis in awgn for cyclic codes'); xlabel ('snr (db)'); ylabel ('BER'); OUTPUT: Enter The Generator Matrix: [1 0 0 0 1 0 1;0 1 0 0 1 1 1;0 0 1 0 1 1 0;0 0 0 1 0 1 1] g = 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 1 G = The Order of Linear block Code for given Generator Matrix is: n =7 k =4 The Possible Codewords are : c = 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 1 1 0 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 1 1 The Minimum Hamming Distance dmin for given Block Code is= d_min =3 COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 71. 68 Enter the Received Code Word:[1 0 0 0 1 0 0] r =1 0 0 0 1 0 0 Hammimg Code ht =1 0 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 Syndrome of a Given Codeword is : s = 0 0 1 The Error is in bit: i = 7 The Corrected Codeword is : r = 1 0 0 0 1 0 1 OUTPUT FOR CYCLIC CODE: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 73. 70 Exp.No:13 Date: AIM: Simulation of Convolutional coding scheme To study the simulation of convolutional coding scheme. COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUE OF TECHNOLOGY III YEAR
  • 74. 71 SOFTWARE REQUIRED: MATLAB PROCEDURE: 1. Open MATLAB 2. Open new M-file 3. Type the program 4. Save in current directory 5. Compile and Run the program 6. For the output see command window Figure window PROGRAM: function [Conv_out] = conv_encoder(Conv_In) Conv_In= [1 1 0 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 0]; % x=[1 0 1 1 0 0 0]; m1=0; m2=0; m3=0; m4=0; %m_in m1 m2 m3 m4 %[1 0 1 0 1] =x0 %[1 1 0 1 1] =x1 %[1 1 1 1 1] =x2; for k = 1:length(Conv_In) % 1st polynomial % x0= [1 0 1 0 1] m_in = Conv_In(k); temp1 = bitxor(m_in,m2); x0 = bitxor(temp1,m4); % 2nd polynomial temp1 = bitxor(m_in,m1); temp2 = bitxor(temp1,m3); x1 = bitxor(temp2,m4); %3rd polynomial temp1 = bitxor(m_in,m1); temp2 = bitxor(temp1,m2); temp3 = bitxor(temp2,m3); x2 = bitxor(temp3,m4); Conv_out((3*k)-2) = x0; Conv_out((3*k)-1) = x1; Conv_out(3*k) = x2; %%%Shifiting m4=m3; m3=m2; m2=m1; m1=m_in; end
  • 75. 72 OUTPUT: ans = Columns 1 through 15 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 Columns 16 through 30 1 0 1 1 1 1 0 0 1 0 0 1 0 0 0 Columns 31 through 45 0 0 1 0 0 1 1 1 1 1 0 1 1 1 1 Columns 46 through 60 0 0 1 0 0 1 1 1 1 1 0 1 0 0 0
  • 76. 73 RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 77. 74 Exp-No: 14 Date: AIM: COMMUNICATION LINK SIMULATION To design a Model for establishing communication link using Simulink. SOFTWARE USED: MATLAB PROCEDURE: 1. Open the MATLAB Software. 2. Click on the Simulink icon. In that window select File -new Model to create your model 3. Select the components required for your design from the Simulink library. 4. After saving the design, click on the Run button to view the output. CIRCUIT DIAGRAM: THEORY: A Communication can be established by the transmission of signals between two entities through a communication channel. A binary generator is used as a source of signal which will be producing signals in terms of ones and zeros. Here Hamming encoder is used for encoding the COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 78. 75 signal and the encoded signal is further modulated by using the QPSK modulator, after which the signal is transmitted through a channel, where there are the possibilities of addition of noise. By selecting a Hamming decoder and QPSK demodulator the source signal without any distortion is recovered back, which is shown at the output. OUTPUT: Source Signal Signal before Transmission Signal After Passing Through Signal Received Communication Channel COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR
  • 79. 76 RESULT: COMMUNICATION SYSTEMS LAB MANUAL JANSONS INSTITUTE OF TECHNOLOGY III YEAR