Lab File
Lab File
EXPERIMENT No. – 1
AIM: - Generation of DSB-SC AM signal using balanced modulator.
SOFTWARE USED: MATLAB R2021a
SOURCE CODE:
clc;
clear all;
close 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);
title (‘CARRIER SIGNAL, Fc=50Hz’);
subplot (4,3,7);
plot (t, S1);
title (‘UNDERMODULATED SIGNAL’);
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);
CODE SCREENSHOT
OUTPUT:-
EXPERIMENT No. – 2
AIM: - To study amplitude demodulation by linear diode detector.
SOFTWARE USED: MATLAB R2021a
SOURCE CODE:
Clc;
Clear all;
Close all;
Fs=8000;
Fm=20;
Fc=500;
Am=1;
Ac=1;
t=(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);
title(‘carrier signal (fc=50HZ)’);
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(‘under 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(‘under modulated signal (ka*am=2.5));
temp=s2.*cos(2*pi*fc*t);
[num, den]=butter(5,2*fc/fs);
p=amdemod(s2,fc,fs);
%filtfilt(num, den, temp)*2;
%p=p-c;
subplot(4,3,10:12);
Plot(t,p);
title(‘received signal’);
CODE SCREENSHOT
OUTPUT:-
EXPERIMENT NO :-3
SOURCE CODE:
Clc;
Clear all;
Close all
U=1;
T=0:0.0001:0.5;
m=cos(2*pi*fm*t);
c=cos(2*pi*fc*t);
y1=cos((2*pi*fc*t)+(U.*sin(2*pi*fm*t)));
subplot(4,4,1);
plot(t,m);
xlabel(‘time’);
ylabel(‘amplitude’);
title(‘message signal’);
subplot(4,4,2);
plot(t,c);
xlabel(‘time(sec)’);
ylabel(‘amplitude’);
title(‘carrier signal’);
subplot(4,4,3);
plot(t,y1);
xlabel(‘time(sec)’);
ylabel(‘amplitude’);
title(‘fm modulated signal u=1’);
u=0.5;
y2=cos((2*pi*fc*t)+(U.*sin(2*pi*fm*t)));
subplot(4,4,4);
plot(t,y2);
xlabel(‘time’);
ylabel(‘amplitude’);
u=10;
y3=cos((2*pi*fc*t)+(U.*sin(2*pi*fm*t)));
subplot(4,4,5);
plot(t,y3);
xlabel(‘time’);
ylabel(‘amplitude’);
CODE SCREENSHOT
OUTPUT:-
EXPERIMENT:-4
AIM:- To study demodulation of frequency modulated signal.
SOFTWARE USED:- MATLAB 2021a.
SOURCE CODE:
Clc;
Clear all;
Close all;
Fm=20;
Fc=300;
Fd=200;
Fs=1000;
U=1;
T=0:1/fs:1;
m=cos(2*pi*fm*t);
c= cos(2*pi*fc*t);
figure;
subplot(4,1,1);
plot(t,m);
xlabel(‘time’);
ylabel(‘amplitude’);
title(‘message signal’);
grid on;
subplot(4,1,2);
Plot(t,c);
Xlabel(‘time’);
Ylabel(‘amplitude’);
Title(‘carrier signal’);
Grid on;
Y=fmmod(m,fc,fs,fd);
Z=fmdemod(y,fc,fs,fd);
subplot(4,1,3);
plot(t,y);
xlabel(‘time’);
ylabel(‘amplitude’);
title(‘fm modulation’);
grid on;
subplot(4,1,4);
plot(t,z);
xlabel(‘time’);
ylabel(‘amplitude’);
title(‘fm demodulation);
grid on;
CODE SCREENSHOT
OUTPUT:
EXPERIMENT: 5
AIM:-To generate frequency modulated and demodulated signal using VCO on Simulink.
SOFTWARE USED: MATLAB 2021a.
SIMULINK DESIGN:
PARAMETER SETTINGS
OUTPUT:-
EXPERIMENT NO:-6
AIM:-To generate amplitude modulated and demodulated signal using Simulink.
SOFTWARE USED: MATLAB 2021a.
SIMULINK DESIGN:
PARAMETER SETTINGS
OUTPUT:-
EXPERIMENT NO:-7
AIM:-To perform the AM DSB-SC signal generation and detection using Simulink.
SOFTWARE USED: MATLAB 2021a.
SIMULINK DESIGN:
PARAMETER SETTINGS
Output:-
EXPERIMENT NO:-8
AIM:-To perform the AM SSB-SC signal generation and detection using Simulink.
SOFTWARE USED: MATLAB 2021a.
SIMULINK DESIGN:
PARAMETER SETTINGS
OUTPUT:
EXPERIMENT NO :-9
SOURCE CODE:
Clc;
Close all;
Clear all;
T=0:.001:1;
Fm=
Fc=
Am=
Ac=
M1=am*cos(2*pi*fm*t);
Subplot(6,1,1);
Plot(t,m1);
Title(‘message signal’);
M2=am*sin(2*pi*fm*t);
Mh=imag(Hilbert(m1));
Subplot(6,1,2);
Plot(t,mh);
Title(‘hilbert transform of message signal’);
S=m1.*cos(2*pi*fc*t)+mh.*sin(2*pi*fc*t);
Subplot(6,1,3);
Plot(t,s);
Title(‘modulated signal’);
C1=ac*cos(2*pi*fc*t);
Subplot(6,1,4);
Title(‘carrier signal’);
C2=ac*sin(2*pi*fc*t);
susb= m1.*c1-m2.*c2;
slsb= m1.*c1+m2.*c2;
subplot(6,1,5);
plot(t,susb);
title(‘usb signal’);
subplot(6,1,6);
plot(t,slsb’);
title(‘lsb signal’);
CODE SCREENSHOT
OUTPUT
EXPERIMENT NO :-10
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));
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]);
CODE SCREENSHOT
OUTPUT
EXPERIMENT NO:-11
AIM:-To perform the operation of frequency demodulation with PLL using Simulink.
SOFTWARE USED: SIMULINK.
SIMULINK DESIGN:
PARAMETER SETTINGS
OUTPUT
EXPERIMENT NO:-12
AIM:-To verify the spectral components of AM and FM using Simulink.
SOFTWARE USED: SIMULINK.
SIMULINK DESIGN:
PARAMETER SETTINGS
OUTPUT:-
a.) Spectral Component of AM
EXPERIMENT: 13
AIM: To generate the DSB-FC AM modulated signal.
SOFTWARE USED:- MATLAB 2021a
SOURCE CODE:
clc;
close all;
clear all;
t=0:.0001:1;
fm=input('Enter the value of frequency of message signal: ');
fc=input('Enter the value of frequency of carrier signal: ');
Am = input('Enter the value of message signal amplitude: ');
Ac = input('Enter the value of carrier signal amplitude: ');
m=Am*cos(2*pi*fm*t);
subplot(3,1,1);
plot(m);
title('Message signal');
c=Ac*cos(2*pi*fc*t);
subplot(3,1,2)
plot(c);
title('carrier signal');
y=m.*(1+c);
subplot(3,1,3);
plot(y);
title('DSB-FC signal');
CODE SCREENSHOT
OUTPUT: