Sei sulla pagina 1di 13

Experiment # 5

Amplitude Modulation
Amplitude Modulation (AM) is a method of conveying a baseband message signal over a higher
frequency carrier signal by varying the amplitude of the carrier signal in proportion to the baseband
signal. The baseband signal is typically a low-frequency signal, such as an audio signal, and the
carrier signal is typically a high-frequency signal, such as a radio frequency signal.
The basic process of AM involves multiplying the baseband signal with a sinusoidal carrier signal,
resulting in a modulated signal. The modulated signal can then be transmitted over a
communication channel and demodulated at the receiver to recover the original baseband signal.
There are three types of AM:
1. Double-Sideband Suppressed Carrier (DSB-SC): This type of AM modulation method uses
the full amplitude of the modulating signal to vary the amplitude of the carrier wave. The resulting
signal contains both the upper and lower sidebands, each containing a copy of the original
modulating signal, as well as the original carrier frequency. However, the carrier frequency is
suppressed or removed, resulting in less efficient use of the transmitted power.
2. Single-Sideband Suppressed Carrier (SSB-SC): This type of AM modulation method
eliminates one of the sidebands and the carrier frequency from the modulated signal, resulting in
more efficient use of the transmitted power. The resulting signal contains only one sideband, either
the upper or lower sideband, depending on the method used. This type of modulation is commonly
used in voice communications, as it provides a higher signal-to-noise ratio.
3. Vestigial Sideband (VSB): This type of AM modulation method is a combination of DSB-SC
and SSB-SC. It involves removing a portion of the unwanted sideband and leaving a "vestige" or
remnant of it. This allows for more efficient use of the transmitted power while still maintaining a
certain level of compatibility with the DSB-SC receiver. VSB is commonly used in television
broadcasting.

AM is commonly used in AM radio broadcasting and marine communication. One of the main
advantages of AM is its robustness against noise and interference, which makes it suitable for use
in harsh environments. However, one of the main disadvantages of AM is its limited bandwidth
efficiency, which can be a problem in systems where bandwidth is limited, such as satellite
communication.
In summary, Amplitude Modulation (AM) is a method of conveying a baseband message signal
over a higher frequency carrier signal by varying the amplitude of the carrier signal in proportion
to the baseband signal. It has two types of AM, DSB, and SSB. AM is commonly used in AM
radio broadcasting and marine communication; it is robust against noise and interference but has
a limited bandwidth efficiency.
Example 1:
clc;clear
% Define the sampling frequency and time vector
fs = 1000;
t = 0:1/fs:1;
% Generate modulating signal
m = sin(2*pi*5*t);
% Generate carrier signal
c = cos(2*pi*100*t);
% Modulate the carrier signal using the ammod function
y = ammod(m,100,fs,0);
% Plot the signals in the time domain
figure
subplot(3,1,1);
plot(t,m);
title('Modulating Signal');
subplot(3,1,2);
plot(t,c);
title('Carrier Signal');
subplot(3,1,3);
plot(t,y);
title('Modulated Signal');
% Demodulation using the amdemod function
y_demod = amdemod(y,100,fs,0);
% Plot the demodulated signal in the time domain
figure
subplot(2,1,1);
plot(t,y_demod);
title('Demodulated Signal');
% Perform FFT on the demodulated signal
Y_demod = abs(fft(y_demod));
% Plot the demodulated signal in the frequency domain
subplot(2,1,2);
plot(f,Y_demod);
title('FFT of Demodulated Signal');
This code is an example of how to generate and analyze an amplitude-modulated (AM) signal
using MATLAB.
The code performs the following steps:
1. The first step is to clear the command window and any existing variables in the workspace by
using the "clc" and "clear" commands.
2. The next step is to define the sampling frequency and time vector. The sampling frequency is
set to 1000 Hz and the time vector is set to start from 0 to 1 second, sampled at the rate of 1000
samples per second.
3. The next step is to generate a modulating signal. A sinusoidal signal with a frequency of 5 Hz
is generated over the time vector defined earlier. This will be the signal that will be used to
modulate the carrier signal.
4. The next step is to generate a carrier signal. A cosine signal with a frequency of 100 Hz is
generated over the time vector defined earlier. This will be the signal that will be modulated by
the modulating signal.
5. The next step is to modulate the carrier signal using the "ammod" function. The "ammod"
function modulates the carrier signal with the modulating signal, resulting in an amplitude-
modulated signal. The carrier frequency is set to 100 Hz, the sampling frequency is set to 1000
Hz, and the modulation index is set to 0.
6. The next step is to plot the signals in the time domain. The modulating signal, carrier signal,
and modulated signal are plotted using the "plot" function.
7. The next step is to perform a fast Fourier transform (FFT) on the signals. The FFT of the
modulating signal, carrier signal, and modulated signal are calculated using the "fft" function.
8. The next step is to plot the signals in the frequency domain. The magnitude of the FFT of the
modulating signal, carrier signal, and modulated signal are plotted using the "plot" function.
9. The next step is to demodulate the modulated signal using the "amdemod" function. The
"amdem od" function demodulates the modulated signal, resulting in the original modulating
signal. The
carrier frequency is set to 100 Hz, the sampling frequency is set to 1000 Hz, and the modulation
index is set to 0.
10. The next step is to plot the demodulated signal in the time domain. The demodulated signal is
plotted using the "plot" function.
11. The last step is to perform a fast Fourier transform (FFT) on the demodulated signal. The FFT
of the demodulated signal is calculated using the "fft" function.
12. The last step is to plot the demodulated signal in the frequency domain. The magnitude of the
FFT of the demodulated signal is plotted using the "plot" function

