0% found this document useful (0 votes)
5 views

CS Lab

This experiment aims to study delta modulation and demodulation using a 1KHz sine signal. Delta modulation is an analog-to-digital conversion technique where the signal is compared with a reference and the difference or error is transmitted. The output of the demodulator is then compared with the previous value to reconstruct the original signal.

Uploaded by

Tharcis Paulraj
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

CS Lab

This experiment aims to study delta modulation and demodulation using a 1KHz sine signal. Delta modulation is an analog-to-digital conversion technique where the signal is compared with a reference and the difference or error is transmitted. The output of the demodulator is then compared with the previous value to reconstruct the original signal.

Uploaded by

Tharcis Paulraj
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 85

CHRISTIAN COLLEGE OF ENGINEERING AND TECHNOLOGY

ODDANCHATRAM- 624619

Department of Electronics & Communication Engineering

EC3461 –COMMUNICATION SYSTEMS LABORATORY

RECORD NOTE BOOK

REGISTER NO:

Certified that it is a bonafide record of practical lab

work done by during the year

STAFF – INCHARGE HEAD OF THE DEPARTMENT

Submitted for the practical exam held on

Internal Examiner External Examiner

1
2
INDEX

Date Page Marks Signature


S. No. Name of the Experiment
No.
CYCLE-I
1 Signal Sampling and reconstruction

2 Time Division Multiplexing

3 FM Modulator and Demodulator

4 Pulse Code Modulation and Demodulation

5 Delta Modulation and Demodulation

6 Line coding schemes

CYCLE-II
7 Simulation of ASK , FSK , and BPSK
generation and detection schemes

8 Simulation of DPSK, QPSK and QAM generation


schemes

9 Simulation of signal constellations of BPSK,


QPSK and QAM

10 Simulation of Linear Block and Cyclic error


control coding schemes
11 Simulation of Convolutional coding scheme

12 Communication link simulation

3
4
CYCLE-I

EXPERIMENTS

5
BLOCKDIAGRAM:

6
EXPT NO: 1
DATE:

SIGNAL SAMPLING AND RECONSTRUCTION

AIM:

To study signal sampling & its reconstruction using natural sampling , sample
& hold technique.

APPARATUS REQUIRED:
 Sampling&itsreconstructionkit-DCT001
 Power supply
 Patch chords
 CRO

THEORY:

Sampling is the process by which continuous time signal is converted into


discrete time signal. It is the fundamental operation of converting analog signal to
digital signal. Sampling theorem states that a continuous time signal can be
completely represented in its samples & recovered back if the sampling frequency
is twice of the highest frequency content of the signal.

7
MODEL GRAPH:

TABULATION:

Time period
S. No Name of the signal Amplitude in V In M Sec
1 CARRIER SIGNAL
2 ANALOG SIGNAL
3 SAMPLED SIGNAL(1)

4 SAMPLED SIGNAL(2)

5 RECOSTRUCTED
SIGNAL(1)
6 RECOSTRUCTED
SIGNAL(2)

8
PROCEDURE:

 Connect the 2KHZ -5vp-p signal generated on board to the


ANALOG INPUT by means of patch chords.

 Connect the sampling frequency in the internal mode by means


of shorting p in provided.

 Observe the output of sampling amplifier at SAMPLE OUTPUT

 Connect SAMPLE OUTPUT to the INPUT of the sixth order LPF

 The reconstructed signal can be obtained as filter output & it can


be observed through CRO
 Observe the output of sample & hold at s60 rs7.
 Connect SAMPLE OUTPUT to the INPUT of the fourth order LPF
 The reconstructed signal can be obtained as filter output & it can
be observed through CRO

RESULT:

Thus the signal sampling & reconstruction using natural sampling technique
was studied & its output was verified.

9
BLOCK DIAGRAM:

10
EXPT NO: 2
DATE:
TIME DIVISION MULTIPLEXING

AIM:
To perform the Time Division Multiplexing and De-multiplexing using Pulse
Amplitude Modulation.

APPARATUS REQUIRED:
 TDMTrainerkit–x1-02
 Patch Chords
 Power supply
 CRO

THEORY:

In Time Division Multiplexing, the narrow pulses with wide spaces between
them can be used by signals from other sources. Moreover, although the spaces are
fixed in width, pulses may be made as narrow as desired.
Four input signals, all band-limited to Fs by the input filters are sequentially
sampled at the transmitter by a rotary switch. The switch makes Fs revolutions per
second and extracts one sample from each input during each revolution. The
outputattheswitchisaPAMwaveformcontainingsamplesoftheinputsignalsperiodically
interlaced in time. The samples from adjacent input message channel were
separated by Ts/M, where M is the number of input channels. A set of M pulses
consisting of one sample from each of the M-input channels is called frame.

11
MODEL GRAPH:

TABULATION
Time period in
S. No Name of the signal Amplitude in V M Sec
1 MESSAGE SIGNAL1
2 MESSAGE SIGNAL2

