Nothing Special   »   [go: up one dir, main page]

Dcomm Master File

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

EXPERIMENT – 4

Aim – To Study Source Coding Using the Implementation of Shannon-Fano Coding on


MATLAB.
Apparatus Required – MATLAB
Theory –
Shannon-Fano coding is a variable-length data compression technique Claude Shannon and
Robert Fano developed in the 1940s. This method is based on the principle of assigning shorter
codes to more frequent symbols and more extended codes to less frequent symbols, with the
aim of reducing the average code length.
The basic steps of Shannon-Fano coding are as follows:
1. Frequency Counting: Calculate the frequency of each symbol in the dataset to be
compressed. Symbols can represent the data's characters, pixels, or any other discrete
elements.

2. Symbol Sorting: Sort the symbols in non-increasing order of their frequencies, with the
most frequent symbols appearing first in the list.

3. Divide and Assign: Divide the sorted list of symbols into two or more subsets, ensuring
the subsets have roughly equal total frequencies. Binary codes are then assigned to each
subset, typically "0" for one subset and "1" for the other. If you have more subsets, you
can further extend the coding logic.

4. Recursion: If a subset contains more than one symbol, recursively apply the same
divide-and-assign process until each symbol is uniquely encoded.
Code –
% DIGITAL COMMUNICATION (EC 303) LABORATORY
% AIM - To Study Source Coding Using Implementation of Shannon-Fano Coding on
MATLAB.

% CLEARING COMMANDS

clc; clear all; close all;

% SOURCE CODE

disp('Enter the probabilities:');


ss=[0.4 0.2 0.12 0.08 0.08 0.08 0.04]
%outputs = string of codewords,average codeword length
ss=ss./sum(ss); %if occurrences are inputted, probabilities are gained
ss=sort(ss,'descend'); %the probabilities are sorted in descending order
siling=log2(1/ss(1)); %initial length is computed
siling=round(siling,1,'significant');

sf=0;

fano=0;
%initializations for Pk

n=1;Hx=0; %initializations for entropy H(X)

for i=1:length(ss)
Hx=Hx+ ss(i)*log2(1/ss(i)); %solving for entropy
end

for k=1:length(ss)
info(k)=-(log2(ss(k))); %Information
end

for j=1:length(ss)-1
fano=fano+ss(j);
sf=[sf 0]+[zeros(1,j) fano]; %solving for Information for every codeword
siling=[siling 0]+[zeros(1,j) ceil(log2(1/ss(j+1)))]; %solving for length every
codeword
end

for r=1:length(sf)
esf=sf(r);
for p=1:siling(r)
esf=mod(esf,1)*2;
h(p)=esf-mod(esf,1); %converting Pk into a binary number
end
hh(r)=h(1)*10^(siling(r)-1); %initializtion for making the binary a whole
number
for t=2:siling(r)
hh(r)=hh(r)+h(t)*10^(siling(r)-t); %making the binary a whole number
end %e.g. 0.1101 ==> 1101
end

c={'0','1'};
disp('Codeword');
for i=1:length(hh)
u=1; %converting the codes into a string
for t=siling(i):-1:1
f=floor(hh(i)/10^(t-1)); %1001 ==>1 (getting the first
highest unit of a number)
hh(i)=mod(hh(i),10^(t-1)); %1001 ==>001(eliminating the first
highest unit of a number)
if f==1
if u==1
d=c{2}; %conversion part (num(1001) to
str(1001))
else
d=[d c{2}];
end
else
if u==1
d=c{1};
else
d=[d c{1}];
end
end
codex{i,:}={d};
u=u+1;
end
disp([d])
end

tao=siling(1)*ss(1); %initialization for codeword length

for u=1:length(ss)-1 %computing for codeword length


tao=tao+siling(u+1)*ss(u+1);
end

T=tao/n; %computing for average codeword length


