You are on page 1of 5

Experiment No.

: 03
Name of the Experiment: MATLAB Code of Product detection of SSB-SC
demodulation

Objective:
1. To understand the operation theory of double sideband suppressed carrier SSB-SC
demodulator.
2. To design and implement the MATLAB Coding of SSB-SC demodulator.
3. To explain the spectrum of the SSB-SC demodulator.

Learning Outcome: After completing this experiment the students will be able to:
1. Learn about working principle of a product detector of a double sideband suppressed carrier
demodulator.
2. Design SSB-SC demodulator by MATLAB Coding.
3. Explain the time-domain and the frequency domain representation of demodulated signal.
Theory:
Write theory according to the discussion in the class
MATLAB Coding:

clc;
close all;
clear all;

fs = 1000000; %sampling frequency


T = 1/fs; %sampling period
N = 10000; %length of the signal
t = (0:N-1)*T; %time vector
fm = 1000; %frequency of message signal (Hz)
fc = 10000; %frequency of carrier signal (Hz)

m = sin(2*pi*fm*t); %message signal


c = sin(2*pi*fc*t); %carrier signal

m_size = size(m);

This study source was downloaded by 100000801932233 from CourseHero.com on 05-03-2022 23:20:06 GMT -05:00

https://www.coursehero.com/file/91347762/Experiment-4-SSB-Demodulationpdf/
c_size = size(c);

dsb_sig = m.*c; %DSB-SC signal


SSB_sig = ssbmod(m,fc,fs);

figure(1) %time-domain representation of the signals

subplot(4,1,1)
plot(t,m)
xlabel('time (s)')
ylabel('amplitude of m(t)')

subplot(4,1,2)
plot(t,c)
xlabel('time (s)')
ylabel('amplitude of carrier')

subplot(4,1,3)
plot(t,dsb_sig)
xlabel('time (s)')
ylabel('amplitude of DSB-SC')

subplot(4,1,4)
plot(t,SSB_sig)
axis([0 .01 -1 1])
xlabel('time (s)')
ylabel('amplitude of SSB')

mess = fft(m);
carr = fft(c);
dsb = fft(dsb_sig);
ssb = fft(SSB_sig);

This study source was downloaded by 100000801932233 from CourseHero.com on 05-03-2022 23:20:06 GMT -05:00

https://www.coursehero.com/file/91347762/Experiment-4-SSB-Demodulationpdf/
mess_spec = fftshift(mess); %zero centered fft of message signal
carr_spec = fftshift(carr); %zero centered fft of carrier signal
dsb_spec = fftshift(dsb); %zero centered fft of DSB-SC signal
SSB_spec = fftshift(ssb);

mess_mag_spec = abs(mess_spec)/N; %magnitude spectrum of message signal


carr_mag_spec = abs(carr_spec)/N; %magnitude spectrum of carrier signal
dsb_mag_spec = abs(dsb_spec)/N; %magnitude spectrum of DSB-SC signal
ssb_mag_spec = abs(SSB_spec)/N;

f_Hz = ((-N/2):(N/2-1))*(fs/N); %frequency axis range in Hz


f_normalized = ((-N/2):(N/2-1))*(fs/N)/fs; %frequency axis range in normalized frequency

figure(2) %frequency-domain representation of the signals

subplot(4,1,1)
plot(f_Hz, mess_mag_spec)
axis([-12000 12000 0 0.5])
title('Magnitude of message signal vs frequency')
xlabel('frequency (Hz)')
ylabel('magnitude')

subplot(4,1,2)
plot(f_Hz, carr_mag_spec)
xlabel('frequency (Hz)')
ylabel('magnitude')
title('Magnitude of carrier signal vs frequency')
axis([-12000 12000 0 0.5])

subplot(4,1,3)
plot(f_Hz, dsb_mag_spec)
xlabel('frequency (Hz)')

This study source was downloaded by 100000801932233 from CourseHero.com on 05-03-2022 23:20:06 GMT -05:00

https://www.coursehero.com/file/91347762/Experiment-4-SSB-Demodulationpdf/
ylabel('magnitude')
title('Magnitude of DSB-SC signal vs frequency')
axis([-12000 12000 0 0.5])

subplot(4,1,4)
plot(f_Hz, ssb_mag_spec)
xlabel('frequency (Hz)')
ylabel('magnitude')
title('Magnitude of SSB signal vs frequency')
axis([-12000 12000 0 0.5])

%% SSB Demodulation

y = 2*SSB_sig.*c;

Y = fft(y);
Y_spec = fftshift(Y);
Y_mag_spec = abs(Y_spec)/N;

figure(3)
plot(f_normalized(N/2+1:end), Y_mag_spec(N/2+1:end));

% LOW pass filter design

[a, b] = butter(6, .01, 'low');


H = freqz(a, b, N/2);

hold on
plot(f_normalized(N/2+1:end),abs(H))
xlim([0 .05])

ssb_demod = filter(a,b,y);

This study source was downloaded by 100000801932233 from CourseHero.com on 05-03-2022 23:20:06 GMT -05:00

https://www.coursehero.com/file/91347762/Experiment-4-SSB-Demodulationpdf/
ssb_demod_fft = fft(ssb_demod);
ssb_demod_spec = fftshift(ssb_demod_fft);
ssb_demod_mag = abs(ssb_demod_spec)/N;

plot(f_normalized(N/2+1:end), ssb_demod_mag(N/2+1:end),'k','LineStyle','--'); % demoulated


spectrum

figure(4) % comparison of original message and demodulated wave-form


plot(t, m);
hold on
plot(t, ssb_demod, 'r','LineStyle','--')

Results:

Discussion:

Student Task:
1. Write a MATLAB code on the given task during the class.
2. Collect the images of waveforms/spectrum.
3. Explain the waveforms/spectrum

This study source was downloaded by 100000801932233 from CourseHero.com on 05-03-2022 23:20:06 GMT -05:00

https://www.coursehero.com/file/91347762/Experiment-4-SSB-Demodulationpdf/
Powered by TCPDF (www.tcpdf.org)

You might also like