3 TDM SIGNAL

4 DEMULTIPLEXED SIGNAL1

5 DEMULTIPLEXED SIGNAL2

12
PROCEDURE:
 Connect the four channel inputs 250Hz, 500Hz, 1KHz, 2KHz to the input
of transmitter CH0,CH1,CH2,CH3 respectively.
 Connect the Power supply to kit.

 Observe the Time Division Multiplexed PAM wave format the output of
the Multiplexer(TXD).
 Observe the four different signals placed in their respective timeslots.
 There constructed signals can be obtained from the filter at receiver section.
 Note readings for 2 different channels & plot graph.

RESULT:

Thus the Time Division Multiplexing and De-multiplexing using Pulse Amplitude
Modulation is performed & the signals are reconstructed at the receiver .

13
BLOCK DIAGRAM:

14
EXPT NO: 3
DATE:
FM MODULATOR AND DEMODULATOR

AIM:
To perform frequency modulation & demodulation
APPARATUS REQUIRED:
 Experiment kit ACLT-002
 Patch Chords
 Power supply
 CRO

THEORY:

Frequency modulation (FM) is a form of analog modulation that


representsinformationasvariationsintheinstantaneousfrequencyofacarrierwave.Inanaloga
pplications, the carrier frequency is varied in direct proportion to changes in the
amplitude of an input signal. This type of modulation is used in radio broadcasting .

15
MODEL GRAPH:

TABULATION:
Time period in
S. No Name of the signal Amplitude in V ms
1 MESSAGE SIGNAL
2 CARRIER SIGNAL
3 FREQUENCY
MODULATED SIGNAL
4 FREQUENCY
DEMODULATED SIGNAL

16
PROCEDURE:

 Connections are given as shown in the block diagram.

 Connect the power supply to kit

 Carrier signal output is obtained at S04.

 Message signal output is obtained at S01.

 Frequency modulated signal is obtained at S04 after modulation


& demodulated signal is obtained at S06.

RESULT:

Thus the frequency modulation & demodulation process is completed &


the output wave is obtained.

17
BLOCK DIAGRAM:

18
EXPT NO: 4
DATE:

PULSE CODE MODULATION AND DEMODULATION

AIM:
To study the principle of Pulse Code Modulation with the help of channel
TDM, sampling of analog signal, A/D,D/A conversion.

APPARATUS REQUIRED:
 Experiment kitDCL-03&DCL-04
 Patch Chords
 Power supply
 CRO

THEORY:

In PCM the message signal is represented by sequence of coded pulses. The


transmitter section consists of sampler, quantizer, encoder, parallel to serial
converter. The receiver section consists of serial to parallel converter, D/A, LPF.

19
MODELGRAPH:
MESSAGE SIGNAL

CLOCK SIGNAL

PCM MULTIPLEXED SIGNAL

A(V)

DE MULTIPLEXED SIGNAL

TIME (MS)

TABULATION
Time period in
S .No Name of the signal Amplitude in V MS
1 MESSAGE SIGNAL

2 TRANSMITTED DATA

3 RECEIVED DATA

4 RECOSTRUCTED SIGNAL

20
PROCEDURE:
 Connect the power supply in proper polarity to the kits DCL-03, DCL -
04&switch it on.

 Connect 500hz, 1khz signal of FG to CH0, CH1 of Sample & Hold circuit
OUT0, OUT1 are multiplexed & pulse code modulated.
 Transmitter output can be viewed at MUXOUT.
 TX DATA, TXCLK, TXSYNC signals are connected to RXDATA,
RXCLK, RXSYNC for proper transmission & synchronization.
 Receiver output can be obtained at CH0 & CH1.
 Keep SW1 in fast mode.
 Note the readings for one signal & plot the graph.

RESULT:

Thus the principle of Pulse Code Modulation with the help of channel
TDM, sampling of analog signal, A/D, D/A conversion is studied & the outputs are
plotted .

21
BLOCK DIAGRAM:

22
EXPTNO: 5
DATE:
DELTAMODULATIONANDDEMODULATION
AIM:
To implement the principle of delta modulation and demodulation using 1KHz
sine signal.

APPARATUSREQUIRED:
 Delta modulation & demodulation trainer Kit-VCT-32
 CRO
 Patch chords and probe

THEORY:
Delta modulation is the process of quantizing the difference between analog
information signal and integrated signal of one bit quantize output. The integrator
Output is the approximation of analog input signal. The delta modulated output will be one for rising
portion of input signal & zero for falling portion of input signal.

23
TABULATION:

S. No Name of the signal Amplitude in V Time period in ms


1 INPUT SIGNAL

2 STAIRCASESIGNAL

3 DELTAMODULATED
SIGNAL
4 DELTADEMODULATED
SIGNAL

