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

AC_LabFile

Uploaded by

codecatalyst0
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)
7 views

AC_LabFile

Uploaded by

codecatalyst0
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/ 36

ANALOG COMMUNICATIONS LAB (ECC-255)

ANALOG COMMUNICATIONS LAB


(ECC-255)

Submitted by: Submitted to:


Anshika Mr. Risheek Kumar
06020802823 Asst. Prof.
ECE-B/3rd Sem ECE Department

BHAGWAN PARSHURAM INSTITUTE OF TECHNOLOGY


PSP-4, DR. K. N. KATJU MARG, SEC-17, ROHINI, DELHI-110085
(AFFILIATED TO GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY)

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

ANALOG COMMUNICATIONS LAB (ECC-255)


LAB RECORD
Name of Student: _______ANSHIKA_________________________
Enrolment Number: ___06020802823_________________________
Semester: ____THIRD______________________________________
Branch/Section: ____ECE-B_________________________________

Exp. Experiment Name Date Signature Remarks

No

01. To study the generation of AM


Modulation and Demodulation.
02. To study the generation of SSB
Modulation and Demodulation.
03. To study the generation of DSB-SC
Modulation and Demodulation.

04. To study the generation and detection of


PAM wave.

05. To study the generation and detection of


PWM wave.

06. To study the generation and detection of


PPM wave.

07. To study the generation of VSB signal.

08. Write a MATLAB code for frequency


Synthesizer.

09. To generate frequency modulated and


demodulated signal using VCO

onSimulink.

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

10. To generate amplitude modulated and


demodulated signal using Simulink.

11. To perform the AM DSB-SC signal


generation and detection using Simulink.

12. To perform the AM SSB-SC signal


generation and detection using Simulink.

EXPERIMENT - 01
AIM: To study the generation of AM Modulation and Demodulation.
SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
clc;
close all;
clear all;
fs=8000;
fm=20;
fc=500;
Am=1;
Ac=1;
t=[0:0.1*fs]/fs;
m=Am*cos(2*pi*fm*t);
c=Ac*cos(2*pi*fc*t);
ka=0.5;
u=ka*Am;
s1=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,1:3);
plot(t,m);
title('message signal(fm=20Hz)');
subplot(4,3,4:6);
plot(t,c);

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

title('carrier signal(fc=500Hz)');
subplot(4,3,7);
plot(t,s1);
title('under modulated signal(ka.Am=0.5)');
Am=2;
ka=0.5;
u=ka*Am;
s2=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,8);
plot(t,s2);
title('perfect modulated signal(ka.Am=1)');
Am=5;
ka=0.5;
u=ka*Am;
s3=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,9);
plot(t,s3);
title('over modulated signal(ka.Am=2.5)');
r1=s1.*c;
[b,a]=butter(5,2*fc/fs);
mr1 = filter(b,a,r1);
subplot(4,3,10);
plot(t,mr1);
title('Demodulated Signal for (ka*Am=0.5)');
r2 = s2.*c;
[b,a] = butter(5,2*fc/fs);
mr2 = filter(b,a,r2);
subplot(4,3,11);
plot(t,mr2);
title('Demodulated Signal for ka*Am=1');

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

r3 = s3.*c;
[b,a] = butter(5,2*fc/fs);
mr3 = filter(b,a,r3);
subplot(4,3,12);
plot(t,mr3);
title('Demodulated Signal for ka*Am=2.5');

CODE SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT SNIPPET:

EXPERIMENT - 02
AIM: To study the generation of SSB Modulation and Demodulation.
SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
clc;
clear all;
Vm = input("Enter msg amp:");
fm = input("Enter msg freq:");
Vc = input("Enter carrier amp:");
fc = input("Enter carrier freq:");
fs = input("Enter Sampling freq:");
t = 0.1/fs:1;
m = Vm*cos(2*pi*fm*t);
c = Vc*cos(2*pi/fc*t);
Vn = Vm*cos(2*pi*fm*t-(pi/2));
usb = m*2*cos(2*fc*t*pi)-Vn*2*sin(2*pi*fc*t);

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

lsb = m*2*cos(2*fc*t*pi) + Vn*2*sin(2*pi*fc*t);


