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

Digital Communication Internal Practical: Bachelors of Technology (Electronics and Communication)

The document describes experiments on pulse code modulation (PCM) and quadrature phase shift keying (QPSK) modulation and demodulation using MATLAB. For PCM, it discusses the steps of sampling, quantization, encoding and decoding of an analog signal. The MATLAB code implements these steps and verifies PCM. For QPSK, it discusses the modulation of data using in-phase and quadrature carriers and demodulation using coherent detection. The MATLAB code implements QPSK modulation and demodulation and verifies the process. Both experiments successfully demonstrate the respective digital modulation techniques.

Uploaded by

NITESH Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Digital Communication Internal Practical: Bachelors of Technology (Electronics and Communication)

The document describes experiments on pulse code modulation (PCM) and quadrature phase shift keying (QPSK) modulation and demodulation using MATLAB. For PCM, it discusses the steps of sampling, quantization, encoding and decoding of an analog signal. The MATLAB code implements these steps and verifies PCM. For QPSK, it discusses the modulation of data using in-phase and quadrature carriers and demodulation using coherent detection. The MATLAB code implements QPSK modulation and demodulation and verifies the process. Both experiments successfully demonstrate the respective digital modulation techniques.

Uploaded by

NITESH Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Digital Communication Internal

Practical
BACHELORS OF TECHNOLOGY

(Electronics and Communication)

Submitted To-: Dr. Krishna Patteti

Submitted by-: MD SHOKEEN KHAN

ENROLL NO-: 12710102819

SEMESTER-: 5

CLASS-:ECE-2

QUESTION N0. 1

AIM : To Study and verification of Pulse code modulation and demodulation.

Software Requirement: MATLAB 2021a.

Theory : The systematic way representation of Analog version of Digital/Binary data in serially is known
as PCM

Basic Elements of PCM:


