S6 Ec Manual October 10th
S6 Ec Manual October 10th
Mission
Work with commitment to the highest possible standards of quality in the areas of
teaching, research and service
Develop a full-fledged Centre of learning in various fields of Electronics &
Communication Engineering
Produce competent engineers adequately prepared to face challenges of the society,
adhering to moral and ethical values
DOE,SOE Page | 1
COMMUNICATION LAB
SYLLABUS
Course Outcomes:
On successful completion of teaching-learning and valuation activities, a
student would be able To design circuits of different analog
modulation techniques like AM, FM etc., its generation and
demodulation.
To design different pulse modulation techniques
like PAM, generation and demodulation
To simulate digital communication systems and evaluate its performance
Experiments:
1. Amplitude modulation anddemodulation
2. Frequency modulation
3. PAM modulator and demodulator
4. Simulation of digital and analog communication systems
5. Digital modulation techniques and it performance measures
6. Matched filter receiver for rectangular pulse.
7. Error correction & coding & LPDC, Viterbi algorithm
Reference:
DOE,SOE Page | 2
COMMUNICATION LAB
LIST OF EXPERIMENTS
PART A - Hardware Experiments
5. Analog modulation
DOE,SOE Page | 3
COMMUNICATION LAB
Information Source:
It creates a message signal (e.g. voice signal, music, video signal, e-mail). The message
signal is also called a baseband signal since it is usually lower frequency.
Message signals contain information to be sent to the recipient.
Message signal is converted into electrical form using a suitable transducer. E.g. A
microphone converts acoustic voice signals into electrical signals.
Transmitter: It is an electronic device containing circuits that convert original message signal
into transmitted signal that is more suitable for transmission over channel medium. The
transmitter consists of subsystems such as modulator, mixer, RF amplifier etc. The most
important process within the transmitter is usually modulation.
Channel:
Noise is undesirable energy of random nature and it affects the signals passing through the
channel.
Receiver: It is an electronic device containing circuits that accept the transmitted signals from
the channel medium and convert them back to message signals. Receiver performs the reverse
operations of the transmitter such as demodulation. The receiver also has band pass filters to
select the required signal from among other transmitted signals which may also be sharing
(multiple access) the channel. This is called tuning and such a circuit is called a tuner.
DOE,SOE Page | 4
COMMUNICATION LAB
The block diagram of modern wireless communication system can be broadly divided into two
parts:
BASEBAND PART – consists of modulator, source and channel encoders. The output of this
stage is IF (Intermediate Frequency). Modern modulators use a DSP followed by a DAC.
o This part are covered in this LAB
RF PART – consists of a mixer [which converts the IF (usually a few MHz) to RF (e.g. 2.4 GHz
for Bluetooth)] and RF amp whose output is radiated by the antenna. The RF part is made out
of microwave integrated circuits in portable devices and tubes in high power devices.
o This part shall be covered in S7 - 19-203-0712 Microwave Engineering
Laboratory
Transmitter
Transceiver
SSPA – Solid State power amplifier (RF microwave amp using semiconductor microwave
devices), LNA – Low Noise Amplifier (RF microwave amp)
DOE,SOE Page | 5
COMMUNICATION LAB
DOE,SOE Page | 6
COMMUNICATION LAB
In a digital communication system (e.g. 2G/3G/4G, Wi-Fi etc), the message signal is digital data
(sequence of 1s and 0s). The message may be already in digital form (e.g. text string, FILE such as
spreadsheet, PDF, digital photo etc) or analog signal (e.g. voice) converted to digital by an ADC.
This digital message is input to the transmitter. The functional blocks of the transmitter and the
corresponding reverse operations at the receiver are paired as follows
source encoder–decoder
channel encoder–decoder
modulator–demodulator
The source encoder removes redundant information from the message (e.g. RLC, Huffman,
Arithmetic, LZW etc). Ideally, we would like to represent the message using as few bits as possible i.e.
data compression happens. The resulting sequence of symbols is called the source codeword.
The data stream is processed next by the channel encoder, which produces a new sequence of
symbols called the channel codeword. The channel codeword is longer than the source code
word because they are formed by inserting extra bits. The channel codewords include the
DOE,SOE Page | 7
COMMUNICATION LAB
information bits, plus additional bits (e.g. parity bits) that are used for error detection and
correction. The extra bits are redundant; that is, they carry no new information. However, the
receiver uses these bits to determine when an error occurs and correct a certain number of
errors.
The output of the channel encoder is also a digital data stream and this is input to the modulator.
The source output consists of a sequence of 1s and 0s (bitstream – of digital data), with each
binary symbol being emitted every Tb (bit duration) seconds.
The modulator takes the 1s and 0s emitted by the source and maps them into distinct signals
denoted by s1(t) and s2(t), respectively, which are suitable for transmission over the analog
channel.
DOE,SOE Page | 8
COMMUNICATION LAB
However, owing to the presence of channel noise, the receiver will inevitably make occasional
errors. The requirement, therefore, is to design the receiver so as to minimize the average
probability of symbol error, defined as
DOE,SOE Page | 9
COMMUNICATION LAB
References Simon Haykin - Digital Communication, B P Lathi - Modern Digital and Analog
Communication Systems, John G Proakis - Digital-communications
DOE,SOE Page | 10
COMMUNICATION LAB
Theory: The basic method of generation of PAM is that the signal to be modulated must be
fed to a switch which is operated by the sampling signal. A PAM modulator using analog
switch is shown in fig below. Analog switch passes the input signal to output at a rate
determined by the clock frequency. Clock frequency as selected as per the sampling theorem.
Expected waveform
DOE,SOE Page | 11
COMMUNICATION LAB
Circuit Diagram
Modulator Circuit
Demodulator Circuit
Design:
Modulator
1
For perfect integration,𝑅𝐶 > 15𝑇 𝑤ℎ𝑒𝑟𝑒 𝑇 = 𝑓
DOE,SOE Page | 12
COMMUNICATION LAB
Circuit Diagram
Expected output
DOE,SOE Page | 13
COMMUNICATION LAB
Procedure:
1. Set up the modulator circuit and observe the ASK output in CRO.
2. Set up the demodulator circuit and vary the port to get the desired output waveform.
Result:
DOE,SOE Page | 14
COMMUNICATION LAB
Circuit Diagram :
DOE,SOE Page | 15
COMMUNICATION LAB
Expected output
Procedure:
1. Setup the modulator circuit as shown in the figure and unify the output.
2. Setup the demodulator circuit as shown in the figure.
3. Vary the port to get the output.Verify whether it is the same as the input pulse signal.
Result:
DOE,SOE Page | 16
COMMUNICATION LAB
When the input is at logic ‘0’ transistor turns on and it connects RC across R A .
1.45
f0 1200Hz
RA RC 2RB
Circuit: BFSK modulator circuit
Expected output
DOE,SOE Page | 17
COMMUNICATION LAB
Expected output
Result:
DOE,SOE Page | 18
COMMUNICATION LAB
FM - Frequency Modulation
Program Code:
DOE,SOE Page | 19
COMMUNICATION LAB
subplot(5,2,3); plot(t,carrier); axis([0 0.007 -5.5 5.5]);
xlabel('t'); ylabel('c(t)'); title('carrier signal');
subplot(5,2,4); plot(abs(fft(carrier))); axis([200 600 0 inf]);
%%% FM —----------------------------------------------
beta = 7; % modulation index of FM
FM = Ac*cos(2*pi*fc*t + beta*sin(2*pi*fm*t));
subplot(5,2,9); plot(t,FM); axis([0 0.007 -5.5 5.5]);
xlabel('t'); ylabel('FM(t)'); title('FM');
subplot(5,2,10); plot(abs(fft(FM))); axis([100 600 0 inf]);
Output Waveform:
Inference: The spectrum of standard AM consists of one carrier and two sidebands, whereas
for DSBSC it is sidebands only and multiple sidebands for FM.
DOE,SOE Page | 20
COMMUNICATION LAB
Result: Successfully created and plotted the waveforms and corresponding spectrum of various
analog modulation schemes such as standard AM, suppressed carrier DSB-SC, and FM
DOE,SOE Page | 21
COMMUNICATION LAB
Expected waveform
Program Code:
DOE,SOE Page | 22
COMMUNICATION LAB
txs = s2;
end
Output:
DOE,SOE Page | 23
COMMUNICATION LAB
expected waveform
Program Code:
Clc;
close all;
clear all;
data=[1,0,1,1,0,1,0,0]; % message digital data
fc=0.5; % frequency of carrier in Hz
Tb = 1; % bit duration
t=0:0.01:Tb;
Eb = 1; % bit energy
s1 = sqrt(2*Eb/Tb)*cos(2*pi*fc*t); % signal s1(t)
s2 = -(sqrt(2*Eb/Tb)*cos(2*pi*fc*t)); % signal
s2(t)
DOE,SOE Page | 24
COMMUNICATION LAB
Output Waveform
Expected waveform
Program Code:
DOE,SOE Page | 25
COMMUNICATION LAB
f1=5;
f2=1;% frequency of carrier in Hz
Tb = 1; % bit duration
t=0:0.01:Tb;
Eb = 1; % bit energy
s1 = sqrt(2*Eb/Tb)*cos(2*pi*f1*t); % signal s1(t)
s2 = sqrt(2*Eb/Tb)*cos(2*pi*f2*t); % signal s2(t)
DOE,SOE Page | 26
COMMUNICATION LAB
Output Waveform
Result: Successfully created and plotted the waveforms and corresponding spectrum of various
digital modulation schemes such as standard ASK, PSK and FSK.
DOE,SOE Page | 27
COMMUNICATION LAB
Program Code:
DOE,SOE Page | 28
COMMUNICATION LAB
elseif (data(i)==0)&&(data(i+1)==0)
txs = s2;
elseif (data(i)==0)&&(data(i+1)==1)
txs = s3;
elseif (data(i)==1)&&(data(i+1)==1)
txs = s4;
end
Output Waveform
DOE,SOE Page | 29
COMMUNICATION LAB
Theory:
expected waveform
Program Code:
DOE,SOE Page | 30
COMMUNICATION LAB
DOE,SOE Page | 31
COMMUNICATION LAB
Output waveform
Theory:
Program Code:
DOE,SOE Page | 32
COMMUNICATION LAB
fc2=6;
fc3=9;
fc4=12;
T = 1; % symbol duration
t=0:0.01:T;
E = 1; % symbol energy
n=[1 2 3 4]
s1 = sqrt(2*E/T)*cos(2*pi*fc1*t); % signal s1(t)
s2 = sqrt(2*E/T)*cos(2*pi*fc2*t); % signal s2(t)
s3 = sqrt(2*E/T)*cos(2*pi*fc3*t); % signal s3(t)
s4 = sqrt(2*E/T)*cos(2*pi*fc4*t); % signal s4(t)
DOE,SOE Page | 33
COMMUNICATION LAB
Output Waveform
DOE,SOE Page | 34
COMMUNICATION LAB
Theory:
Line Codes are used for electrical representation of binary data streams. In a digital
communication system, the message signal is digital data (sequence of 1s and 0s). A line code
represents them using voltage levels. Some applications of line codes include – USB, Ethernet,
optical, RS-232 etc. These electrical signals are used for wired links where modulation may
not be necessary. Since they are not modulated with a carrier their spectrum is in the
baseband region (Baseband Transmission). The choice of a line code is made by considering
which is the main concern amongst - bandwidth, bit timing recovery, noise immunity, cost and
complexity.
expected waveform
DOE,SOE Page | 35
COMMUNICATION LAB
Program Code:
% unipolar NRZ
s1uNRZ = Eb*ones(1,length(t)); % signal s1(t)
s2uNRZ = Eb*zeros(1,length(t)); % signal s2(t)
% polar NRZ
s1pNRZ = Eb*ones(1,length(t)); % signal s1(t)
s2pNRZ = -Eb*ones(1,length(t)); % signal s2(t)
DOE,SOE Page | 36
COMMUNICATION LAB
s2man = [-
(Eb/2)*ones(1,ceil(length(t)/2)),(Eb/2)*ones(1,floor(length(t)
/2))]; % signal s2(t)
figure;
subplot(5,1,1)
plot(txs_uNRZ); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_uNRZ');
title('unipolar NRZ')
subplot(5,1,2)
plot(txs_pNRZ); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_pNRZ');
title('polar NRZ')
subplot(5,1,3)
plot(txs_NRZi); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_NRZi');
title('NRZi (NRZ inverted - differential encoding)')
DOE,SOE Page | 37
COMMUNICATION LAB
subplot(5,1,4)
plot(txs_bip); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_bip');
title('bipolar / AMI (alternate mark inversion)')
subplot(5,1,5)
plot(txs_man); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_man');
title('manchester / split phase')
Output Waveforms:
Result: Successfully created and plotted the different line codes for the given message input
signal.
DOE,SOE Page | 38
COMMUNICATION LAB
DOE,SOE Page | 39
COMMUNICATION LAB
expected waveform
Program Code:
DOE,SOE Page | 40
COMMUNICATION LAB
% unipolar NRZ
s1uNRZ = Eb*ones(1,length(t)); % signal s1(t)
s2uNRZ = Eb*zeros(1,length(t)); % signal s2(t)
% polar NRZ
s1pNRZ = Eb*ones(1,length(t)); % signal s1(t)
s2pNRZ = -Eb*ones(1,length(t)); % signal s2(t)
end
end
fc=10;
DOE,SOE Page | 41
COMMUNICATION LAB
fc1=2;
fc2=4;
tc=0.01:0.01:length(data)*Tb % frequency of carrier in Hz
carrier=cos(2*pi*fc*tc);
carrier1=cos(2*pi*fc1*tc);
carrier2=cos(2*pi*fc2*tc);
figure;
subplot(8,1,1)
plot(carrier); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('carrier');
title('carrier')
subplot(8,1,2)
plot(txs_uNRZ); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_uNRZ');
title('unipolar NRZ')
subplot(8,1,3)
plot(txs_pNRZ); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('txs_pNRZ');
title('polar NRZ')
psk_sig = txs_pNRZ .* carrier; % baseband x carrier =
passband
ask_sig = txs_uNRZ .* carrier; % baseband x carrier =
passband
txs_invuNRZ = ~txs_uNRZ;
inv_sig = txs_invuNRZ .* carrier2;
new_sig = txs_uNRZ .* carrier1;
fsk_sig = new_sig + inv_sig;
subplot(8,1,4)
plot(psk_sig); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('psk');
title('PSK signal')
subplot(8,1,5)
plot(ask_sig); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('ask');
title('ASK signal')
DOE,SOE Page | 42
COMMUNICATION LAB
subplot(8,1,6)
plot(txs_invuNRZ); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('fsk');
title('inverted signal')
subplot(8,1,7)
plot(inv_sig); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('fsk');
title('inverted band signal')
subplot(8,1,8)
plot(fsk_sig); axis([0,1000,-2,2]); xlabel('time t --->');
ylabel('fsk');
title('FSK signal')
Output Waveforms:
Result: Successfully created and plotted the waveforms of binary PSK, ASK and FSK signals
by using baseband to passband conversion
DOE,SOE Page | 43
COMMUNICATION LAB
Theory:
Program Code:
DOE,SOE Page | 44
COMMUNICATION LAB
Output Waveforms
DOE,SOE Page | 45
COMMUNICATION LAB
Aim : To plot the graph between BER and SNR and analyse the performance of matched filter
Theory:
BER stands for bit error rate , it is the percentage of bits that have errors relative to the total
number of bits received in a transmitter. it is usually expressed as ten to a negative power. A
high SNR is required for a low BER.
DOE,SOE Page | 46
COMMUNICATION LAB
Program Code:
clc;clear all;close all;
%-------------------------------------------------------------
------------
% Matched Filter (b)
%-------------------------------------------------------------
------------
snr=-20:8; %signal to noise ratio in dB
threshold=50; %lambda
t=1:0.01:2;
for i=1:length(snr)
no_errors=0;
for j=1:1000;
txt_bit=round(rand);
x=txt_bit*phi % transmitted signal
rxs=awgn(x,snr(i)); % adding awgn
%--------receiver----------------
h=phi;
DOE,SOE Page | 47
COMMUNICATION LAB
DOE,SOE Page | 48
COMMUNICATION LAB
Result:
a. Designed a circuit for matched filter and plotted the corresponding waveforms
b. For a threshold value of 50, a graph is plotted between BER and SNR
DOE,SOE Page | 49
COMMUNICATION LAB
Aim: To determine the codeword from message data and generator matrix and detect and
correct the error received codeword using syndrome.
Theory
Channel Coding - The incoming digital message (information bits) are encoded to produce
the channel codeword. The channel codewords include the information bits, possibly in a
modified form, plus additional bits that are used for error correction. The channel bits are
modulated and transmitted over the channel.
The extra bits are redundant; that is, they carry no new information. However, the receiver uses
these bits to determine when an error occurs and correct a certain number of errors.
Advantage – increased reliability and reduced error rate.
Trade-off - For a fixed modulation scheme, the addition of redundancy in the coded messages
implies the need for increased transmission bandwidth. Moreover, the use of error-control
coding adds complexity to the system.
11a HAMMING CODE
Linear Block Codes (LBC
DOE,SOE Page | 50
COMMUNICATION LAB
Hamming Codes
These comprise a class of codes with the property that
DOE,SOE Page | 51
COMMUNICATION LAB
MATLAB Functions
I = eye(n) returns an n-by-n identity matrix with ones on the main diagonal and zeros
elsewhere.
r = rem(a,b) returns the remainder after division of a by b, where a is the dividend and
b is the divisor. (for modulo 2 arithmetic b=2)
H(:,i) denotes i’th column of H
zeros(p,q) returns a p-by-q matrix of all zero elements.
MATLAB Program
% TRANSMITTER-------------------------------------------------
-
a=3;
n=(2^a)-1; %criteria for LBC to be hamming,
n=7
DOE,SOE Page | 52
COMMUNICATION LAB
% RECEIVER --------------------------------------------------
disp('received codeword : ')
%case for one bit error in received codeword
r=[1,1,1,0,1,1,0] %received vector, size-n
H=[transpose(P),eye(m)]; %parity check matrix, size-(m,n)
s=rem(r*transpose(H),2); %syndrome, size-(1,m)
e=zeros(1,n); %error pattern, size-(1,n)
for i=1:n
if(H(:,i)==transpose(s)) %comparing i'th column of H with
syndrome
disp('error position is at : ')
disp(i);
e(1,i)=1
break
end
end
c2=rem((r+e),2); %error correction-
%Modulo 2 addition OF received codeword with error pattern
disp('corrected code word is : ');
disp(c2);
Output:.
transmitted codeword:
c=
1 1 1 0 0 1 0
received codeword:
r=
1 1 1 0 1 1 0
DOE,SOE Page | 53
COMMUNICATION LAB
e=
0 0 0 0 1 0 0
Result: Calculated the codeword using message and parity matrix and corrected the one bit
error using syndrome
DOE,SOE Page | 54