24
PROCEDURE:
1. Connect the test points P1 to P7, P3 to P11 and P10 to P23 using patch chords.

2. Ensure that all switches in switched faults block in OFF position and
all potentiometers POT1, POT2 & POT3 in minimum position.

3. Obtain the input signal at test point P1 using CRO & set sine wave amplitude to
3Vpp and note down the readings.

4. Obtain the staircase signal with respect to input signal at test point P8.

5. The delta modulated signal is obtained at test point P10.

5. The demodulated signal is obtained at test point P38.

6. Plot the graph for all noted readings.

RESULT:
Thus the implementation of principle of delta modulation and demodulation using 1KHz
sine signal is completed & the readings are plotted in linear graph.

25
BLOCK DIAGRAM: NRZ-L

26
EXPTNO: 6
DATE:
LINE CODINGSCHEMES
AIM:
To learn various line coding schemes such as NRZ-L, NRZ-M, BIO-L, BIO-M, URZ

APPARATUS REQUIRED:
 Trainer Kit- DCL-05&06
 CRO
 Patch chords and probe

THEORY:
NON-RETURN TO ZERO-LEVEL (NRZ-L):
The data format is very simple where all ‘ones’ are represented by ‘high’ & all ‘zeros’ by
‘low’.

NON-RETURN TO ZERO-MARK (NRZ-M):


In this data format all ‘ones’ are marked by change in levels & all ‘zeros’ by no
transitions.

BIPHASE-LINE CODING (BIO-L):


In this data format ‘one’ is represented by half bit wide pulse positioned during first half
of bit interval & ‘zero’ is represented by half bit wide pulse positioned during second half of bit
interval.

BIPHASE-MARK CODING (BIO-M):


In this data format ‘one’ is represented by a second transition, half bit later & ‘zero’ has
no second transition.

UNIPOLAR RETURN TO ZERO:


In this data format ‘one’ is represented by half bit wide pulse &‘zero’ by absence of a
Pulse

27
BLOCK DIAGRAM: NRZ-M

28
29
BLOCK DIAGRAM: BIO-L

30
31
BLOCK DIAGRAM: BIO-M

32
33
BLOCK DIAGRAM : URZ

34
PROCEDURE:
 Make connections as shown in block diagram.

 Connect CLOCK & DATA generated on DCL-05 to CODING CLOCK IN & DATA
INPUT respectively.

 Connect DCL-05 output to DCL-06 input for corresponding data format.

 Obtain the output from OUT4 of DCL-06 by adjusting SW2 to get corresponding data
format.

35
MODEL GRAPH:

TABULATION:

S. No Name of the signal Amplitude in V Time period in ms


1 CARRIER SIGNAL

2 DATA SIGNAL

3 (NRZ-L) SIGNAL

4 (NRZ-M) SIGNAL

5 (BIO-L) SIGNAL

6 (BIO-M) SIGNAL
7 URZ SIGNAL

36
RESULT:
Thus the various line coding schemes such as NRZ-L, NRZ-M, BIO-L, BIO-M, URZ
are learn & graphs are plotted.

37
CYCLE-II

EXPERIMENTS
FLOW CHART

START

GENERATEMODULATINGAND
CARRIERSIGNAL

PERFORMAMMODULATION&DEMODU
LATION

PLOTTHEAM
MODULATED
&DEMODULATE
DWAVEFORMS.

STOP
EXPT NO: 7

DATE:

SMULATIONOFAMPLITUDEMAODULATIONANDDEMODULATION

AIM:

To write MATLAB code to perform Amplitude modulation & demodulation

APPARATUS REQUIRED:

 PC loaded with MATLAB software

ALGORITHM:

 Generate Modulating And Carrier Signal


 Perform Am Modulation & Demodulation

 Plot The Am Modulated Wave


 Plot The Am Demodulated Wave
OUTPUT: AM

Message Signal
1

-1
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
AM Modulated Output
1

-1
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
AM De Modulated Output
2

-2
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
PROGRAM: AM

Fs=800;%Samplingrateis8000samplespersecond.
Fc=10;%CarrierfrequencyinHz
t=[0:5*Fs]'/Fs;%Samplingtimesfor.1secondx=
sin(2*pi*t);%Representationofthe signal
y=ammod(x,Fc,Fs);
%Modulatextoproducey.subplot(3,1,1);
plot(t,x);title('MessageSignal');%Plot
xontop.subplot(3,1,2);
plot(t,y);title('AMModulatedOutput');
%Plotyontop.z=amdemod(y,Fc,Fs);
subplot(3,1,3);
plot(t,z);title('AMDeModulatedOutput');%Plotyontop

RESULT:

Thus the MATLAB code to perform Amplitude modulation & demodulation is


written & the output is obtained.
FLOW CHART:

START

ENTERINPUTBINARYDATA

SETCF1&CF2

PERFORMAK, FSK& PSKMODULATION&DEMODULATION