In summary, this code generates an amplitude-modulated (AM) signal by modulating a sinusoidal


modulating signal with a carrier signal. The modulated signal is then demodulated to recover the
original modulating signal. The code also plots the signals in the time and frequency domain and
uses the "ammod" and "amdemod" functions to modulate and demodulate the signals respectively.
It is worth noting that the example in this code is a basic one, and some other variables and
parameters can be adjusted and optimized depending on the specific application and scenario. For
example, the modulation index, carrier frequency, and sampling frequency can be adjusted to
change the characteristics of the modulated signal. Also, different types of modulating and carrier
signals can be used, such as a square wave or sawtooth wave.
Additionally, the code also shows how to visualize the signals in the time and frequency domain
using the "plot" and "fft" functions. Understanding the time-domain and frequency-domain
representation of signals is important in communication systems as it can provide insight into the
characteristics of the signal, such as its frequency content, harmonic distortion, and noise.
In conclusion, this code is an example of how to generate and analyze an amplitude-modulated
(AM) signal using MATLAB. It shows the basic steps of modulating and demodulating a signal,
as well as visualizing the signals in the time and frequency domain. It serves as a starting point for
further experimentation and optimization in communication systems and also helps in
understanding the characteristics of signals.
Example 2: AM modulation (DSB-SC) (without MATLAB built-in function) :
clc;clear;clf;close all
% Define the sampling frequency and time vector
fs = 1000;
t = 0:1/fs:1;
% Generate modulating signal
m = sin(2*pi*5*t);
fc=100;
% Generate carrier signal
c = cos(2*pi*100*t);
% Modulate the carrier signal
y = m.*c;
% Perform Demodulation
y_demod = y.*c;
% Design a low-pass filter
N = 5;
[b,a] = butter(N,fc*2/fs);
% Apply the low-pass filter to the demodulated signal
y_filtered = filter(b,a,y_demod);
% Plot the original modulating signal in the time domain
figure
subplot(3,2,1);
plot(t,m);
title('Modulating Signal');
% Perform FFT on the modulating signal
Y_m = fft(m);
% Plot the modulating signal in the frequency domain
subplot(3,2,2);
plot(abs(Y_m));
title('FFT of Modulating Signal');
% Plot the carrier signal in the time domain
subplot(3,2,3);
plot(t,c);
title('Carrier Signal');
% Perform FFT on the carrier signal
Y_c = fft(c);
% Plot the carrier signal in the frequency domain
subplot(3,2,4);
plot(abs(Y_c));
title('FFT of Carrier Signal');
% Plot the modulated signal in the time domain
subplot(3,2,5);
plot(t,y);
title('Modulated Signal');
% Perform FFT on the modulated signal
Y_y = fft(y);
% Plot the modulated signal in the frequency domain
subplot(3,2,6);
plot(abs(Y_y));
title('FFT of Modulated Signal');
% Plot the demodulated signal in the time domain
figure
subplot(2,2,1);
plot(t,y_demod);
title('Demodulated Signal');
% Perform FFT on the demodulated signal
Y_demod = fft(y_demod);
% Plot the demodulated signal in the frequency domain
subplot(2,2,2);
plot(abs(Y_demod));
title('FFT of Demodulated Signal');
% Plot the filtered demodulated signal in the time domain
subplot(2,2,3);
plot(t,y_filtered);
title('Filtered Demodulated Signal');
% Perform FFT on the filtered demodulated signal
Y_filtered = fft(y_filtered);
% Plot the filtered demodulated signal in the frequency domain
% Plot the filtered demodulated signal in the time domain
subplot(2,2,3);
plot(t,y_filtered);
title('Filtered Demodulated Signal');
% Perform FFT on the filtered demodulated signal
Y_filtered = fft(y_filtered);
% Plot the filtered demodulated signal in the frequency domain
subplot(2,2,4);
plot(abs(Y_filtered));
title('FFT of Filtered Demodulated Signal');
This code is an example of how to demodulate an amplitude-modulated (AM) signal using a low-
pass filter in MATLAB. The code performs the following steps:
1. The first step is to clear the command window and any existing variables in the workspace by
using the "clc", "clear", "clf" and "close all" commands.
2. The next step is to define the sampling frequency and time vector. The sampling frequency is
set to 1000 Hz and the time vector is set to start from 0 to 1 second, sampled at the rate of 1000
samples per second.
3. The next step is to generate a modulating signal. A sinusoidal signal with a frequency of 5 Hz
is generated over the time vector defined earlier. This will be the signal that will be used to
modulate the carrier signal.
4. The next step is to generate a carrier signal. A cosine signal with a frequency of 100 Hz is
generated over the time vector defined earlier. This will be the signal that will be modulated by
the modulating signal.
5. The next step is to modulate the carrier signal by multiplying the modulating signal with the
carrier signal. This results in an amplitude-modulated signal.
6. The next step is to perform demodulation by multiplying the modulated signal with the carrier
signal.
7. The next step is to design a low-pass filter. In this case, the filter order is set to 5, and the cutoff
frequency is set to half of the sampling frequency (fc*2/fs).
8. The next step is to apply the low-pass filter to the demodulated signal using the "filter" function.
9. The next step is to plot the original modulating signal, carrier signal, modulated signal, and
demodulated signal in the time domain and frequency domain. The modulating signal, carrier
signal, modulated signal, and demodulated signal are plotted using the "plot" function. The FFT
of the modulating signal, carrier signal, modulated signal, and demodulated signal are calculated
using the "fft" function and plotted using the "plot" function.
10. The next step is to plot the filtered demodulated signal in the time domain and frequency
domain. The filtered demodulated signal is plotted using the "plot" function. The FFT of the
filtered demodulated signal is calculated using the "fft" function and plotted using the "plot"
function.

