0% found this document useful (0 votes)
402 views8 pages

Experiment No.: 02 Name of The Experiment: SSB Modulation Using MATLAB Coding

The document describes an experiment on SSB modulation using MATLAB coding. The objective is to understand SSB modulation theory and develop a MATLAB code to generate SSB signals. The experiment involves generating message, carrier and modulated SSB signals in time and frequency domains. MATLAB code is provided to implement SSB modulation without and with built-in functions. Results and discussions are presented.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
402 views8 pages

Experiment No.: 02 Name of The Experiment: SSB Modulation Using MATLAB Coding

The document describes an experiment on SSB modulation using MATLAB coding. The objective is to understand SSB modulation theory and develop a MATLAB code to generate SSB signals. The experiment involves generating message, carrier and modulated SSB signals in time and frequency domains. MATLAB code is provided to implement SSB modulation without and with built-in functions. Results and discussions are presented.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Experiment No.

: 02
Name of the Experiment: SSB Modulation using MATLAB Coding

Objective:
1. To understand the operation theory of double sideband suppressed carrier (SSB)
modulation.
2. To understand the waveforms and frequency spectrum of SSB.
3. To develop the MATLAB Code of SSB modulation.
Learning Outcome: After completing this experiment the students will be able to:
1. Learn about working principle of a complete Single Sideband modulator.
2. Explain the output waveforms & frequency spectrum of SSB modulated signal.
Theory:
Write a theory according to the discussion in the class
MATLAB Code:
Without using the built in MATLAB function
clc;
close all;
clear all;

fs = 1000000; %sampling frequency


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

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


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

m_h = delayseq(m,Tm/4,fs); % 90 degree phase delayed message signal


c_h = delayseq(c, Tc/4, fs); % 90 degree phase delayed carrier signal

figure(1) % message signal


subplot(2,1,1)
plot(t,m)
subplot(2,1,2)
plot(t,m_h)

dsb_in = m.*c; %DSB-SC signal in phase


dsb_90 = m_h.*c_h;%DSB-SC signal 90 degree phase shifted

SSB_sig = dsb_in + dsb_90;

figure(2) %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_in)
xlabel('time (s)')
ylabel('amplitude of DSB-SC')

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

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

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); %zero centered fft of SSB signal

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;%magnitude spectrum of SSB signal

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


figure(3) %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)')
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])

Using the built in MATLAB function


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);
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);

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

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)')
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])

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

You might also like