PLOTTHEAK, FSK&PSK
MODULATED &DEMODULATEDWAVEFORMS.

STOP
EXPTNO: 8

DATE: SMULATION OF ASK ,FSK AND BPSK GENERATION &


DETECTION SCHEMES

AIM:

To write MATLAB code to perform Amplitude Shift Keying, Frequency shift


Keying and Binary Phase Shift Keying modulation & demodulation

APPARATUSREQUIRED:

 PC loaded with MATLAB software

ALGORITHM:

 Enter the input binary sequence


 Find the NRZ pulse shaping format for input sequence
 Set the carrier frequency 1 & 2.
 Obtain the FSK modulated wave.
 Obtain the FSK demodulated wave.

PROGRAM: ASK
clc;clear
all;
message=[1 0 1 0 1 0 1
0];message_len=length(message);t=0:0.0
1:1;
x=length(t);one=s
in(2*pi*t);zero=z
eros([1 x]);ask=0;
%modulation
fori=1:1:message_leni
f(message(i)==1)
ask=[askone];
ASK OUTPUT:

CARRIER SIGNAL
1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0 THE INPUT BINARY DATA

-1

1
1 2 3 4 5 6 7 8
0.5 ASK MODULATED OUTPUT
0 100 200 300 400 500 600 700 800 900
0 ASK DE-MODULATED OUTPUT

-1

0.5