In summary, this code demodulates an amplitude-modulated (AM) signal by multiplying the


modulated signal with the carrier signal. A low-pass filter is then applied to the demodulated signal
to remove the high-frequency components. The code also plots the signals in the time and
frequency domain and uses the "filter" function to filter the demodulated signal. The use of the
low-pass filter helps in isolating the modulating signal from the carrier signal, which is important
in communication systems as it can provide insight into the characteristics of the signal.
Example 3 : AM SSB-SC modulation/demodulation
clc;clear all;
% Define the message signal
fs = 1000; % sample rate
t = 0:1/fs:1; % time vector
f_m = 5; % frequency of message signal
m = sin(2*pi*f_m*t); % message signal
% Define the carrier signal
f_c = 100; % frequency of carrier signal
% Perform SSB modulation
y_mod = ssbmod(m,f_c,fs);
% Perform SSB demodulation
y_demod = ssbdemod(y_mod,f_c,fs);
% Plot the signals in time domain
figure;
subplot(3,1,1);
plot(t,m);
title('Message signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(3,1,2);
plot(t,y_mod);
title('SSB modulated signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(3,1,3);
plot(t,y_demod);
title('SSB demodulated signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Plot the signals in frequency domain
figure;
subplot(3,1,1);
plot(fftshift(abs(fft(m))));
title('Message signal');
xlabel('Frequency (Hz)');
ylabel('Amplitude');
subplot(3,1,2);
plot(fftshift(abs(fft(y_mod))));
title('SSB modulated signal');
xlabel('Frequency (Hz)');
ylabel('Amplitude');
subplot(3,1,3);
plot(fftshift(abs(fft(y_demod))));
title('SSB demodulated signal');
xlabel('Frequency (Hz)');
ylabel('Amplitude');
In this script, a message signal (m) is defined with a frequency of 5 Hz and a sample rate of 10000
Hz. A carrier signal (f_c) with a frequency of 50 Hz is also defined. The message signal is then
modulated using

Post Lab

Implement DSB-SC and SSB-SC Modulation/Demodulation on Simulink

Potrebbero piacerti anche