NAME-Aditya Bhura SCHOLAR ID - 1914033 Ece-A Experiment-3 TITLE/AIM OF THE EXPERIMENT: DSBSC Modulation and Demodulation Software Used:Matlab Theory
NAME-Aditya Bhura SCHOLAR ID - 1914033 Ece-A Experiment-3 TITLE/AIM OF THE EXPERIMENT: DSBSC Modulation and Demodulation Software Used:Matlab Theory
THEORY:
1. DSBSC Modulation - In the process of Amplitude Modulation, if the carrier is suppressed and the saved
power is
distributed to the two sidebands, then such a process is called as Double Sideband Suppressed Carrier
system or
simply DSBSC. It is plotted as shown in the following figure.
2. DSBSC Demodulation - The process of extracting an original message signal from DSBSC wave is
known as
detection or demodulation of DSBSC. The following demodulators (detectors) are used for demodulating
DSBSC
wave.
(a) Coherent Detector
MATHEMATICAL EQUATIONS -
Let the Modulating signal be m(t)= Am cos(2 πfmt) and Carrier signal be c(t)= Ac cos(2 πfct) .
Mathematically, we can represent the equation of DSBSC wave as the product of modulating and carrier
signals.
s(t) = m(t)c(t) = Ac Am cos(2 πfct) cos(2 πfmt)
PROCEDURES :
1. First, we write the code on MATLAB.
2. Then we adjust the carrier sine wave’s frequency.
3. We set the simulation time such as 0.01s to observe the signals clearly.
4. Finally, we run our simulation and observe the curve formed and note the plots.
MATLAB CODE :
1. DSBSC Modulation -
clear all;
close all;
clc;
fm=10*10^3; % fm = message signal frequency
fc=100*10^6;% fc = carrier signal frequency
Am=5;% Am = message signal amplitude
Ac=10;% Ac = carrier signal amplitude
Tm = 1/fm;
Tc = 1/fc;
t1 = 0:Tm/999:6*Tm;
message_signal = Am*sin(2*pi*fm*t1);
subplot(3,1,1)
plot(t1, message_signal, 'r');
% grid();
title('Message signal');
carrier_signal = Ac*sin(2*pi*fc*t1);
subplot(3,1,2)
plot(t1, carrier_signal, 'b');
% grid();4
title('Carrier Signal');
amplitude = message_signal.*carrier_signal;
subplot(3,1,3)
plot(t1,amplitude, 'g');
% grid();
title('DSBSC');
2. DSBSC Demodulation
clear all;
clc;
t = 0:0.001:5; %time.
fm = 1;%frequency of message signal.
fc = 10;%frequency of carrier signal.
fs=100*fc;%sampling frequency.
Am = 5;%Amplitude of message signal.
Ac = 5;%Amplitude of carrier signal.
msg =Am.*cos(2*pi*fm*t);%message signal.
carrier = Ac.*cos(2*pi*fc*t);%carrier signal.
dsb_sc = msg.*carrier; %dsb sc modulated wave
ld=length(dsb_sc);
f=linspace(-fs/2,fs/2,ld);
DSB_SC=fftshift(fft(dsb_sc,ld)/ld); %frequency spectrum of dsb_sc modulated signal.
pmo = 2*dsb_sc.*carrier; %product modulator output
pmo = pmo/Ac;
nf = fm/fs; %normalised frequency
[num, den] = butter(5,3*nf); %butter worth lpf of 5th order
msg_r = filter(num,den,pmo); %demodulated signal after passing through lpf
lr=length(msg_r);
fr=linspace(-fs/2,fs/2,lr); %frequency bins
MSG_R=fftshift(fft(msg_r,lr)/lr); %frequency spectrum of demodulated signal
subplot(4,1,1);
plot(t, msg);
title('MESSAGE SIGNAL (TIME DOMAIN)');
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,2);
plot(t, carrier);
title('CARRIER SIGNAL (TIME DOMAIN)');
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,3);
plot(t, dsb_sc);
title('MODULATED DSB SC SIGNAL (TIME DOMAIN)');
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,4);
plot(t, msg_r);
title('DEMODULATED DSB SC SIGNAL (TIME DOMAIN)');
xlabel('time (sec)');
ylabel('amplitude');
grid on;
figure;
subplot(2,1,1);
plot(f, abs(DSB_SC));
xlim([-15 15]);
title('DSB SC MODULATION IN FREQUENCY DOMAIN');
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
subplot(2,1,2);
plot(fr, abs(MSG_R));
xlim([-6 6]);
title('DSB SC DEMODULATION IN FREQUENCY DOMAIN');
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
RESULTS:
1. DSBSC Modulation
2. DSBSC Demodulation
(A) Time Domain
CONCLUSION - The experiment was performed on MATLAB and the code for DSBSC modulation and
demodulation worked successfully.
EXPERIMENT-4
THEORY:
(a) SSBSC Modulation - The process of suppressing one of the sidebands along with the carrier and
transmitting a single
sideband is called as Single Sideband Suppressed Carrier system or simply SSBSC. It is plotted as shown in
the following
figure.
(b) SSBSC Demodulation - The process of extracting an original message signal from SSBSC wave is
known as detection or
demodulation of SSBSC. Coherent detector is used for demodulating SSBSC wave.
MATHEMATICAL EQUATIONS:
Let the modulating signal be, m(t)=Am cos(2πfmt) and the carrier signal be, c(t)=Ac cos(2πfct). Where, Am
and Ac are the amplitude of the modulating signal and the carrier signal respectively, fm and fc are the
frequency of the modulating signal and the carrier signal respectively.
Then, the equation of SSBSC Modulated wave will be
S(t) = (AcAm/2) cos(2π(fm+fc)t) For upper sideband
OR
S(t) = (AcAm/2) cos(2π(fc-fm)t) For lower sideband
PROCEDURE:
1. First, we write the code on MATLAB.
2. Then we adjust the carrier sine wave’s frequency.
3. We set the simulation time such as 0.01s to observe the signals clearly.
4. Finally, we run our simulation and observe the curve formed and note the plots.
MATLAB CODE:
1. SSBSC Modulation -
close all;
clear all;
clc;
fm=100; % fm = message signal frequency
fc=1000;% fc = carrier signal frequency
Am=5;% Am = message signal amplitude
Ac=10;% Ac = carrier signal amplitude
m = Am/Ac;
A = (m*Ac);
Tm = 1/fm;
Tc = 1/fc;
t = 0:Tm/999:6*Tm;
message_signal = Am*sin(2*pi*fm*t);
carrier_signal = Ac*sin(2*pi*fc*t);
x1 = cos(2*pi*fc*t).*cos(2*pi*fm*t);
x2 = sin(2*pi*fc*t).*sin(2*pi*fm*t);
x3 = x1+x2;
x4 = x1-x2;
SSBSC_lsb = A*(x3);
SSBSC_usb = A*(x4);
subplot(4,1,1)
plot(t, message_signal, 'r');
grid();
title('message signal');
subplot(4,1,2)
plot(t, carrier_signal, 'g');
grid();
title('Carrier signal');
subplot(4,1,3)
plot(t, SSBSC_lsb, 'b');
grid();
title('LSB of SSBSC wave cutting off USB');
subplot(4,1,4)
plot(t, SSBSC_usb, 'r');
grid();
title('USB of SSBSC wave cutting off LSB');
2. SSBSC Demodulation -
close all;
clear all;
clc;
t1 = -0.02:1.e-4:0;
t2 = 0:1.e-4:0.02;
Ta = 0.01;
m1 = 1 - abs((t1+Ta)/Ta);
m1 = [zeros([1 200]),m1,zeros([1 400])];
m2 = 1 - abs((t2-Ta)/Ta);
m2 = [zeros([1 400]),m2,zeros([1 200])];
m = m1 - m2;
t = -0.04:1.e-4:0.04;
fc = 400;% Frequency of carrier wave
c = cos(2*fc*pi*t);% Carrier
dsb = 2*m.*c;
fl = length(t);
fl = 2^ceil(log2(fl));
f = (-fl/2:fl/2-1)/(fl*1.e-4);
mF = fftshift(fft(m,fl)); % Frequency Response of Message Signal
cF = fftshift(fft(c,fl));% Frequency Response of Carrier Signal
dsbF = fftshift(fft(dsb,fl));% Frequency Response of DSBSC
ssbfilt = zeros(1,fl);
lssb = floor(fc*1.e-4*fl);
ssbfilt(fl/2-lssb+1:fl/2+lssb) = ones(1,2*lssb);
ssbF = dsbF.*ssbfilt;
ssb = real(ifft(fftshift(ssbF)));
ssb = ssb(1:length(t));
dem = ssb.*c;
a = fir1(25,100*1.e-4);%Filtering
b = 1;
rec = filter(a,b,dem);
recF = fftshift(fft(rec,fl)); % Frequency Response of Recovered Message Signal
figure(1);
subplot(2,2,1);
plot(t,m);
title('Message Signal');
xlabel('{\it t} (sec)');
ylabel('m(t)');
grid;
subplot(2,2,2);
plot(t,ssb);
title('MODULATED SIGNAL');
xlabel('{\it t} (sec)');
ylabel('LSB(t)');
grid;
subplot(2,2,3);
plot(t,dem);
title('De-Modulated');
xlabel('{\it t} (sec)');
grid;
subplot(2,2,4);
plot(t,rec);
title('Recovered Signal');
xlabel('{\it t} (sec)');
ylabel('m(t)');
grid;
figure(2);
subplot(2,2,1);
plot(f,abs(mF));
title('Freq Response of Message Signal');
xlabel('f(Hz)');
ylabel('M(f)');
grid;
axis([-600 600 0 200]);
subplot(2,2,2);
plot(f,abs(cF));
title('Freq Response of Carrier');
grid;
xlabel('f(Hz)');
ylabel('C(f)');
axis([-600 600 0 400]);
subplot(2,2,3);
plot(f,abs(ssbF));
title('Freq Response of DSBSC');
xlabel('f(Hz)');
ylabel('LSB(f)');
grid;
axis([-600 600 0 200]);
subplot(2,2,4);
plot(f,abs(recF));
title('Freq Response of Recovered Signal');
xlabel('f(Hz)');
ylabel('M(f)');
grid;
axis([-600 600 0 100]);
RESULTS:
1. SSBSC Modulation –
2. SSBSC Demodulation –
(A) Time Domain
(B) Frequency Domain
CONCLUSION: The experiment was performed on MATLAB and the code for DSBSC modulation and
demodulation worked successfully.