Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

KLE Technological University

School of Electronics and Communication Engineering

Communication and
Signal Processing 5th
Laboratory Journal Semester
Course Code: 17EECP301

2018-19

Name :Amruthraj P Koparde


USN: 01FE17BEC234
Division: A

Communication Lab 2018-2019


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:

Experiment No: 1

Title: SAMPLING

1.1 Aim of the experiment: To demonstrate the properties of a sampling of a signal

1.2 List of Equipment/ Components required to conduct the experiment with their
specifications:

Table 1.1: List of all components and equipment used to conduct the experiment.
Sl.No Equipment/ Specification Quantity Cost per item
Components in Rs.
1 Matlab software - - -

2 P.C

1.3 Theoretical background for the experiment:


A continuous time signal can be represented in its samples and can be recovered back when
sampling frequency fs is greater than or equal to the twice the highest frequency component
of message signal. i. e.
fs≥2fm.

1.4 Step by step procedure to carry out the experiment:

 Obtain the required expressions for the given experiment.


 Write the program using the MATLAB tool.
 Define the sampling frequency ‘fs’ and the signal frequency ‘fm’ to be sampled.
 Observe the waveforms how the sampling theorem helps in discretizing the signal.

Communication Lab 2018-2019 1


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:


1.5 Code:
2 clc;
3 clear all;
4 close all;
5 fm=0.02;
6 t=-100:0.1:100;
7 x=cos(2*pi*fm*t );
8 subplot(2,2,1);
9 plot(t,x);
10
11 %for fs<2fm
12 fs1=0.02;
13 n=-2:2;
14 x1=cos(2*pi*fm*n/fs1);
15 subplot(2,2,2);
16 stem(n,x1);
17 hold on;
18 subplot(2,2,2);
19 plot(n,x1);
20 xlabel('time');
21 ylabel('amplitude');
22
23 %for fs=2fm
24 fs2=0.04;
25 n1=-4:4;
26 x2=cos(2*pi*fm*n1/fs2);
27 subplot(2,2,3);
28 stem(n1,x2);
29 hold on;
30 subplot(2,2,3);
31 plot(n1,x2);
32
33 %for fs>2fm
34 fs3=0.5;
35 n2=-50:50;
36 x3=cos(2*pi*fm*n2/fs3);
37 subplot(2,2,4);
38 stem(n2,x3);
39 hold on;
40 subplot(2,2,4);
41 plot(n2,x3);

Communication Lab 2018-2019 2


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course


1.6 Observations and results:code:
We observe that the message signal has been sampled with the help of sampling signal,
where the sampling signal should be greater than or equal to twice the frequency of a
message signal i.e fs≥2fm

1.7 Plotting of the graph:

1.8 Conclusion of the experiment:


We can conclude that the analog signal can be discretized by sampling theorem.
If the sampling signal has frequency less than twice of the message frequency than some of
the information would be loss while retrieving the original analog signal.

Communication Lab 2018-2019 3


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:


Experiment No: 2

Title: Amplitude Modulation and Demodulation

2.1 Aim of the experiment: To modulate and demodulate AM7 signal

2.2 List of Equipment/ Components required to conduct the experiment with their
specifications:

Table 1.1: List of all components and equipment used to conduct the experiment.
Sl.No Equipment/ Specification Quantity Cost per item
Components in Rs.
1 Matlab software - - -

2 P.C

2.3Theoretical background for the experiment:

Amplitude modulation is a modulation technique used in electronic communication, most


commonly for transmitting information via a radio carrier wave. In amplitude modulation,
the amplitude of the carrier wave is varied in proportion to that of the message signal being
transmitted.
The process of extracting an original message signal from the modulated wave is known
as detection or demodulation. The circuit, which demodulates the modulated wave, is known
as the demodulator.

2.4 Step by step procedure to carry out the experiment:

 Obtain the suitable expressions for the modulation of wave.


 Write the program in MATLAB tool using the above.
 Enter the freq. of carrier and message signal
 Set the value of message signal according to modulation index.
 Plot and observe the amplitude modulated waves for different value of modulation index.

Communication Lab 2018-2019 4


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:

