DSB-SC Modulation and Demodulation Script: Filtering and Analysis of Demodulated Signal - , Assignments of Electrical and Electronics Engineering

A matlab script for solving computer problem 2 in ecgr 4123/5191, focusing on dsb-sc (double side band suppressed carrier) modulation and demodulation. The script generates and analyzes the message signal, modulated signal, demodulated signal prior to low pass filter (lpf), and the received signal. The document also includes the frequency response of the lpf filter.

Typology: Assignments

Pre 2010

Uploaded on 07/28/2009

koofers-user-shw-1
koofers-user-shw-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECGR 4123/5191
Computer Problem #2
3) Partial Solution to Problem 3
Script File Used for the entire Problem
% Script File - DSB-SC Modulation and Demodulation
% Information signal is a Rectangular Pulse with 1st Null Bandwidth of
% 2 rad/s. The carrier frequency, wo = 2*pi*100 rad/s.
% Set sampling frequency for time domain. This sampling frequency is used
% consistently throughtout the entire example. Sampling frequency needs
% to be at leat twice the highest frequency.
%
% Highest frequency 2*wo + 8*2. The 8*2 rad/s term is required to take
% into account the high frequency terms in our information signal.
% To obtain "better" plots the sampling frequency is sellected to be 20
% times the carrier frequency.
close all
clear all
wo=2*pi*100;
fs = 20*wo;
a0 = 2*pi*6; % Select -3dB down point of filter to be at 6 Hz
h = exp(-a0.*[0:1/fs:1]); % Note there are better approaches to
%designing this filter, but this method is straight forward
freqz(h,1,2^15,fs) % Plot of frequency response of the filter
t=-10:1/fs:10; % time variable
x=((t+1)>0) - ((t-1)>0); % rect information signal
y = x.* cos(wo*t); % Modulated signal
z = y.* cos(wo*t); % Demodulated signal prior to LPF
xhat = filter(h,1,z); %Demodulated signal
dtft(x,fs,'Message signal');
dtft(y,fs,'Modeulated signal');
dtft(z,fs,'Demodulated signal prior to LPF');
dtft(xhat,fs,'Received signal');
plot(t,x,'r', 'linewidth', 2)
hold on
plot(t,xhat/sum(h.^2),'--')
pf2

Partial preview of the text

Download DSB-SC Modulation and Demodulation Script: Filtering and Analysis of Demodulated Signal - and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECGR 4123/

Computer Problem

3) Partial Solution to Problem 3

Script File Used for the entire Problem

% Script File - DSB-SC Modulation and Demodulation

% Information signal is a Rectangular Pulse with 1st Null Bandwidth of

% 2 rad/s. The carrier frequency, wo = 2pi100 rad/s.

% Set sampling frequency for time domain. This sampling frequency is used

% consistently throughtout the entire example. Sampling frequency needs

% to be at leat twice the highest frequency.

% Highest frequency 2wo + 82. The 8*2 rad/s term is required to take

% into account the high frequency terms in our information signal.

% To obtain "better" plots the sampling frequency is sellected to be 20

% times the carrier frequency.

close all

clear all

wo=2pi100;

fs = 20*wo;

a0 = 2pi6; % Select -3dB down point of filter to be at 6 Hz

h = exp(-a0.*[0:1/fs:1]); % Note there are better approaches to

%designing this filter, but this method is straight forward

freqz(h,1,2^15,fs) % Plot of frequency response of the filter

t=-10:1/fs:10; % time variable

x=((t+1)>0) - ((t-1)>0); % rect information signal

y = x.* cos(wo*t); % Modulated signal

z = y.* cos(wo*t); % Demodulated signal prior to LPF

xhat = filter(h,1,z); %Demodulated signal

dtft(x,fs,'Message signal');

dtft(y,fs,'Modeulated signal');

dtft(z,fs,'Demodulated signal prior to LPF');

dtft(xhat,fs,'Received signal');

plot(t,x,'r', 'linewidth', 2)

hold on

plot(t,xhat/sum(h.^2),'--')

Frequency (hz)

Relative Amplitude

Message signal

Frequency (Hz)

Phase (degrees)

Frequency (Hz)

Magnitude (dB)

3dB down @ 6 Hz

+20dB down @ 100 Hz

LPF Filter Frequency

Response: Note 20dB

attenuation at carrier

frequency

Frequency (hz)

Relative Amplitude

Modeulated signal

Frequency (hz)

Relative Amplitude

Demodulated signal prior to LPF

Double Frequency

terms, Filtered

by LPF

Frequency (hz)

Relative Amplitude

Received signal

Double frequency terms have been

attenuated by a factor of 100

time, s

Message Signal:

Orignal & Received

Original Received