temp=usb*cos(2*pi*fc*t);
[num,den]=butter(5,2*fc/fs);
subplot(2,3,1);
plot(t,m);
grid;
xlabel('Frequency');
ylabel('Amplitude');
title('message signal');

subplot(2,3,2);
plot(t,c,'r');
grid;
xlabel('Frequency');
ylabel10('Amplitude');
title('Carrier signal');

subplot(2,3,3);
plot(t,usb,'k');
grid;
xlabel('Frequency');
ylable('Amplitude');
title('USB');

subplot(2,3,4);
plot(t,lsb,'k');
grid;
xlabel('Frequency');
ylabel('Amplitude');
title('LSB');

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

z=filtfilt(num,den,temp)*2;
z=z-vc;
subplot(2,3,5);
plot(t,z);
grid;
xlabel('time');
ylabel('amp');
title('recieved msg signal');

CODE SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT SNIPPET:

EXPERIMENT - 03
AIM: To study the generation of DSB-SC Modulation and Demodulation.
SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
clc;
clear all;
Vm = input('Enter msg ampl ');
fm = input('Enter msg freq ');
Vc = input('Enter carr ampl ');
fc = input('Enter carr freq ');
fs = input('Enter sampling freq ');
t = 0:1/fs:1;
m = Vm*cos(2*pi*fm*t);
c = Vc*cos(2*pi*fc*t);

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

Vm = Vm*cos(2*pi*fm*t - pi/2);
usb = m.*cos(2*pi*fc*t) - Vm.*sin(2*pi*fc*t);
lsb = m.*cos(2*pi*fc*t) + Vm.*sin(2*pi*fc*t);
subplot(2,3,1);
plot(t,m);
grid;
xlabel('freq');
ylabel('Ampl');
title('carrier signal');
subplot(2,3,2);
plot(t,c);
grid;
xlabel('freq');
ylabel('Ampl');
title('carrier signal');
subplot(2,3,3);
plot(t,usb);
grid;
xlabel('freq');
ylabel('Ampl');
title('USB');
subplot(2,3,4);
plot(t,lsb);
grid;
xlabel('freq');
ylabel('Ampl');
title('LSB');
subplot(2,3,5);
plot(t,m);
xlabel('freq');

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

ylabel('Ampl');
title('carrier signal');
temp = usb.*cos(2*pi*fc*t);
[num,den] = butter(5,2*fc/fs);
z = filter(num,den,temp);
z = z - Vc;
subplot(2,3,5);
plot(t,z);
grid;
xlabel('time');
ylabel('Ampl');
title('Recovered msg signal');

CODE SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT SNIPPET:

EXPERIMENT - 04

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

AIM: To study the generation and detection of PAM wave.


SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
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=fft(xa);
subplot(3,1,1)
plot(xa);
grid
subplot(3,1,2);
stem(abs(X));
grid
Y=ifft(X);
subplot(3,1,3);
plot(Y);
grid;

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

CODE SNIPPET:

OUTPUT SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

EXPERIMENT - 05
AIM: To study the generation and detection of PWM wave.
SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
fc=1000;
fs=10000;
f1=200;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
%modulation
y1=modulate(x1,fc,fs,'pwm');
subplot(421);
plot(x1);
title('original signal tokne mesage,f1=500,fs=10000');
subplot(422);
plot(y1);
axis([0 500 -0.2 1.2]);
title('PWM')
%demodulation
x1_recov=demod(y1,fc,fs,'pwm');
subplot(423);
plot(x1_recov);
title('time domain recovered single tone,f1=200');

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

CODE SNIPPET:

OUTPUT SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

EXPERIMENT - 06
AIM: To study the generation and detection of PPM wave.
SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
clc;
clear all;
close all;
fc=100; fs=1000;
f1=80;
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
subplot(4,2,1)
plot(x1)
title('original msg signal')
y1=modulate(x1,fc,fs,'ppm');

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