2.5 Code:
3 clc;
4 close all;
5 clear all;
6 m=1;
7 %for message signal
8 Am=5;
9 fm=2e3;
10 Tm=1/fm;
11 t=0:Tm/1000:10*Tm;
12 ym=Am*cos(2*pi*fm*t);
13 subplot(4,1,1);
14 plot(t,ym)
15 title ( ' Modulating Signal ');
16 xlabel ( ' time(sec) ');
17 ylabel (' Amplitud(volt) ');
18 % carrier frequency
19 Ac=Am/m;
20 fc=fm*10;
21 Tc=1/fc;
22 yc=Ac*cos(2*pi*fc*t);
23 subplot(4,1,2);
24 plot(t,yc), grid on;
25 title ( ' Carrier Signal ');
26 xlabel ( ' time(sec) ');
27 ylabel (' Amplitud(volt) ');
28 %for amplitude modulated signal
29 y=Ac*(1+m*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
30 subplot(4,1,3);
31 plot(t,y);
32 % for upper envelope
33 hold on
34 plot(t,Ac*(1+ym/Ac),'r');
35 % for lower envelope
36 hold on
37 plot(t,-Ac*(1+ym/Ac),'g');
38 axis;
39 title ( ' Amplitude Modulated signal ');
40 xlabel ( ' time(sec) ');
41 ylabel (' Amplitud(volt) ');
42 grid on;

Communication Lab 2018-2019 5


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory
43 manual
% for AM Course code:
demodulation
44 z=(Ac*Ac*m).*ym;
45 subplot(4,1,4);
46 plot (t,z);
47 title('AM Demodulation');
48 xlabel ('time(sec)');
49 ylabel (' Amplitud(volt) ');

2.6 Observations and results:

The amplitude modulation and demodulation is depending on modulation index.


The modulation index should be in-between 0 to 1.If modulation index is greater than 1
Then the signal will be over modulated hence it make difficult to demodulate the original
message signal.

2.7 Plotting of the graph:

Communication Lab 2018-2019 6


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual
2.8 Conclusion of theCourse code:
experiment:
We can conclude that there is no distortion or phase reversal when the modulation index is
in-between 0 -1.Hence we can demodulate the signal without losing any information of the
signal. But we might lose some information while demodulating when modulation index is
greater than 1 due to over modulation.

Communication Lab 2018-2019 7


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:


Experiment No: 3

Title: DSBSC Modulation and Demodulation

3.1 Aim of the experiment: To modulate and demodulate DSBSC signal

3.2 List of Equipment/ Components required to conduct the experiment with their
specifications:

Table 1.1: List of all components and equipment used to conduct the experiment.
Sl.No Equipment/ Specification Quantity Cost per item
Components in Rs.
1 Matlab software - - -

2 P.C

3.3 Theoretical background for the experiment:

DSB-SC is basically an amplitude modulation wave without the carrier, therefore reducing
power waste, giving it a 50% efficiency.Double-sideband suppressed-carrier transmission is
transmission in which frequencies produced by amplitude modulation are symmetrically
spaced above and below the carrier frequency and the carrier level is reduced to the lowest
practical level, ideally being completely suppressed. In the DSB-SC modulation, unlike in
AM, the wave carrier is not transmitted; thus, much of the power is distributed between the
side bands, which imply an increase of the cover in DSB-SC.

3.4 Step by step procedure to carry out the experiment:

 Obtain the suitable expressions for the modulation of DSB-SC wave.


 Write the program in MATLAB tool using the expression.
 Enter the freq. of carrier and message signal
 Set the value of message signal according to modulation index.
 Plot and observe the DSB-SC waves for different values of modulation index.

Communication Lab 2018-2019 8


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual
3.5 Code: Course code:
4 clc;
5 close all;
6 clear all;
7 m=1;
8 Am=5;
9 fm=2e3;
10 Tm=1/fm;
11 t=0:Tm/1000:6*Tm;
12 ym=Am*cos(2*pi*fm*t);
13 subplot(4,1,1);
14 plot(t,ym)
15 title ( ' Modulating Signal ');
16 xlabel ( ' time(sec) ');
17 ylabel (' Amplitud(volt) ');
18 % carrier frequency
19 Ac=Am/m;
20 fc=fm*10;
21 Tc=1/fc;
22 yc=Ac*cos(2*pi*fc*t);
23 subplot(4,1,2);
24 plot(t,yc), grid on;
25 title ( ' Carrier Signal');
26 xlabel ( ' time(sec) ');
27 ylabel (' Amplitud(volt)');
28 % for DSBSC Modulation
29 y=ym.*yc;
30 subplot(4,1,3);
31 plot(t,y);
32 hold on
33 plot(t,Ac*(ym),'r');
34 hold on;
35 plot (t,-Ac*(ym),'g');
36 axis;
37 title ( 'DSBSC Modulated wave ');
38 xlabel ( ' time(sec) ');
39 ylabel (' Amplitud(volt) ');
40 grid on;
41 % For DSBSC Demodulation
42 z=y.*yc;

Communication Lab 2018-2019 9


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory
43 manual
subplot(4,1,4); Course code:
44 plot(t,z);
45 title ( 'DSBSC Demodulated wave ');
46 xlabel ( ' time(sec) ');
47 ylabel (' Amplitud(volt) ');

3.6 Observations and results:


We observe that that carrier frequency is suppressed while modulation of signal, hence
reducing power waste and increase efficiency .All power is in sideband frequencies ,hence
no power is in carrier wave.

3.7 Plotting of the graph:

3.8 Conclusion of the experiment:


We can conclude that the DSB-SC wave unlike amplitude modulated wave does not
transmit carrier wave which enables it to transmit the wave with less power compared to
AM wave.

Communication Lab 2018-2019 10


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:

Experiment No: 4

Title: Linear and circular convolution and correlation

4.1 Aim of the experiment: write an matlab program that can perform linear and
circular convolution

4.2 List of Equipment/ Components required to conduct the experiment with their
specifications:

Table 1.1: List of all components and equipment used to conduct the experiment.
Sl.No Equipment/ Specification Quantity Cost per item
Components in Rs.
1 Matlab software - - -

2 P.C - 1 -

4.3 Theoretical background for the experiment:

Linear convolution:

The response y[n] of LTI system for any arbitrary input x[n] is given by convolution of
impulse response h[n] of the system and the arbitrary input x[n].

y[n]=x[n]*h[n]

Circular convolution:

The convolution of two periodic sequences with period N is called circular convolution
of two signal x1[n] and x2[n] is denoted by

Y[n]=x1[n]*x2[n]

Communication Lab 2018-2019 11


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course


It Can only performed onlycode:
if both the sequences consist of equal number of samples. If
the sequences are of different in length then convert the smaller size sequences to that
of larger size by appending zeroes.

4.4 Step by step procedure to carry out the experiment:


 Obtain the suitable expressions for the linear and circular convulation.
 Write the program in MATLAB tool using the expression.
 Enter the inputs to perform the operations
 Plot and observe the output and verify

4.5 codes:

linear convolution:

clc;
close all
clear all
x=input('enter x:');
h=input('enter h:');
m=length(x);
n=length(h);
X=[x,zeros(1,n)];
H=[h,zeros(1,m)];
for i=1:n+m-1
Y(i)=0;
for j=1:m
if(i-j+1>0)
Y(i)=Y(i)+X(j)*H(i-j+1);
else
end
end
end
stem(Y);
ylabel('Y(n)');
xlabel('--n');
title('convulation of two signal without convulation function');

Communication Lab 2018-2019 12


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:


circular convolution:

clc;
close all;
clear all;
x1=input('Enter the first sequence :');
x2=input('Enter the second sequence:');
N1=length(x1);
N2=length(x2);
N=max(N1,N2);

if(N2>N1)
x4=[x1,zeros(1,N-N1)];
x5=x2;
elseif(N2==N1)
x4=x1;
x5=x2;
else
x4=x1;
x5=[x2,zeros(1,N-N2)];
end

x3=zeros(1,N);
for m=0:N-1
x3(m+1)=0;
for n=0:N-1
j=mod(m-n,N);
x3(m+1)=x3(m+1)+x4(n+1).*x5(j+1);
end
end

subplot(4,1,1)
stem(x1);
title('First Input Sequence');
xlabel('Samples');
ylabel('Amplitude');
subplot(4,1,2)
stem(x2);
title('Second Input Sequence');
xlabel('Samples');
ylabel('Amplitude');
subplot(4,1,3)
stem(x3);
title('Circular Convolution Using Modulo Operator');
xlabel('Samples');

Communication Lab 2018-2019 13


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:


ylabel('Amplitude');

%In built function


y=cconv(x1,x2,N);
subplot(4,1,4)
stem(y);
title('Circular Convolution using Inbuilt Function');
xlabel('Samples');
ylabel('Amplitude');

autocorrelation

%% Program for autocorrelation between two sequences....


%% without using the inbuilt function xcorr
clc;
clear all;
close all;
%% Inputs
% You can specify the inputs or can take them through command window
% h= input ('enter the sequence h');
% x= input ('enter the sequence x');
h=[1 1 2 3 4];
x=[1 3 5 7 9 2 4 6 8];
pp=h;qq=x;
% Plot the inputs
% subplot(3,1,1); stem(h,'m'); title ('h');ylabel('amplitude')
% %
% subplot(3,1,2); stem(x,'b'); title ('x');ylabel('amplitude')
%% calculate the cross correlation
l1= length (h); % calculate length of sequence h
l2= length (x); % calculate length of sequence x
l=abs (l1-l2); % calculate difference in lengths of sequence
if (l1 > l2)
x= [x zeros(1,l)];
else if(l2 > l)
h= [h zeros(1,l)];
end
end
h= [h zeros(1, max (l1, l2))];
for shift= 0:max(l1,l2);
new_x = [zeros(1, shift) x zeros(1, (max (l1 , l2))-shift)];
y(shift+1,:)= sum(h.* new_x);
end
y=y';
% Display the correlation sum
subplot(3,1,1); stem(pp,'m'); title ('h');ylabel('amplitude')
subplot(3,1,2); stem(qq,'b'); title ('x');ylabel('amplitude')
subplot(3,1,3); stem(y,'r'); title ('cross correlation'); xlabel('time');

Communication Lab 2018-2019 14


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:


4.6 Plotting of the graph:

Linear convolution:

Circular convolution:

Communication Lab 2018-2019 15


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual Course code:

Communication Lab 2018-2019 16


School of Electronics
and Communication Engineering

Communication and Signal Processing Laboratory Journal 17EECP301

laboratory manual
Correlation Course code:

4.7 Result:

Communication Lab 2018-2019 17

You might also like