B=[flipud(rot90(ss)),flipud(rot90(siling)),flipud(rot90(info))];
disp(['Probability',' Length',' Information'])
disp(B)
disp(['Entropy H(X) = ',num2str(Hx),'bits/symbol'])
disp(['Average length,L = ',num2str(T),'bits/symbol'])
eff=((Hx/T)*100); %Coding efficiency
disp(['Efficiency=',num2str(eff),'%'])
redu=100-eff; %Redundancy
disp(['Redundancy=',num2str(redu),'%'])

Results –

Conclusion –
This page is intentionally left blank.
EXPERIMENT – 5
Aim – To Study Source Coding Using an Implementation of Huffman Coding on
MATLAB.
Apparatus Required – MATLAB
Theory –
Huffman Coding is a widely used variable-length data compression technique developed by
David A. Huffman in 1952. This method efficiently represents data by assigning shorter codes
to more frequent symbols and more extended codes to less frequent symbols. Huffman coding
is a fundamental algorithm in information theory and lossless data compression.
The fundamental principles of Huffman coding are as follows:
1. Frequency Analysis: Calculate the frequency of each symbol in the dataset to be
compressed. This could be characters in a text document, pixels in an image, or any
discrete elements in the data.

2. Build a Huffman Tree: Create a binary tree, known as a Huffman tree, with leaves
representing symbols and internal nodes representing merged symbols or groups of
symbols. Start with each symbol as a single-node tree.

3. Merge Nodes: Repeatedly merge the two nodes with the lowest frequencies in the tree,
creating a new internal node with a frequency equal to the sum of the two merged nodes.
This process continues until all nodes are combined into a single tree.

4. Assign Codes: Traverse the Huffman tree from the root to each leaf, assigning binary
codes based on the path to reach each symbol. Left branches are typically assigned "0,"
and right branches are assigned "1." These codes are unique and variable in length, with
shorter codes for more frequent symbols and more extended codes for less frequent
ones.
Code –
% DIGITAL COMMUNICATION (EC 303) LABORATORY
% AIM - To Study Source Coding Using Implementation of Huffman Coding on MATLAB.

% CLEARING COMMANDS

clc; clear all; close all;

% SOURCE CODE

s=input('Enter symbols- ') %format ['a','b','c','d','e','f'];


p=input('Enter value of probabilty- ') %format [0.22,0.20,0.18,0.15,0.13,0.12];
if length(s)~=length(p)
error('Wrong entry.. enter again- ')
end
i=1;
for m=1:length(p)
for n=1:length(p)
if(p(m)>p(n))
a=p(n); a1=s(n);
p(n)=p(m);s(n)=s(m);
p(m)=a; s(m)=a1;
end
end
end
display(p) %arranged prob. in descending order.
tempfinal=[0];
sumarray=[];
w=length(p);
lengthp=[w];
b(i,:)=p;
while(length(p)>2)
tempsum=p(length(p))+p(length(p)-1);
sumarray=[sumarray,tempsum];
p=[p(1:length(p)-2),tempsum];
p=sort(p,'descend');
i=i+1;
b(i,:)=[p,zeros(1,w-length(p))];
w1=0;
lengthp=[lengthp,length(p)];

for temp=1:length(p)
if p(temp)==tempsum;
w1=temp;
end
end
tempfinal=[w1,tempfinal]; % Find the place where tempsum has been inserted
display(p);
end
sizeb(1:2)=size(b);
tempdisplay=0;
temp2=[];

for i= 1:sizeb(2)
temp2=[temp2,b(1,i)];
end
sumarray=[0,sumarray];
var=[];
e=1;
for ifinal= 1:sizeb(2)
code=[s(ifinal),' ']
for j=1:sizeb(1)
tempdisplay=0;

for i1=1:sizeb(2)
if( b(j,i1)==temp2(e))
tempdisplay=b(j,i1);
end
if(tempdisplay==0 & b(j,i1)==sumarray(j))
tempdisplay=b(j,i1);
end
end
var=[var,tempdisplay];
if tempdisplay==b(j,lengthp(j)) %assign 0 & 1
code=[code,'1'];
elseif tempdisplay==b(j,lengthp(j)-1)
code=[code,'0'];
else
code=[code,''];
end
temp2(e)=tempdisplay;
end
display(code) %display final codeword
e=e+1;
end

Results –
Conclusion –
EXPERIMENT – 6
Aim – To study channel coding using the implementation of Linear Block Codes on
MATLAB.
Apparatus Required – MATLAB
Theory –
Channel Coding using linear block codes is a technique used in digital communication to
improve the reliability of data transmission over noisy channels. It is based on the theory of
error-correcting codes, specifically linear block codes.
Linear Block Codes are a class of error-correcting codes that operate on fixed-size blocks of
data. These codes are characterized by two fundamental properties: linearity and block
structure. Linearity means that the codewords are formed by taking linear combinations of the
original data bits, and the block structure means that encoding and decoding are performed on
fixed-size blocks.
In channel coding using linear block codes, the sender encodes the original data into codewords
using a systematic linear block code. A systematic code is one where the original data bits are
included in the codeword. The encoding process typically involves multiplying the original
data vector by a generator matrix to produce the codeword.
The primary purpose of channel coding is to add redundancy to the data. The redundancy in
the codewords allows for detecting and correcting errors that occur during transmission. The
extent of redundancy added is determined by the specific linear block code.
At the receiver's end, the received codeword may contain errors due to noise and interference
in the channel. Linear block codes enable error detection and correction by using a decoder.
The decoder can identify which bits in the received codeword are likely to be erroneous and
correct them.
Code –
% DIGITAL COMMUNICATION (EC 303) LABORATORY
% AIM - To Study Source Coding Using Implementation of Linear Block Codes on
MATLAB.

% CLEARING COMMANDS

clc; clear all; close all;

% SOURCE CODE

% Given H Matrix
H = [1 0 1 1 1 0 0;
1 1 0 1 0 1 0;
0 1 1 1 0 0 1]

k = 4;
n = 7;

% Generating G Matrix
% Taking the H Matrix Transpose
P = H';

% Making a copy of H Transpose Matrix


L = P;

% Taking the last 4 rows of L and storing


L((5:7), : ) = [];

% Creating a Identity matrix of size K x K


I = eye(k);

% Making a 4 x 7 Matrix
G = [I L]

% Generate U data vector, denoting all information sequences


no = 2 ^ k

% Iterate through an Unit-Spaced Vector


for i = 1 : 2^k

% Iterate through Vector with Specified Increment


% or in simple words here we are decrementing 4 till we get 1
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

% To avoid displaying each iteration/loop value


echo off;
end
end

echo on;
u

% Generate CodeWords
c = rem(u * G, 2)

% Find the min distance