1. Sampling : The process of measuring the instantaneous values of continuous-time signal in a discrete
form.
2. Quantizer: A Quantizer is a device that changes the sampled input signal into quantized signal that has
some predetermined fixed voltage levels.
3. Encoding: Encoding is the process of using various patterns of voltage or current levels to represent 1s
and 0s of the digital signals on the transmission link. The common types of line encoding are Unipolar,
Polar, Bipolar, and Manchester.
Matlab Code:
clc;
close all;
clear all;
n=input('Enter n value for n-bit PCM system : ');
n1=input('Enter number of samples in a period : ');
L=2^n;
% % Signal Generation
% x=0:1/100:4*pi;
% y=8*sin(x); % Amplitude Of signal is 8v
% subplot(2,2,1);
% plot(x,y);grid on;
% Sampling Operation
x=0:2*pi/n1:4*pi; % n1 nuber of samples have tobe selected
s=8*sin(x);
subplot(3,1,1);
plot(s);
title('Analog Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(3,1,2);
stem(s);grid on; title('Sampled Sinal'); ylabel('Amplitude--->'); xlabel('Time---
>');
% Quantization Process
vmax=8;
vmin=-vmax;
del=(vmax-vmin)/L;
part=vmin:del:vmax; % level are between vmin and
vmax with difference of del
code=vmin-(del/2):del:vmax+(del/2); % Contaion Quantized valuses
[ind,q]=quantiz(s,part,code); % Quantization process
% ind contain
index number and q contain quantized values
l1=length(ind);
l2=length(q);

for i=1:l1
if(ind(i)~=0) % To make index as
binary decimal so started from 0 to N
ind(i)=ind(i)-1;
end
i=i+1;
end
for i=1:l2
if(q(i)==vmin-(del/2)) % To make quantize value
inbetween the levels
q(i)=vmin+(del/2);
end
end
subplot(3,1,3);
stem(q);grid on; % Display the Quantize values
title('Quantized Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

% Encoding Process
figure
code=de2bi(ind,'left-msb'); % Cnvert the decimal to binary
k=1;
for i=1:l1
for j=1:n
coded(k)=code(i,j); % convert code matrix to a coded row
vector
j=j+1;
k=k+1;
end
i=i+1;
end
subplot(2,1,1); grid on;
stairs(coded); % Display the encoded signal
axis([0 100 -2 3]); title('Encoded Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

% Demodulation Of PCM signal

qunt=reshape(coded,n,length(coded)/n);
index=bi2de(qunt','left-msb'); % Getback the index in decimal
form
q=del*index+vmin+(del/2); % getback Quantized values
subplot(2,1,2); grid on;
plot(q); % Plot Demodulated
signal
title('Demodulated Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
Result : Pulse Code Modulation and Demodulation is verified .

QUESTION NO. 2
AIM : To Study Quadrature Phase Shift Keying Modulation (QPSK).

Software Requirement: MATLAB 2021a.

Theory : Quadrature Phase Shift Keying (QPSK) is a form of Phase Shift Keying in which two bits are
modulated at once, selecting one of four possible carrier phase shifts (0, 90, 180, or 270 degrees). QPSK
allows the signal to carry twice as much information as ordinary PSK using the same bandwidth.

Matlab Code:
%XXXX QPSK Modulation and Demodulation without consideration of noise XXXXX
clc;
clear all;
close all;
data=[0 1 0 1 1 1 0 0 1 1]; % information
%Number_of_bit=1024;
%data=randint(Number_of_bit,1);
figure(1)
stem(data, 'linewidth',3), grid on;
title(' Information before Transmiting ');
axis([ 0 11 0 1.5]);
data_NZR=2*data-1; % Data Represented at NZR form for QPSK modulation
s_p_data=reshape(data_NZR,2,length(data)/2); % S/P convertion of data
br=10.^6; %Let us transmission bit rate 1000000
f=br; % minimum carrier frequency
T=1/br; % bit duration
t=T/99:T/99:T; % Time vector for one bit information
% XXXXXXXXXXXXXXXXXXXXXXX QPSK modulation XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
y=[];
y_in=[];
y_qd=[];
for(i=1:length(data)/2)
y1=s_p_data(1,i)*cos(2*pi*f*t); % inphase component
y2=s_p_data(2,i)*sin(2*pi*f*t) ;% Quadrature component
y_in=[y_in y1]; % inphase signal vector
y_qd=[y_qd y2]; %quadrature signal vector
y=[y y1+y2]; % modulated signal vector
end
Tx_sig=y; % transmitting signal after modulation
tt=T/99:T/99:(T*length(data))/2;
figure(2)
subplot(3,1,1);
plot(tt,y_in,'linewidth',3), grid on;
title(' wave form for inphase component in QPSK modulation ');
xlabel('time(sec)');
ylabel(' amplitude(volt0');
subplot(3,1,2);
plot(tt,y_qd,'linewidth',3), grid on;
title(' wave form for Quadrature component in QPSK modulation ');
xlabel('time(sec)');
ylabel(' amplitude(volt0');
subplot(3,1,3);
plot(tt,Tx_sig,'r','linewidth',3), grid on;
title('QPSK modulated signal (sum of inphase and Quadrature phase signal)');
xlabel('time(sec)');
ylabel(' amplitude(volt0');
% XXXXXXXXXXXXXXXXXXXXXXXXXXXX QPSK demodulation XXXXXXXXXXXXXXXXXXXXXXXXXX
Rx_data=[];
Rx_sig=Tx_sig; % Received signal
for(i=1:1:length(data)/2)
%%XXXXXX inphase coherent dector XXXXXXX
Z_in=Rx_sig((i-1)*length(t)+1:i*length(t)).*cos(2*pi*f*t);
% above line indicat multiplication of received & inphase carred signal
Z_in_intg=(trapz(t,Z_in))*(2/T);% integration using trapizodial rull
if(Z_in_intg>0) % Decession Maker
Rx_in_data=1;
else
Rx_in_data=0;
end
%%XXXXXX Quadrature coherent dector XXXXXX
Z_qd=Rx_sig((i-1)*length(t)+1:i*length(t)).*sin(2*pi*f*t);
%above line indicat multiplication ofreceived & Quadphase carred signal
Z_qd_intg=(trapz(t,Z_qd))*(2/T);%integration using trapizodial rull
if (Z_qd_intg>0)% Decession Maker
Rx_qd_data=1;
else
Rx_qd_data=0;
end
Rx_data=[Rx_data Rx_in_data Rx_qd_data]; % Received Data vector
end
figure(3)
stem(Rx_data,'linewidth',3)
title('Information after Receiveing ');
axis([ 0 11 0 1.5]), grid on;
% XXXXXXXXXXXXXXXXXXXXXXXXX end of program XXXXXXXXXXXXXXXXXXXXXXXXXX
Conclusion : Quadrature Phase Shift Keying Modulation (QPSK) is verified.

You might also like