You are on page 1of 9

EC 302: WMC U20EC035

EXPERIMENT:1 9/11/2023
• To stimulate M-PSK and M-QAM modulation technique in MATLAB where in the
AIM: order of modulation [ 4 8 16 32 64 ] considering binary data and image as an input. Also
plot constellation diagram.
APPARATUS: MATLAB software
THEORY: • M-PSK
Multi-level modulation techniques permit high data rates within fixed bandwidth
constraints. A convenient set of signals for M-ary PSK is
φi(t) = A cos(ωct + θi), 0 < t ≤ Ts,

where the M phase angles are


θi = 0, 2π/M ,…., 2(M − 1)π/M

The symbols in this case are of duration Ts , so the information (or bit) rate Tb
satisfies
Ts = Tb log2 M

The potential bandwidth efficiency of M-ary PSK can be shown to be


Fb/B = log2(M) bps/Hz

A phase diagram and signal constellation diagram for the case of M = 8 are
shown below:

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 1
EC 302: WMC U20EC035
Transmitter Side:

Receiver Side:

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 2
EC 302: WMC U20EC035
• M-QAM
Quadrature Amplitude Modulation or QAM is a digital modulation scheme where
data is transmitted over the channel by varying both the amplitude and phase of
the high-frequency carrier signal. The transmitted signal is represented in a
constellation plot that contains two axes namely the in-phase and Quadrature. The
in-phase and Quadrature axis are separated from each other by a phase of 90˚.
Therefore, these two axes are orthogonal to each other.

In the QAM scheme, two or more bits are grouped together to form a symbol that
lies in the constellation plot. Each symbol, also called state, has a unique
amplitude and phase level that provides distinction across different points in the
constellation. Since, the modulation scheme uses binary data, the number of
possible bits that can be transmitted can be given by the following equation:

where N represents the number of bits and M is the number of possible


combinations corresponding to any given number of N bits i.e the number of
constellation points. Since the value of 2N is also an integer, the total number of
bits that can be transmitted is given by,

Constellation Diagrams:

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 3
EC 302: WMC U20EC035
Transmitter Side:

Receiver Side:

CODE & • M-PSK


RESULTS: 1) Binary data as input
clc;
clear all;
close all;

n=input('Enter the number of bits: ');


M=input('Enter the order of PSK: ');
sym=log2(M);

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 4
EC 302: WMC U20EC035

%MODULATION

%Generating bits
x=randi([0,1],1,n);

%Zero Padding
remain=rem(n,sym);
if(remain~=0)
num=sym-rem(n,sym);
z=zeros(1,num);
x=[z x];
end

%Reshaping
x1=reshape(x,sym,length(x)/sym);
y=transpose(x1);

%Converting to decimal
y=bi2de(y,'left-msb');

%PSK Modulation
y=pskmod(y,M);
scatterplot(y);

%DEMODULATION

z=pskdemod(y,M);
z=de2bi(z,'left-msb');
z=transpose(z);
z=reshape(z,[1,length(x)]);

if(remain~=0)
z=z(sym-number+1:length(x));
end

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 5
EC 302: WMC U20EC035
Scatter Plot

2) Image as Input
clc;
clear all;
close all;

M=input('Enter the order of PSK: ');


sym=log2(M);

%MODULATION

%Generating bits
x=imread('cameraman.tif');
[r, c]=size(x);

%Converting matrix into single row


x=reshape(x,[r*c 1]);

x=de2bi(x);%r*c * 8 size
x=reshape(x,[1 r*c*8]);
n=length(x);

%Zero Padding
remain=rem(n,sym);

if(remain~=0)
num=sym-rem(n,sym);
z=zeros(1,num);
x=[z x];
end
EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 6
EC 302: WMC U20EC035

%Reshaping
x1=reshape(x,[sym,length(x)/sym] );
y=transpose(x1);

%Converting to decimal
y=bi2de(y,'left-msb');

%PSK Modulation
y=double(y);
y=pskmod(y,M);%y=qammod(y,M);
scatterplot(y);

%DEMODULATION

z=pskdemod(y,M); %y=qamdemod(y,M);
z=de2bi(z,'left-msb');
z=transpose(z);
z=reshape(z,[1,length(x)]);

if(remain~=0)
z=z(sym-number+1:length(x));
end

z=reshape(x,[r*c 8]);
z=bi2de(z);
z=reshape(z,[r c]);
imshow(z);

Scatter Plot

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 7
EC 302: WMC U20EC035
Input Image

Output Image

• M-QAM (M=256)

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 8
EC 302: WMC U20EC035

CONCLUSION:

EC 302: Wireless and Mobile Communication Laboratory, Electronics Engineering Department, SVNIT,
Surat-07 9

You might also like