9/3/21 10:14 PM D:/IV Sem/Commlab/Lab1/lab13.m 1 of 2: All All
9/3/21 10:14 PM D:/IV Sem/Commlab/Lab1/lab13.m 1 of 2: All All
m 1 of 2
clc;
clear all;
close all;
%carrier signal
yc=Ac*cos(2*pi*fc*t); %carrier signal
subplot(6,1,2)
plot(t,yc)
grid on;
title('Carrier signal')
%SSB-SC AM Modulation
y = (Am*Ac)/2*cos(2*pi*(fc+fm)*t); %multiplying message signal with carrier
subplot(6,1,3)
plot(t,y)
title('Amplitude Modulated SSB-SC Signal') %plotting SSB-SC modulated signal
grid on;
%demodulation of SSB-SC
d=y.*yc; %multiplying the modulated signal with cos(2pifct)
[b,a]=butter(5,0.1); %butterworth filter
d1=filter(b,a,d); %implementing the filter passing the modulated signal
through filter
subplot(6,1,4)
plot(d1)
title('demodulated Signal')
grid on;
of modulating signal
title('frequency plot of SSB-SC modulated signal' )
%demodulated signal
%Spectrum of demodulated signal
N=length(t);
ydf=fftshift(fft(d1,N)/N); %using fft to calculate fourier transform and
fftshift is used to center the fourier transform
f=(-N/2:N/2-1); %creating range for x axis
subplot(6,1,6)
plot(f,real(ydf),'b') %plotting the real part of fourier transform of
modulating signal
hold on;
plot(f,imag(ydf),'r') %plotting the imagfinary part of fourier transform of
modulating signal
title('frequency plot of demodulated signal')