You are on page 1of 4

Experiment No.

: 05
Name of the Experiment: Implementation of AM/DSB-LC signal generation
using MATLAB coding and Simulink model

Objective:
1. To understand the operation theory of DSB-LC or AM.
2. To design and implement DSB-LC/AM signal using the MATLAB Coding
3. To design and implement DSB-LC/AM signal using the Simulink model
4. To explain the spectrum of the DSB-LC/AM.

Theory:
Write theory according to the discussion in the class
MATLAB Coding:

clc;
close all;
clear all;

%% Defining the parameters

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)
A = 1; %carrier amplitude

%% Defining message and carrier signal


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

m_size = size(message); % dimension of message signal


c_size = size(carrier); % dimension of carrier signal

%% Defining AM or DSB-LC signal


am_sig = message.*carrier + A*carrier; %AM signal

%% time-domain representation of the signals


figure(1)

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

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

subplot(3,1,3)
plot(t,am_sig)
xlabel('time (s)')
ylabel('amplitude of AM')

%% message, carrier and am signal in the frequency domain

mess = fft(message); % fourier transform


carr = fft(carrier);
am = fft(am_sig);

mess_spec = fftshift(mess); %zero centered fft of message signal


carr_spec = fftshift(carr); %zero centered fft of carrier signal
am_spec = fftshift(am); %zero centered fft of DSB-SC 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
am_mag_spec = abs(am_spec)/N; %magnitude spectrum of DSB-SC signal

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


f_normalized = f_Hz/fs; % frequency axis range in normalized frequency

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

subplot(3,1,1)
plot(f_Hz, mess_mag_spec)
axis([-12000 12000 0 0.5])
xlabel('frequency (Hz)')
ylabel('magnitude of m(t)')

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

subplot(3,1,3)
plot(f_Hz, am_mag_spec)
xlabel('frequency (Hz)')
ylabel('magnitude of AM')
axis([-12000 12000 0 0.5])
Simulink Model:

To know the details of the simulink block, watch the class video.
Results:

Discussion:

Student Task:
1. For AM matlab coding, take the modulation index = (last digit of student ID + 1)*0.1.
2. Show the results in the report and explain the waveforms and the spectrum

You might also like