DComm Practical
DComm Practical
AMRAVATI
ETU- 528
Digital Communication LAB
NAME:- Chinmay Shrikant Pande
ID : 19004066
BATCH No. :- 04
EXPERIMENT NO. 01
THEORY:-
1. Sampling theorem statement:
A band limited signal of finite energy which has no frequency components higher than fm Hz is
completely described by specifying the values of the signal at instants of me separated by +fm
sec.
2. The sampling theorem states that if the sampling rate in any pulse modula on system
exceeds twice the maximum signal frequency, the original signal can be reconstructed in the
receiver with minimum distor on.
3. Fs> 2fm is called Nyquist rate Where Fs sampling frequency, Fm modula ng signal frequency.
4. If we reduce the sampling frequency Fs less than 2fm the side bands and the informa on
signal will overlap and we cannot recover the informa on signal by low pass filter. This
phenomenon is called fold over distor on or aliasing.
PROGRAM Of MATLAB:-
%% Parameters
F = 30; % frequency of signal [Hz]
Fs = 2*F; % sampling rate [Hz]
Ts = 1/Fs; % sampling period [sec]
Observa on:
RESULT:
Analog signal sampling and reconstruc on with different sampling techniques are
observed.
EXPERIMENT NO. 02
AIM:-
To study Pulse Amplitude modula on and demodula on process with relevant
waveforms .
THEORY:-
1.Pulse modula on is used to transmit analog informa on.Sampling is taken at a regular interval
for the con nuous me signals. Informa on regarding the signal is transmi ed only at the
sampling mes together with syncing signals.
2.At the receiving end, the original waveforms may be recons tuted from the informa on
regarding the samples.
PROGRAM Of MATLAB:-
clc;
close all;
clear all;
t=0:1/6000:((10/1000)-(1/6000));
xa=sin(2*pi*100*abs(t));
Ts=32;
x=sin(2*pi*600*(Ts*t));
X= (xa,abs(x));
subplot(3,1,1);
plot(x,a);
grid
subplot(3,1,2);
stem(X);
grid
Y=i (xa,X);
subplot(3,1,3);
plot(Y);
grid
Observation :-
RESULT :-
Pulse amplitude modula on and demodula on is observed and their respec ve wave forms
are plo ed.
Experiment No. 03
Theory :-
PWM MODULATOR
PWM DEMODULATOR
Program Of MATLAB :-
clc;
close all;
clear all;
fc=1000; fs=10000; f1=200;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5; %modula on
y1=modulate(x1,fc,fs,'pwm');
subplot(421);
plot(x1);
tle('original signal token message,f1=500,fs=10000') ;
subplot(422);
plot(y1);
axis([0 500 -0.2 1.2]);
tle('PWM')
%demodula on x1_recov=demod(y1,fc,fs,'pwm'); subplot(423);
plot(x1_recov);
tle(' me domain received recoverd,signal tone,f1=200');
Observation:-
RESULT:- Pulse width modula on and demodula on is observed and their respec ve wave
forms are plo ed.
Experiment No. 04
AIM:- Verify Pulse Posi on Modula on (PPM) and Demodula on.
Theory :-
Pulse modula on is used to transmit analog informa on, such as con nuous speech or
data. The data is sent at sampling mes, with synchronizing pulses. The pulse posi on
modula on is an analog modula on method, where we have fixed amplitude of each
pulse, but the posi on of each pulse is made propor onal to the amplitude of the
modula ng signal at that instant. PPM is derived from the pulse width modulated signal.
To demodulate the PPM signal, it is fed to an integra ng RC circuit (LPF) to obtain the
modula ng signal.
Program Of MATLAB :-
clc;
clear all;
close all;
fc=100; fs=1000;
f1=80; f2=300 ;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
%x2=0.2*(cos(2*pi*f1*t)+cos(2*pi*f2*t))+0.5 ;
subplot(4,2,1);
plot(x1);
tle('original msg signal');
y1=modulate(x1,fc,fs,'ppm');
subplot(4,2,2);
plot(y1)
axis([0 50 -0.2 1.2]);
tle('ppm one of f1,fc=1000,f1=80 ');
fx1=abs( (y1,1024)) ;
fx1=[fx1(512:1024) fx1(1:513)];
f=[(511*fs/1024):(fs/1024):(512*fs/1024)];
subplot(4,2,3);
plot(fx1);
tle('freq des ppm signal tone,fc=1000');
x1_recov = demod(y1,fc,fs,'ppm');
subplot(4,2,4);
plot(x1_recov);
tle(' me domain recovered signal');
Observation:-
RESULT:- Pulse posi on modula on and demodula on is observed and their respec ve
waveforms are plo ed.
Experiment No. 05
AIM:- To verify Delta modula on(DM) and Adap ve Delta Modula on(ADM)
Theory:-
Program Of MATLAB:-
Observation:-
RESULT:- Thus the Delta modula on and demodula on were performed and graphs were
plo ed.
EXPERIMENT NO. 06
AIM:- To analyze a PCM system and interpret the modulated and demodulated waveforms for
a sampling frequency of 4 KHz.
THEORY:-
PCM Operation:-
1). The block diagram of the PCM system. The modula ng signal is applied to sample &
hold circuit. This applied signal will be super imposed by +2.5V DC so that the nega ve por on
modula ng signal will clamped to posi ve, this process is needed, because input of the A/D
Converter should be between 0 and +5V. A er level shi ing is done the signal will be passed to
sample & hold circuit. Sample & hold circuit will sample the input signal during the period of the
clock signal and will hold the sampled output ll the next pulse comes. Sampling rate is 4KHz in
this system.
2). So input of the A/D Converter is a stable voltage of certain level in between 0 and +5V.
A/D converter (encoder) will give a predetermined 8 bit code for the sampled input. This en re
conversion process will be made at a fast rate as ADC0808 is opera ng at high frequency clock
i.e. 1MHz. Coded output of the A/D converter is applied to input of the parallel in serial out
register through a latch (741s373). This shi register is opera ng at 64KHz (sampling frequency
is 4KHz, so to shi 8 bits from parallel to serial we need 64KHz). This output (PCM) is
transmi ed through a co-axial cable which represents a communica on channel.
PROGRAM Of MATLAB:-
Theory:-
Program of MATLAB:-
ASK MODULATION
%ASK Modula on
clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1; fc=10;
t=0:Tb/100:1;
c=sqrt(2/Tb)*sin(2*pi*fc*t);
%generate message signal
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
else
m(i)=0;
m_s=zeros(1,length(t));
end
message(i,:)=m_s;
%product of carrier and message
ask_sig(i,:)=c.*m_s;
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
%plot the message and ASK signal
subplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r');
tle('message signal');xlabel('t--->');ylabel('m(t)');grid on
hold on
subplot(5,1,4);plot(t,ask_sig(i,:));
tle('ASK signal');xlabel('t--->');ylabel('s(t)');grid on
hold on
end
hold off
%Plot the carrier signal and input binary data
subplot(5,1,3);plot(t,c);
tle('carrier signal');xlabel('t--->');ylabel('c(t)');grid on
subplot(5,1,1);stem(m);
tle('binary data bits');xlabel('n--->');ylabel('b(n)');grid on;
ASK DEMODULATION
t1=0;t2=Tb
for i=1:N
t=[t1:Tb/100:t2]
%correlator
x=sum(c.*ask_sig(i,:));
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
end
subplot(5,1,5);stem(demod);
Observa on:-
Result:- Thus the ASK modula on and demodula on is verified and the waveforms
are plo ed.
EXPERIMENT NO. 08
Aim:- To Verify Frequency shi Keying Modula on and Demodula on
Theory:-
When a digital signal is to be transmi ed over a long distance, it needs con nuous
wave modula on.
A carrier of frequency ‘fo’ is used for modula on. Then the digital signal
modulates some parameter like frequency, phase or amplitude of the carrier. The
carrier ‘fo’ has some devia on in frequency. The devia on is called bandwidth of
the channel. Thus the channel has to transmit some range of frequency. Hence
such a type of transmission is called band pass transmission and the
communica on channel is called band pass channel.
Since the digital data is in discrete steps, the modula on of band pass sinusoidal
carrier is also done in discrete steps. Hence this type of modula on is called
switching or signaling. If the frequency of the sinusoidal carrier is switched on
depending on the incoming digital signal, then it is called frequency shi keying
(FSK). This is similar to analog frequency modula on. In FSK the frequency of
carrier is shi ed according to binary symbol. That is there are 2 different
frequency symbols according to binary symbols. Let there be a frequency shi by
Ω, then we can write the following equa ons.
Program Of MATLAB:-
FSK MODULATION
% FSK Modula on
clc;
clear all;
close all;
Tb=1; fc1=2;fc2=5;
t=0:(Tb/100):Tb;
c1=sqrt(2/Tb)*sin(2*pi*fc1*t);
c2=sqrt(2/Tb)*sin(2*pi*fc2*t);
N=10;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:(Tb/100):t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
invm_s=zeros(1,length(t));
else
m(i)=0;
m_s=zeros(1,length(t));
invm_s=ones(1,length(t));
end
message(i,:)=m_s;
%Mul plier
fsk_sig1(i,:)=c1.*m_s;
fsk_sig2(i,:)=c2.*invm_s;
fsk=fsk_sig1+fsk_sig2;
subplot(3,2,2);axis([0 N -2 2]);plot(t,message(i,:),'r');
subplot(3,2,5);plot(t,fsk(i,:));
t1=t1+(Tb+.01); t2=t2+(Tb+.01);
end
hold off
subplot(3,2,1);stem(m);
subplot(3,2,3);plot(t,c1);
FSK DEMODULATION
% FSK Demodula on
t1=0;t2=Tb
for i=1:N
t=[t1:(Tb/100):t2]
%correlator
x1=sum(c1.*fsk_sig1(i,:));
x2=sum(c2.*fsk_sig2(i,:));
x=x1-x2;
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
end
subplot(3,2,6);stem(demod);
tle(' demodulated data');xlabel('n---->');ylabel('b(n)'); grid on;
Observation:-
Result:- Thus the FSK modula on and demodula on is verified and the
waveforms are plo ed
EXPERIMENT NO. 09
Theory:-
It is not possible to send the digital data directly over the antenna because the
antennae of prac ced size works on very high frequencies, much higher than our
data transmission rate. To be able to transmit the data over antennae, we have to
modulate the signal i.e, phase, frequency or amplitude etc is varied in accordance
with the digital data. At the receiver we separate the signal from digital
informa on by the process of demodula on. A er this process we are le with
high frequency signal (carrier signal) which we discard & the digital informa on,
which we u lize.
PSK is a form of angle modulated, constant amplitude digital modula on. Digital
communica on became important with the expansion of the use of computers
and data processing and has con nued to develop into a major industry providing
the interconnec on of computer peripherals and transmission of data between
distant sites.
Program Of MATLAB:-
% PSK modula on
clc;
clear all;
close all;
t=0:Tb/100:Tb;
fc=2;
c=sqrt(2/Tb)*sin(2*pi*fc*t);
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
else
m(i)=0;
m_s=-1*ones(1,length(t));
end
message(i,:)=m_s;
bpsk_sig(i,:)=c.*m_s;
subplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r');
tle('message signal(POLAR form)');xlabel('t--->');ylabel('m(t)');
subplot(5,1,4);plot(t,bpsk_sig(i,:));
tle('BPSK signal');xlabel('t--->');ylabel('s(t)');
t1=t1+1.01; t2=t2+1.01;
end
hold off
subplot(5,1,1);stem(m);
grid on;
subplot(5,1,3);plot(t,c);
% PSK Demodula on
t1=0;t2=Tb
for i=1:N
t=[t1:.01:t2]
%correlator
x=sum(c.*bpsk_sig(i,:));
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end
t1=t1+1.01;
t2=t2+1.01;
end
subplot(5,1,5);stem(demod);
tle('demodulated data');xlabel('n--->');ylabel('b(n)');
grid on
Observation:-
Result:- Thus the PSK modula on and demodula on is verified and the
waveforms are plo ed.