subplot(4,2,2)
plot(y1)
axis([0 50 -0.2 1.2])
title('ppm one of f1,fc=1000,f1=80')
fx1=abs(fft(y1,1024));
fx1=fftshift(fx1);
f=(-fs/2):(fs/1024):(fs/2-(fs/1024));
subplot(4,2,3)
plot(f,fx1)
title('freq des ppm signal tone,fc=1000')
x1_recov = demod(y1,fc,fs,'ppm');
subplot(4,2,4)
plot(x1_recov)
title('time domain recovered signal');

CODE SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT SNIPPET:

EXPERIMENT - 07

AIM: To study the generation of VSB signal.

SOFTWARE USED: MATLAB CAMPUS SUITE

SOURCE CODE:
Clc;
Clear all;
Close all;
syms t f
fc=10;
x = heaviside(t+2)- heaviside(t-2);
X=fourier(x,f) ;
XX = @(f) 2*(sin(2*f)./(f));
f=[-100:0.01:100-0.01];
Xshift=( XX(f-fc)+XX(f+fc));

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

Hf = @(f) ((f>=9 & f<=20)) ;


SSB =@(f) Xshift.*(f>=10 & f<=50) + Xshift.*(f<=-10 & f>=-50);
VSB_upper = @(f)((XX(f-fm)+XX(f+fm)).*Hf(f))
subplot(211);
plot(f,abs(SSB(f)),[-10,-10],[0,4],[10 10],[0,4],'r','linewidth',1.5);
xlim([-35 35]);
grid on;ylim([0 6]);
xlabel('frequency in Hz');
ylabel('Magnitude spectrum');
legend('| SSB-SC|');
title('Single Sideband Modulation');
subplot(212)
plot(f,abs(VSB_upper(f)),'b',-f,abs(VSB_upper(f)),'k','linewidth',1.5);
grid on;
xlabel('frequency in Hz');
ylabel('Magnitude spectrum');
title('SSB');ylim([0 6]);
legend('| VSB |');
xlim([-35 35]);
CODE SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT SNIPPET:

EXPERIMENT - 08
AIM: Write a MATLAB code for frequency synthesizer
SOFTWARE USED: MATLAB CAMPUS SUITE
SOURCE CODE:
close all;
clear all;
clc;
fs = 10000;
t = 0:1/fs:1.5;
f=50;
x1 = square(2*pi*f*t);
subplot(3,1,1);

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

plot(t,x1);
axis([0 0.2 -1.2 1.2]);
xlabel('Time (sec)');
ylabel('Amplitude');
title('Square wave input with freq=50HZ');
t = 0:1/fs:1.5;
x2 = square(2*pi*2*f*t);
subplot(3,1,2);
plot(t,x2);
axis([0 0.2 -1.2 1.2]);
xlabel('Time (sec)');
ylabel('Amplitude');
title('frequency multiplication by a factor of 2');
x3 = square(2*pi*f/2*t);
subplot(3,1,3);
plot(t,x3);
axis([0 0.2 -1.2 1.2]);
xlabel('Time (sec)');
ylabel('Amplitude');
title('frequency division by a factor of 2');

CODE SNIPPET:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT SNIPPET:

EXPERIMENT - 09

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

AIM: To generate frequency modulated and demodulated signal using VCO on


Simulink.
SOFTWARE USED: MATLAB CAMPUS SUITE
SIMULINK DESIGN:

PARAMETER SETTINGS:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

EXPERIMENT - 10
AIM: To generate amplitude modulated and demodulated signal using
Simulink.
SOFTWARE USED: MATLAB CAMPUS SUITE.
SIMULINK DESIGN:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

PARAMETER SETTINGS:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

EXPERIMENT - 11
AIM: To perform the AM DSB-SC signal generation and detection using
Simulink.
SOFTWARE USED: MATLAB CAMPUS SUITE
SIMULINK DESIGN:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

PARAMETER SETTINGS:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

EXPERIMENT - 12
AIM: To perform the AM SSB-SC signal generation and detection using
Simulink.
SOFTWARE USED: MATLAB CAMPUS SUITE
SIMULINK DESIGN:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

PARAMETER SETTINGS:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

OUTPUT:

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT


ANALOG COMMUNICATIONS LAB (ECC-255)

ANSHIKA (06020802823) DEPARTMENT OF ECE, BPIT

You might also like