w_min = min(sum((c(2 : 2^k, :))'))

% Given Received codeword


r = [0 0 0 1 0 0 0];
r

p = [G(:, n - k + 2 : n)];

%Find Syndrome
ht = transpose(H)

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:')


disp(i)

disp('The Corrected Codeword is :')


disp(r)

Results –
Conclusion –
EXPERIMENT – 7
Aim – To Study Source Coding Using an Implementation of Convolution Codes on
MATLAB.
Apparatus Required – MATLAB
Theory –
Convolutional Codes are error-correcting codes used in digital communication systems to
enhance data reliability over noisy channels. Unlike block codes, convolutional codes operate
on a continuous stream of data, making them particularly well-suited for applications involving
a continuous flow of information.
Convolutional codes are generated using shift registers and modulo-2 adders (XOR gates). The
input data stream is processed through these shift registers, which have feedback connections
based on a predefined structure known as the generator polynomial. As the data bits shift
through the registers, new bits are generated and combined with the original data stream to
create the output code.
Convolutional codes are characterized by two key parameters: the code rate (k/n) and the
constraint length (K). The code rate represents the ratio of input bits (k) to output bits (n) and
determines the level of redundancy introduced. The constraint length, denoted as K, defines
how many previous input bits influence the current output. Longer constraint lengths provide
better error-correcting capabilities but also introduce more complexity.
Code –
% File 1 – conv_test.m

% DIGITAL COMMUNICATION (EC 303) LABORATORY


% AIM - To Study Source Coding Using Implementation of Convolution Codes on
MATLAB.

% CLEARING COMMANDS

clc; clear all; close all;

% SOURCE CODE

g_mat = [1 1 1; 1 0 1];
op_state_table = conv_state_table(g_mat);

ITER = 100000;
Blklen = 10;
ber = 0;
ber_enco = 0;

P_dB = 2;

P = 10^(P_dB/10);
No = 1;
%msg = [0 1 1 0 1 0]
%enc_op = conv_encoder(msg,g_mat)
for ix = 1:ITER
ix
TxBits = randi([0 1],1,Blklen);
TxSyms = sqrt(P).*(2.*TxBits - 1);
RxSyms = TxSyms + sqrt(No/2).*randn(1,length(TxSyms));
RxBits = 1.*(RxSyms >= 0);
ber = ber + sum(RxBits ~= TxBits);
end
ber = ber/(Blklen*ITER);

for ix = 1:ITER
ix
TxBits = randi([0 1],1,Blklen);
TxBits_encoded = conv_encoder(TxBits,g_mat);

TxSyms = sqrt(P).*(2.*TxBits_encoded - 1);


RxSyms = TxSyms + sqrt(No/2).*randn(1,length(TxSyms));
RxBits = 1.*(RxSyms >= 0);

RxBits = viterbi_decoder(RxBits,g_mat,op_state_table);
ber_enco = ber_enco + sum(RxBits ~= TxBits);
end
ber_enco = ber_enco/(Blklen*ITER);
ber
ber_enco

% File 2 – conv_encoder.m

% DIGITAL COMMUNICATION (EC 303) LABORATORY


% AIM - To Study Source Coding Using Implementation of Convolution Codes on
MATLAB.

% SOURCE CODE

function enc_op=conv_encoder(m,g_mat)

[num_row_g, num_col_g] = size(g_mat);


reg = zeros(1,num_col_g);
enc_op = zeros(1,length(m)*num_row_g);
c_i = zeros(1, num_row_g);
for ix=1:length(m)
reg = circshift(reg,1); %shift the register
reg(1) = m(ix); %load current bit into register
for jx = 1:num_row_g
c_i(jx) = mod(sum(reg.*g_mat(jx,:)),2); %multiply and xor (indirectly)
end
enc_op((ix-1)*num_row_g + 1 : ix*num_row_g) = c_i;
end

end

% File 3 – viterbi_decoder.m

% DIGITAL COMMUNICATION (EC 303) LABORATORY


% AIM - To Study Source Coding Using Implementation of Convolution Codes on
MATLAB.

% SOURCE CODE
function dec_bits = viterbi_decoder(enc_op,g_mat,op_state_table)

[num_codes, num_col_g] = size(g_mat);


m_len = length(enc_op)/num_codes;
num_states = 2^(num_col_g - 1);
prev_state_mat = zeros(num_states,m_len);
cost_state = 1/0.*ones(1,num_states);
cost_state(1) = 0;
new_cost_state = cost_state;

for ix = 1:m_len
cost_state = new_cost_state;
for jx = 1:num_states
h1 = sum(op_state_table(jx,3:3+num_codes - 1) ~= enc_op((ix-
1)*num_codes+1:ix*num_codes)); %correct?
h2 = sum(op_state_table(jx,2+num_codes+1:2+num_codes+1 + num_codes -1) ~=
enc_op((ix-1)*num_codes+1:ix*num_codes)); %correct?
s1 = op_state_table(jx,1);
s2 = op_state_table(jx,2);
c_s1 = cost_state(s1) + h1;
c_s2 = cost_state(s2) + h2;
if (c_s1 <= c_s2)
prev_state_mat(jx,ix) = s1;
new_cost_state(jx) = c_s1;
else
prev_state_mat(jx,ix) = s2;
new_cost_state(jx) = c_s2;
end
end
end
cost_state = new_cost_state;

[~, last_state] = min(cost_state);


opt_state_trav = zeros(1,m_len);
opt_state_trav(m_len) = last_state;
for ix = (m_len-1):-1:1
opt_state_trav(ix) = prev_state_mat(opt_state_trav(ix+1),ix+1);
end

dec_bits = zeros(1,m_len);
for ix = 1:m_len
state_bits = fliplr(de2bi(opt_state_trav(ix)-1,num_col_g - 1));
dec_bits(ix) = state_bits(1);
end
end

% File 4 – conv_state_table.m

% DIGITAL COMMUNICATION (EC 303) LABORATORY


% AIM - To Study Source Coding Using Implementation of Convolution Codes on
MATLAB.

% SOURCE CODE

function state_table_op=conv_state_table(g_mat)

[num_codes, num_col_g] = size(g_mat);


num_states = 2^(num_col_g - 1);

state_table_op = zeros(num_states, 2 + 2*num_codes);

reg = zeros(1,num_col_g);
%op_reg = zeros(1,num_col_g);
c_i = zeros(1, num_codes);
for ix = 1:num_states
ip_state_bits = fliplr(de2bi(ix-1,num_col_g - 1));
reg(2:num_col_g) = ip_state_bits;

for bx = 0:1
reg(1) = bx;
for jx = 1:num_codes
c_i(jx) = mod(sum(reg.*g_mat(jx,:)),2); %multiply and xor (indirectly)
end
op_reg = circshift(reg,1);
op_state_dec = bi2de(fliplr(op_reg(2:num_col_g))) + 1;
if (state_table_op(op_state_dec,1) == 0)
state_table_op(op_state_dec,1) = ix;
state_table_op(op_state_dec,3:3+num_codes - 1) = c_i;
else
state_table_op(op_state_dec,2) = ix;
state_table_op(op_state_dec,2+num_codes+1:2+num_codes+1 + num_codes -
1) = c_i;
end
end
end

Results –

Conclusion –
EXPERIMENT – 8
Aim – To Study Modulation and Demodulation of Signal Using QAM and to Study
Constellation Diagram as well as Eye Diagram on MATLAB.
Apparatus Required – MATLAB
Theory –
Quadrature Amplitude Modulation (QAM) is a widely used modulation scheme in digital
communication that enables digital data transmission over analog communication channels. It
combines amplitude modulation (AM) with phase modulation to convey information in a
carrier signal's amplitude and phase.
In QAM, the carrier signal's amplitude and phase are simultaneously varied to represent digital
data. The amplitude change corresponds to the digital amplitude information, and the phase
change encodes the digital phase information.
QAM is often represented graphically using a constellation diagram. In this diagram, each
point in the complex plane (with the real and imaginary axes) corresponds to a unique
combination of amplitude and phase. The arrangement of points on the diagram represents the
modulation scheme, and the spacing between points determines the level of modulation (e.g.,
16-QAM, 64-QAM).
Code –
% File 1 – qam_ber_vsEbn0.m

% DIGITAL COMMUNICATION (EC 303) LABORATORY


% AIM - To Study Modulation and Demodulation of Signal Using QAM and to Study
Constellation Diagram as well as Eye Diagram on MATLAB.

% CLEARING COMMANDS

clc; clear all; close all;

% SOURCE CODE

Blk_len = 10^6; %no. of symbols


M = 4; %modulation order

N = log2(M); %bits per symbol


Eb_dB = -10:5:20; %energy per bit in dB
Eb_lin = 10.^(Eb_dB./10); %energy per bit in linear
BER = zeros(1,length(Eb_dB)); %bit error rate vector for each Eb value

No = 1; %noise power = 1

for k=1:length(Eb_dB)
k
TxBits = randi([0,1],1,Blk_len*N); %generate random bits
tot_bits = length(TxBits);
TxBits_shaped = reshape(TxBits,N,tot_bits/N);
TxBits_shaped = transpose(TxBits_shaped);
TxIntSyms = bi2de(TxBits_shaped); %Left is LSB, Right is MSB
TxIntSyms = double(TxIntSyms);
TxSyms = qammod(TxIntSyms,M);
rms = sqrt(mean(abs(TxSyms).^2));
TxSyms = TxSyms./rms; %normalize to unit average power

Y = sqrt(N*Eb_lin(k)).*TxSyms + sqrt(No/2).*(randn(length(TxSyms),1) +
1j*randn(length(TxSyms),1));

RxSyms = (Y./sqrt(N*Eb_lin(k))).*rms; %unnormalize for demodulation (w.r.t


both rms AND sqrt(Es_lin))
RxIntSyms = qamdemod(RxSyms,M);
RxBits_shaped = de2bi(RxIntSyms);
RxBits_shaped = transpose(RxBits_shaped);
RxBits = reshape(RxBits_shaped,1,tot_bits);

BER(k) = BER(k) + sum(RxBits~=TxBits)/tot_bits;


end

figure(1);
semilogy(Eb_dB,BER,'b-s','linewidth',1.0,'MarkerFaceColor','b','MarkerSize',3.0);
grid on;
hold on;
xlabel('Eb/No (dB)');
ylabel('BER');

scatterplot(TxSyms,M);
hold on;
xlabel('Quadrature Amplitude');
ylabel('In Phase Amplitude');

eyediagram(TxSyms,M);
hold on;
xlabel('Quadrature Amplitude');
ylabel('In Phase Amplitude');

% File 2 – qam_ber_vsEsn0.m

% DIGITAL COMMUNICATION (EC 303) LABORATORY


% AIM - To Study Modulation and Demodulation of Signal Using QAM and to Study
Constellation Diagram as well as Eye Diagram on MATLAB.

% CLEARING COMMANDS

clc; clear all; close all;

% SOURCE CODE

Blk_len = 10^6; %no. of symbols


M = 64; %modulation order

N = log2(M); %bits per symbol


Es_dB = -10:5:20; %symbol energy in dB
Es_lin = 10.^(Es_dB./10); %symbol energy in linear
BER = zeros(1,length(Es_dB)); %bit error rate vector for each Es value

No = 1; %noise power = 1
for k=1:length(Es_dB)
k
TxBits = randi([0,1],1,Blk_len*N); %generate random bits
tot_bits = length(TxBits);
TxBits_shaped = reshape(TxBits,N,tot_bits/N);
TxBits_shaped = transpose(TxBits_shaped);
TxIntSyms = bi2de(TxBits_shaped); %Left is LSB, Right is MSB
TxIntSyms = double(TxIntSyms);

TxSyms = qammod(TxIntSyms,M);
rms = sqrt(mean(abs(TxSyms).^2));
TxSyms = TxSyms./rms; %normalize to unit average power

Y = sqrt(Es_lin(k)).*TxSyms + sqrt(No/2).*(randn(length(TxSyms),1) +
1j*randn(length(TxSyms),1));

RxSyms = (Y./sqrt(Es_lin(k))).*rms; %unnormalize for demodulation (w.r.t both


rms AND sqrt(Es_lin))
RxIntSyms = qamdemod(RxSyms,M);
RxBits_shaped = de2bi(RxIntSyms);
RxBits_shaped = transpose(RxBits_shaped);
RxBits = reshape(RxBits_shaped,1,tot_bits);

BER(k) = BER(k) + sum(RxBits~=TxBits)/tot_bits;


end

figure(1);
semilogy(Es_dB,BER,'b-s','linewidth',1.0,'MarkerFaceColor','b','MarkerSize',3.0);
grid on;
hold on;
xlabel('Es/No (dB)');
ylabel('BER');

scatterplot(TxSyms,M);
hold on;
xlabel('Quadrature Amplitude');
ylabel('In Phase Amplitude');

eyediagram(TxSyms,M);
hold on;
xlabel('Quadrature Amplitude');
ylabel('In Phase Amplitude');
Results –

Fig. 1: 16-QAM BER V/S Eb/N0 Plot

Fig. 2: 16-QAM BER V/S Es/N0 Plot

Fig. 3: 16-QAM Constellation Diagram


Fig. 4: 16-QAM Eye Diagram

Fig. 5: 32-QAM BER V/S Eb/N0 Plot

Fig. 6: 32-QAM BER V/S Es/N0 Plot


Fig. 7: 32-QAM Constellation Diagram

Fig. 8: 32-QAM Eye Diagram

Fig. 9: 64-QAM BER V/S Eb/N0 Plot


Fig. 10: 64-QAM BER V/S Es/N0 Plot

Fig. 11: 64-QAM Constellation Diagram

Fig. 12: 64-QAM Eye Diagram


Conclusion –
EXPERIMENT – 9
Aim – To Study Modulation and Demodulation of Digital Signal using ASK, FSK and
PSK.
Apparatus Required – Scientech 2156 Trainer Kit, Scientech 2157 Trainer Kit, MDO, Patch
Cords.
Theory –
Amplitude Shift Keying (ASK): ASK is a digital modulation technique where the amplitude of
the carrier signal is varied to represent binary data. A high amplitude represents one binary
state, and a low amplitude represents the other.

Frequency Shift Keying (FSK): FSK is a digital modulation scheme where the frequency of
the carrier signal is switched between two or more discrete frequencies to encode binary data.
Different frequencies represent different binary states.

Phase Shift Keying (PSK): PSK is a digital modulation method in which the phase of the
carrier signal is adjusted to represent binary data. Different phase angles correspond to different
binary states. Common variations include Binary PSK (BPSK) and Quadrature PSK (QPSK).
Observations –

Fig. 1: Amplitude Shift Keying (Modulated)

Fig. 2: Amplitude Shift Keying (Demodulated)


Fig. 3: Frequency Shift Keying (Modulated)

Fig. 4: Frequency Shift Keying (Demodulated)

Fig. 5: Phase Shift Keying (Modulated)


Fig. 6: Phase Shift Keying (Demodulated)

Conclusion –
EXPERIMENT – 10
Aim – To Study Modulation and Demodulation of QPSK.
Apparatus Required – Scientech 2808 Trainer Kit, MDO, Patch Cords.
Theory –
Quadrature Phase Shift Keying (QPSK) is a digital modulation scheme in communication
systems. It encodes data by changing the phase of the carrier signal to one of four possible
values, each representing a pair of binary bits. This results in a higher data rate compared to
BPSK, which encodes one bit per phase shift, and it is used in applications where spectral
efficiency is essential, such as satellite and wireless communications.
Observations –

Fig. 1: Quadrature Phase Shift Keying

Conclusion –
This page is intentionally left blank.
EXPERIMENT – 11
Aim – To Study and Analyse Direct Sequence Spread Spectrum Modulation and
Demodulation.
Apparatus Required – ST2115, CDMA Trainer Board, MDO, Patch Cords.
Theory –
Direct Sequence Spread Spectrum (DSSS) is a modulation technique used in wireless
communication. It involves spreading the original signal over a much wider bandwidth using
a pseudorandom spreading code. This process improves resistance to interference and jamming
while allowing multiple users to share the same frequency band. Demodulation involves
multiplying the received signal by the same spreading code, effectively "despreading" it to
recover the original signal. DSSS is commonly used in Wi-Fi and CDMA (Code Division
Multiple Access) cellular systems.
Observations –

Fig. 1: Input Data Sequence

Fig. 2: XOR Output of Input and Pn Sequence

Fig. 3: Modulated Output


Fig. 4: Demodulated Output

Conclusion –

You might also like