0
1 2 3 4 5 6 7 8
elseif(message(i)==0)
ask=[askzero];
end
end
subplot(4,1,1);
plot(t,one);title('CARRIER
SIGNAL');
subplot(4,1,2);
stem(message);
title('THEINPUTBINARYDATA');
subplot(4,1,3);
plot(ask)
title('ASKMODULATEDOUTPUT');
%demodulationrecovered_signal=zero(1,
message_len);fori=1:message_len
index=((i)*x);if(a
sk(index)==0)
recovered_message(i)=0;
else
recovered_message(i)=1;
end
endsubplot(4,
1,4);
stem(recovered_message);
title('ASKDEMODULATEDOUTPUT');
FSK OUTPUT:

Digital input
1

0.5
am

0
0 0.5 1 1.5 2 2.5 3 3.5 4
time
fsk
1

0
am

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
time
fskdemod
1

0.5
am

0
0 0.5 1 1.5 2 2.5 3 3.5 4
time
FSK:
clc;clear
all;close
all;
%n=input ('enter input
bits=');n=[1010];

%nrz pulse
shapingi=1;
t=0:0.01:length(n);f
orj=1:length(t)
if
t(j)<=iy(j
)=n(i);
else
i=i+1;
end
endsubplot(3,
1,1);
plot(t,y,'k');
axis([0 length(n) -1
2]);xlabel('time');
ylabel('amp');title('
digitalinput');
% carrier
generationf1=10;
f2=5;
y1=sin(2*pi*f1*t);
y2=sin(2*pi*f2*t);
%fsk
forj=1:length(t);i
fy(j)==1
z(j)=y1(j);
else
z(j)=y2(j);
end
end
subplot(3,1,2);
plot(t,z,'k');
xlabel('time');
ylabel('amp');
title('fsk');
%fsk
demodulationforj=
1:length(t);
ifz(j)==y1(j)
k(j)=1;
else
k(j)=0;
end
end
subplot(3,1,3);
plot(t,k,'k');
xlabel('time');
ylabel('amp');title
('fsk
demod');gridon;

PROGRAM:BPSK
clc;clear
all;close
all;
%n=input ('enter input
bits=');n=[11001010];
%b2n
form=1:length(n)
ifn(m)==0
nn(m)=-1;
else

nn(m)=1;end
end
BPSK OUTPUT:

Digital input
2

0
am

-2
0 1 2 3 4 5 6 7 8
time
psk
1

0
am

-1
0 1 2 3 4 5 6 7 8
time
pskdemod
2
1
am

0
-1
0 1 2 3 4 5 6 7 8
time
%nrz pulse
shapingi=1;
t=0:.01:length(n);
forj=1:length(t)
if
t(j)<=iy(j)
=nn(i);
else
i=i+1;
end
endsubplot(3,
1,1);
plot(t,y,'k');
axis([0 length(n) -2
2]);xlabel('time');
ylabel('amp');title('
digitalinput');
%carrierx=cos(2
*pi*2*t);
%pskmodbpsk
=y.*x;subplot(
3,1,2);
plot(t,bpsk,'k');
xlabel('time');
ylabel('amp');
title('psk');
%pskdemodulation
forj=1:length(t);
if
x(j)==bpsk(j
)k(j)=1;
else
k(j)=0;
end
end
subplot(3,1,3);
plot(t,k,'k');
axis([0 length(n) -1
2]);xlabel('time');
ylabel('amp');
title('pskdemod');grid on;

RESULT:

Thus the MATLAB code to perform Amplitude Shift Keying, Frequency shift
keying and Binary Shift Keying modulation & demodulation is written & the output is
obtained.
FLOW CHART:

START

ENTER INPUT BINARY DATA

NRZ PULSE SHAPING FORM

PERFORM DPSK MODULATION & DEMODULATION

OBTAINED PSK
MODULATED &
DEMODULATED WAVE

STOP
EXPT NO : 9

DATE: DIFFERENTIAL PHASE SHIFT KEYING

AIM:
To write MATLAB code to perform differential phase shift keying modulation.

APPARATUS REQUIRED:

 PC loaded with MATLAB software

ALGORITHM:

 Enter the input binary sequence


 Find the NRZ pulse shaping format for input sequence
 Set the cosine carrier wave
 Obtain the PSK modulated wave using bpsk =y.*x function.
 Obtain the PSK demodulated wave using x(j)==bpsk(j) function

PROGRAM:

clc;clear

all;close

all;

%n=input('enterinputbits=');x

=randint(1,10);

%nrzpulseshapingi

=1;

t=0:.01:length(x);f

ork=1:length(t)

ift(k)<=i
OUTPUT:

Digital input
2

1
am

-1
0 1 2 3 4 5 6 7 8 9 10 11
time
dpsk
1

0.5

-0.5

-1
0 1 2 3 4 5 6 7 8 9 10
y(k)=x(i);els

i=i+1;

end

endsubplot(2,

1,1);

plot(t,y);

axis([0length(x)+1-

12]);xlabel('time');

ylabel('amp');title('

digitalinput');

%TOPerformDPSKModulation

yy=[];

fori=1:2:length(x)

ifx(i)==1&&x(i+1)==1y

=0;

elseifx(i)==0&&x(i+1)==1y

=1;

elseifx(i)==1&&x(i+1)==0y

=-1;

elseifx(i)==0&&x(i+1)==0y

=0;

end
yy=[yyy];

end

t=2;

i=1;

t=0:.01:length(x);

c1=cos(2*pi*1*t);

c2=sin(2*pi*1*t);

m=2:2:length(x);f

orj=1:length(t)

ift(j)<=m(i)

op(j)=real(yy(i))*c1(j)-

imag(yy(i))*c2(j);else

i=i+1;

end

endsubplot(2,

1,2);

plot(t,op);

title('dpsk');

RESULT:

Thus the MATLAB code to perform differential phase shift keying modulation is
written & the output is obtained.
FLOW CHART:

SET TRAINING LENGTH


START & GET
CORRESPONDING SIGNAL
CONSTELLATION
SET ALPHABET SIZE FOR MODULATION

GETRAND INPUT MSG & PERFORM SPECIFIED OPERATION

DRAW THE
SCATTERPLOT

STOP
EXPT NO: 10

DATE: SIMULATION OF SIGNAL CONSTELLATIONS

OF BPSK, QPSK AND QAM

AIM:
To write MATLAB code to obtain signal constellations of BPSK, QPSK and QAM

APPARATUS REQUIRED:

 PC loaded with MATLAB software

ALGORITHM:

 Set alphabet size for modulation. M=2 for BPSK, M=4 for QPSK AND M=16
for QAM
 Get random input message & perform specified operation
 Set training length & get corresponding signal constellation
 Draw scatter plot of each output

PROGRAM:

BPSK- signal constellation

M=2;

%UseBPSKmodulationforthisexample.msg =

randint (1000,1,M) ;% Random

datamodmsg=pskmod(msg,M);

%Modulate.trainlen= 100;

%Lengthoftraining sequence

eq1.SigConst=pskmod([0:M-1],M);
%Setsignalconstellation.scatterplot(eq1.SigConst,1,0,'k*');
OUTPUT:

BPSK-signal constellation

Scatter plot

0.8

0.6

0.4

0.2
Quadratur

-0.2

-0.4

-0.6

-0.8

-1
-1 -0.5 0 0.5 1
In-Phase

QPSK-signal constellation

Scatter plot

1
Filtered signal
0.8

0.6

0.4

0.2
Quadratur

-0.2

-0.4

-0.6

-0.8

-1
-1 -0.5 0 0.5 1
In-Phase
QPSK-signal constellation

%Setupparametersandsignals.

M=4;%Alphabetsizeformodulation

msg = randint(1500,1,M); % Random

messagemodmsg=pskmod(msg,M);

%ModulateusingQPSK.

eq1.SigConst=pskmod([0:M-1],M);%Setsignalconstellation.

%Plotsignals.scatterplot(eq1.SigC

onst,1,0,'k*');legend('Ideal signal

constellation');QAM-

signalconstellation:

%Setupparameters.

M=16;%Alphabetsizefor modulation

sigconst=qammod(0:M-1,M);%Signalconstellationfor16-QAM

%Setupequalizers.

eq1.SigConst=sigconst;

%Setsignalconstellation.scatterplot(eq1.SigConst,1,0,'k*');
QAM-signal constellation:

Scatter plot

1
Quadratur

-1

-2

-3
-3 -2 -1 0 1 2 3
In-Phase
RESULT:

Thus the MATLAB code to obtain signal constellations of BPSK, QPSK &
QAM are written and the corresponding constellation diagrams are obtained.
FLOW CHART:

FIND CODEWORD & MINIMUM


START
HAMMING DISTANCE

ENTER GENERATOR MATRIX & FINDITS ORDER

ENTER RECEIVED CODEWORD &


FIND SYNDROME

OBTAIN ERROR BIT& CORRECTED CODEWORD

STOP
EXPTNO: 11
DATE: SIMULATIONOFLINEARBLOCKANDCYCLICERROR
CONTROLCODING SCHEMES

AIM:

To write MATLAB code to obtain Linear Block Code for the input data, generate
syndrome, error bit & corrected codeword.

APPARATUS REQUIRED:

 PC loaded with MATLAB software

ALGORITHM:

 Enter generator matrix & find its order


 Find code word & minimum hamming distance.
 Enter received code word & find syndrome
 Obtain error bit & corrected codeword

PROGRAM:

clc;clear
all;
%inputgmatrix
g=input('ENTERTHEGENERATORMATRIX');d
isp('ORDEROFGIS');
[n,k]=size(transpose(g))
fori=1:2^k
forj=k:-1:1
ifrem(i-1,2^(-j+k+1))>=2^(-
j+k)u(i,j)=1;
else
u(i,j)=0;en
d
end
end
OUTPUT:

ENTER THE GENERATOR MATRIX [10 0 0 1 01;0 1 0 0 111;0 0 1 01 1 0; 0 00


1 0 1 1]

ORDER OFG IS

n=

k=

THEPOSSIBLECODEWORDSARE:

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
disp('THEPOSSIBLECODEWORDSARE:');
c=rem(u*g,2)
disp('THEMINIMUMHAMMINGDISTANCEIS’);
d_min=min(sum((c(2:2^k,:))'))

%codeword
r=input('ENTERTHERECEIVEDCODEWORD');p
=[g(:,n-k+2:n)];
h=[transpose(p),eye(n-
k)];disp('HAMMINGCOD
E');
ht=transpose(h)
disp('SYNDROMEOFAGIVENCODEWORDIS');
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('THEERRORISINBIT:');
i
disp('THECORRECTEDCODEWORDIS:');
r
THE MINIMUM HAMMING DISTANCEIS

d_min=

ENTER THE RECEIVED CODEWORD [1000100]


HAMMING 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 CODE WORDIS:

r=

1 0 0 0 1 0 1
RESULT:

Thus the MATLAB code to obtain Linear Block Code for the input data is
written, syndrome, error bit & corrected code word are generated
FLOW CHART:

SIMULATE END-TO-END
START
COMMUNICATION

ENABLE COMMUNICATION LINK

PLOT THE GRAPH

STOP
EXPT NO: 12 COMMUNICATION LINK SIMULATION

DATE:

AIM:

To write MATLAB code to setup communication simulation link using Direct


sequence spread spectrum technique.

APPARATUS REQUIRED:

 PC loaded with MATLAB software

ALGORITHM:

 Enable Communication Link


 Simulate End-To-End Communication Link
 Plot The Graph

PROGRAM:

clccl
ear
%Generatingthebitpatternwitheachbit6samples
longb=round(rand(1,20));
pattern=[];f
ork=1:20ifb
(1,k)==0
sig=zeros(1,6);
elsesig=ones(1
,6);end
pattern=[patternsig];
end
plot(pattern);
axis([-1130-.51.5]);
title('OriginalBitSequence');
OUTPUT:

Original Bit Sequence


1.5

0.5

-0.5
0 20 40 60 80 100 120

Pseudo random Bit Sequence


1.5

0.5

-0.5
0 20 40 60 80 100 120
%Generatingthepseudorandombitpatternforspreadingspread_sig=round(rand(1,120));
figure,plot(spread_sig);
axis([-1130 -.51.5]);
title('PseudorandomBitSequence');
%XORingthe
patternwiththespreadsignalhopped_sig=xor(
pattern,spread_sig);

%Modulatingthehoppedsignalds
ss_sig=[];
t=[0:100];
fc=.1;c1=cos(2*pi*fc*
t);c2=cos(2*pi*fc*t+pi)
;fork=1:120
if
hopped_sig(1,k)==0ds
ss_sig=[dsss_sigc1];els
e
dsss_sig=[dsss_sigc2];
end
endfigure,plot([1:12120],dsss_si
g);axis([-11000-1.5 1.5]);
title('DSSSSignal');

%Plotting theFFTofDSSSsignal

figure,plot([1:12120],abs(fft(dsss_sig)));title(
'FFTofDSSS signal ');
DSSS Signal
1.5

0.5

-0.5

-1

-1.5
0 100 200 300 400 500 600 700 800 900 1000

FFT of DSSS signal


1500

1000

500

0
0 2000 4000 6000 8000 10000 12000 14000
RESULT:

Thus the MATLAB code to setup communication simulation link using Direct
sequence spread spectrum technique is written, the corresponding DSSS & its FFT
is obtained.
VIVA QUESTIONS AND ANSWERS
SIGNAL SAMPLING AND RECONSTRUCTION

1. What is a Low Passsignal ?


ALowPasssignalcontainsfrequenciesfrom1HZtosomehighervalue.
2. StateSamplingtheorem
Sampling theorem states that a continuous time signal can be
completelyrepresentedinitssamples&recoveredbackifthesamplingfrequencyistwiceofthehi
ghest frequencycontentofthesignal.
3. DefineNyquistrate
Letthesignalbebandlimitedto‘W’ HZ,thenNyquistrateis givenbyNyquist
rate=2Wsamples/second.
4. Whatismeantbyaliasingeffect?
WhensamplingfrequencyislessthanNyquistratethenthespectrumofsampledsignal
overlaps itself. Hence higher frequency components take the form
oflowerfrequencies.Thisinterferenceiscalled aliasingeffect.
5. Whatarethedifferentwaystoavoidaliasing?
 Choosingsamplingrategreaterthan2W
 Strictlyband limitsignalto ‘W’.
TIMEDIVISIONMULTIPLEXING
1. Whatis TDM?
Thefreespacebetween2pulsesinPAM,PPM,PWM,PCMcanbeoccupiedbypulsesfrom
other channelsiscalledTDM
2. WhatistheuseofTDM?
Itprovidesmaximumutilizationoftransmissionchannel.
3. Whatissignalingrate?
Thenumberofpulsespersecondiscalledsignalingrate.
4. WhatistheminimumtransmissionbandwidthofTDMchannel?
MinimumtransmissionbandwidthofTDMchannelis BT.=NW.

FMMODULATORANDDEMODULATOR
1. Whatismodulation?
Modulationistheprocessofplacingthemessagesignaloversomecarrierto makeit
suitablefortransmissionoverlongdistance.
2. Whatisdemodulation?
Demodulationistheprocessofseparatingmessagesignalfromthemodulatedcarriersign
al.
3. Whatarethedifferentanalogmodulationtechniques?
Amplitudemodulation,Frequencymodulation&Phasemodulation4.Whatis
frequency modulation?
The frequencyofthecarriervariesasperamplitudevariationsofthe messagesignal
iscalledfrequencymodulation.
5.WhatisthedifferencebetweenFM&PM?
ThebasicdifferencebetweenFM&PMliesinwhichpropertyofthecarrier isdirectly
variedbythemodulatingsignal.
PULSECODEMODULATIONANDDEMODULATION
1. WhatisPCM?
PCM meansPulseCodeModulation.
2. WhataretheblockspresentinPCMtransmitter?
ItconsistsofPrealiasLPF,Samplingcircuit,Quantizationcircuit&encodingcircuit.
3. WhataretheblockspresentinPCMreceiver?
Itconsistsofregeneratorcircuit,DAC&LPF
4. Whatissignalingrate?
Thenumberofbitspersecondiscalledsignalingrate r= vfs

FREQUENCYSHIFTKEYING
1. Whatisdigitalcommunication?
Whendigitaldataistransmitteddirectlyormodulatessomecarrier,itiscalleddigitalcom
munication.
2. Writesomeadvantagesofdigitalcommunication.
 Betternoise immunity
 Moreflexible&adaptable
 Multiplexing&processingiseasier
 Errordetection&correctionbecomesmoreefficient..
3. Namesomedigitalmodulationtechniques
ASK,FSK,PSK,QPSK,QAM..
4. WhatisFSK?
FSKmeansFrequencyShiftKeying.Thefrequencyofthecarrierisshiftedaccordingtobin
arysymbol.
5.Whatisbaudrate?
Baudrateis
therateofchangeofasignalontransmissionmediumafterencoding&modulationhaveoccurre
d.
6.WhatisthebandwidthofFSK?
ThebandwidthofFSKis4fbwherefbiswidthofonelobe.

PHASESHIFTKEYING
1. WhatisPSK?
PSKmeansPhaseShift
Keying.Thephaseofthecarrierisshiftedaccordingtobinarysymbolwithoutchangeinfrequenc
y.
2. Whatistheuseofbalancedmodulator?
ThebalancedmodulatorconvertsbipolardataintoPSKsignalwiththehelpofcarriersigna
l.
3. Whatiserrorrate?
Theprobabilityoferrorinthetotaltransmitteddatais callederrorrate.
4. WhatisthebandwidthofPSK?
ThebandwidthofPSKis2fbwherefbiswidthofonelobe.
5. Whatis the drawbackinPSK?
Therecoveredcarrier isunchangedinreceivereveniftheinputsignalchangesitssign.It is
impossible to determine if received signal is +ve or –ve.this results inambiguity
intheoutputsignal..

DIFFERENTIALPHASESHIFTKEYING
1. WhatisDPSK?
InDPSKtheinputsequenceofbinarybitsaremodifiedsuchthatthenextbitdepends upon
previous bit.In receiver the previous received bits used to detect thepresent bit.
2. Whatisthedetectionmethod usedinDPSK?
Non-coherentdetectionmethod.
3. Howmany noofpossiblesymbolscanbetransmittedusingDPSK?.
Two. symbolscanbetransmittedusing DPSK
4. Whatistheminimumbandwidthrequired&symboldurationforDPSK?
Theminimumbandwidthrequiredisfb&symbolduration2Tb
5. Whataretheadvantagesof DPSK?
 TheDPSKdoesnotneedcarrierreducescomplexcircuitry
 Bandwidthrequirement isreducedthanPSK.
SIMULATION OF SIGNAL CONSTELLATIONS OF BPSK,QPSK
AND QAM
1. What is BPSK,QPSK,QAM?
BPSK-BinaryPhaseShiftKeying,QPSK-QuadraturePhaseShift
Keying,QAM-16 bit QuadratureAmplitudeShiftKeying.
2. Whatissignalconstellationdiagram?
The signalconstellationdiagramshows onlyrelativepositions ofpeaksofphasor.
Itisalsocalledstatespacediagram
3. Whatismeantbymemorylessmodulation?
Whenthedigitalsymbolmodulatesamplitude,phaseor frequencyofthecarrierwithout
anyreferenceto
previoussymbol,itiscalledmemorylessmodulation.ASK,FSK,QPSKaresomeexamples.

DELTAMODULATION
1. WhatisDeltaModulation?
A.Deltamodulationisasystemofdigitalmodulationdevelopedafterpulsemodulation.In this
system, at each sampling time, say the Kth sampling time, the difference betweenthe
sample value at sampling time K and the sample value at the previous sampling time(K-
1)isencodedintojust asinglebit.
2. WhatarethedrawbacksofDeltaModulation?
A. SlopeoverloaddistortionandGranular
noiseeffectarethedrawbacksofDeltaModulation.
3. WhataretheadvantagesofDeltaModulation?
A. The advantages of Delta Modulation are simple system/circuitry; cheap, single
bitencodingallowsusto increasethesamplingrateortotransmit
moreinformationatsomesampling rateforthegivensystemBW.
4. CanDCinformationbepassedusingDeltaModulation?
A.No,DCinformationcannotbepassedusingDeltaModulation.

LINE CODINGSCHEMES

1. Whatisadigitalsignal?
A. Adigitalsignalisadiscontinuoussignalthatchangesfromonestatetoanotherindiscrete
steps. A popular form of digital modulation is binary, or two levels,
digitalmodulation.
2. WhatisLineCoding?
A. Linecodingistheprocessofarrangingsymbols
thatrepresentbinarydatainaparticularpatternfortransmission.
3. Whatarethecommontypesof linecodingusedincommunication?
A. Themostcommontypesoflinecodingusedinfiberopticcommunicationsincludenon-
return-to-zero(NRZ),return-to-zero(RZ),andbiphase,orManchester.
4. InNRZcode,doesthepresenceof ahigh-
lightlevelinthebitdurationrepresentabinary1orabinary0?
A. Thepresenceofahigh-lightlevelinthebitdurationrepresentsabinary1, whilealow-
lightlevelrepresentsabinary0.
5. HowcanthelossoftimingoccurinNRZlinecoding?
A. lossoftimingmayresult iflongstringsof1sand0sarepresentcausingalackoflevel
Transitions.

AMPLITUDEMODULATION

1. DefineAmplitudeModulation.
A.AMisaprocessinwhichtheamplitudeofthecarrierwaveisvariedinaccordancewithsomech
aracteristicsofthemodulatingsignal.
2. WhatistheneedforModulation?
A.a)Difficultintransmittingsignalsatlowfrequencies.
b) Tominimizesignalloss.
c) Toreduceantennalength.
3. WhataretheapplicationsofAM?
A. Amplitude
modulationisutilizedinmanyservicessuchastelevision,standardbroadcasting,aidsto
navigation,telemeter,radar,facsimile etc.
4. WhatarethedifferenttypesofAM?
A. SingleSideBand,DoubleSideBandandVestigialSideBandModulationarethediffere
nt typesofAM.
5. Whatarethedisadvantagesof AM?
Lowefficiency,smalloperatingrange,noisyreception,LargerB
Wrequirement
Largepowerrequirement
.
6. StateadvantagesofAM.
1. Simplicity
2. Costefficient
3. AMcantravellongdistance
4. SmallerBWascomparedtoFM

You might also like