Amplitude Modulation and Demodulation - Digilent Reference
Amplitude Modulation and Demodulation - Digilent Reference
(https://digilent.com/reference/_detail/reference/test-and-measurement/guides/complementary-labs/lab5/cover.png?id=test-and-
measurement%3Aguides%3Acomplementary-labs%3Alab5%3Astart)
This lab introduces students to communications theory with amplitude modulation and demodulation. Students will explore the
mathematical theory behind amplitude modulation and use the Analog Discovery Studio to visualize the effects of amplitude
modulation in the time and frequency domains. Then, students will use LabVIEW to program an AM demodulator and use it to
explore and visualize the effects of the modulation coefficient on the quality of the demodulated signal and the effects of
different parameters (such as windowing and averaging) on the Fast Fourier Transform (FFT). Advanced students can challenge
themselves to build a system to send data between two Analog Discovery Studios or to build an analog AM demodulator.
Introduction
In an amplitude modulation (AM) communications system, a device is used to convert data into an electrical signal, for example, a
microphone is used to convert audio into an electrical signal. This signal, known as the message or baseband signal, is then used
to modify (modulate) the amplitude of another signal, known as the carrier signal.
Learning Objectives
In this section, students will:
Investigate classical amplitude modulation theory in time and frequency domains.
Learn about the basic properties of FFTs.
See how modulation index affects AM signals in time and frequency domains.
Use LabVIEW to acquire and demodulate an AM signal.
See how modulation index affects am signals in time and frequency domains.
Part List
The following equipment is required for this experiment:
Hardware Software
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 1/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
Amplitude Modulation
Amplitude Modulation Theory
The image to the right shows how the message modulates the
carrier signal to produce the AM signal. Notice that the AM
signal’s amplitude increases or decreases as the message signal
increases or decreases – this is where the term amplitude
modulation comes from. Even though we only need the
amplitude to change, looking at the AM signal we can see that
by modulating the amplitude, we have added frequency
components to the carrier signal. In order to analyze these
components, we will use the Fast Fourier Transform or FFT
for short.
As the name suggests, the FFT allows us to apply a Fourier
transform on the signal and convert the signal from its time- (https://digilent.com/reference/_detail/reference/test-and-
domain representation to its frequency domain measurement/guides/complementary-labs/lab5/am.jpg?id=test-
representation. By converting to the frequency domain, we and-measurement%3Aguides%3Acomplementary-
can see what frequencies have been added to the signal due to labs%3Alab5%3Astart)
the modulation.
In this lab, we will explore amplitude modulation in the time
and frequency domain, and see how the amplitudes of the
message and carrier signals affect the modulated signal.
In telecommunications theory, amplitude modulation in its simplest form can be represented as a few signals. The first signal is
the carrier signal, c(t). This signal can be represented by the equation: c(t) = Asin(2πf t), where f is the frequency and A
c c
is the amplitude of the carrier signal. For this lab, we will let A = 1.
The second signal is the message signal, m(t). This is represented by the equation: m(t) = M cos(2πf t + ϕ), where f is m m
the frequency and M is the amplitude of the message signal. The message signal can also be referred to as the modulation signal.
For this lab, we will assume that M ≤ 1. This allows us to ensure that (1 + m(t)) is always positive and prevents
overmodulation of the signal.
From these two signals, an amplitude modulated signal, y(t), can be defined as follows:
y(t) = [1 + m(t)]c(t) = [1 + M cos(2πf t + ϕ)]Asin(2πf t).
m c
Using trigonometric identities, y(t) can be expanded in a sum of three sine waves:
1 1
y(t) = Asin(2πfc t) + Amsin[2π(fc + fm )t + ϕ] + Amsin[2π(fc − fm )t + ϕ]
2 2
The frequencies of the additional sine waves produced by amplitude modulation are called the upper (for the higher frequency)
and lower (for the lower frequency) sidebands. The difference between the upper sideband and the lower sideband is referred to
as the bandwidth of the AM signal.
Questions and Exercises
How do the frequencies of the three sine waves compare to the original message and carrier signal frequencies?
If we took an FFT of this signal, what would we ideally expect to see?
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 2/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
Given f c = 100kH z and f m = 1kH z , find the upper sideband, the lower sideband, and the bandwidth of the AM
signal.
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/wiring_diagram_-
_scope_bb.png?id=test-and-
measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
The envelope of an oscillating signal is the smooth curve outlining the signal peaks.
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 3/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
When discussing amplitude modulation, it can be important to talk about the modulation index (m) of a signal. The modulation
M
index describes the extent to which a signal is modulated about the carrier and can be expressed with the equation: m = , A
where M is the amplitude of the message signal and A is the amplitude of the carrier signal.
While we can compute the modulation index directly from a known carrier and message signal, it is more common to compute
the modulation index from measurements taken from using the Scope. Using this method, the modulation index can be defined as:
Vmax −Vmin
m =
Vmax +Vmin
, where V max
is the maximum peak to peak value of the modulated signal and V min
is the minimum peak to
peak value of the modulated signal.
Questions and Exercises
The amplitude of the AM signal is given as a percentage of the carrier. What is the amplitude in volts of the AM signal as
configured?
Describe the upper envelope of the AM signal. How do the upper envelope’s shape and amplitude compare to the message
signal? The message signal can be seen as the AM signal in the Wavegen display window.
What is the theoretical modulation index of the modulated signal as configured?
Find V ,V
max , and the observed value of m. How does the observed value compare to the theoretical value calculated
min
before?
Go to the Wavegen instrument panel. Slowly increase the AM index value while observing changes on the Scope. How does
the modulated signal change as the index approaches 100%? As it goes over 100%?
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/wf3.png?id=test-
and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
more stable picture. Set the Trace Type to use Exponential dB (https://digilent.com/reference/_detail/reference/test-and-
Average. Now that we have a better picture of what is going measurement/guides/complementary-labs/lab5/wf5.png?id=test-
on, let us more closely examine the FFT. and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
As mentioned earlier, an FFT allows us to apply the Fourier transform. Another way of saying this is that the FFT is a digital
implementation of the Fourier transform. Thus, the FFT does not yield a continuous spectrum of frequencies. Instead, the FFT
returns a discrete spectrum, in which the frequency content of the signal is separated into a finite number of frequency lines, or
N
bins. The number of bins in the FFT is half the number of samples acquired. bins = , where N is the number of samples
2
acquired. Aside from the number of bins, the size of each bin is also important when considering FFTs. The bin size, also called
the resolution of the FFT, gives us the smallest detectable change in frequency. For example, if our FFT resolution is 1.5kHz, we
would not be able to detect the difference between a frequency component that is 1.1kHz and one that is 1.2kHz. Similarly, we
would not be able to detect the difference between a frequency component that is 112.1kHz and one that is 113kHz. We define
the FFT resolution using the expression below: df = , where df is the FFT resolution and T is the total acquisition time for
1
T
N
one period of data. T can be defined as follows: T =
fs
, where N is the number of samples acquired and f is the sampling
s
fs
rate on the FFT. From there it follows that: df =
N
.
Lastly, if we multiply the number of bins by the resolution, we can find the bandwidth of the FFT. The bandwidth of the FFT
gives us the maximum frequency we can resolve. Using the equation for df and bins the formula for the bandwidth can be
fs N fs
given as: BW = df ∗ bins =
N 2
=
2
.
Look back at the Spectrum display window. Click on the green arrow to see the advanced configuration options for the Spectrum.
Looking at the advanced configuration options, we see that the maximum number of bins we can have is 4097. We can also see
that the number of samples acquired (given by Samples) is set and there is no way to change that. Thus, to increase our frequency
resolution, we need to lower the sampling rate. Unfortunately, the Spectrum does not expose the sampling rate used to take the
FFT. Instead, the sampling rate is automatically chosen based on the range specified by Freq. Range.
Aside from showing the frequency content of a signal, the FFT also gives us a glimpse into the relative power in each frequency.
In this case, we can say that the carrier signal contains most of the power in an AM signal while the sidebands contain relatively
equal amounts of power.
Questions and Exercises
Using the cursors, find the frequency where the largest spike occurs. What frequency does this correspond to in our
modulated signal? How does the FFT compare to what we expected to see? Is it possible to identify the upper and lower
sidebands?
Observing this equation for df , what are two ways we can increase the resolution of the FFT?
Observing the equation for BW , how can you increase the bandwidth of the FFT?
The BINs value gives us the number of bins in our FFT. Change the BINs value to 4097. What is the resolution of the
FFT as configured? What is the bandwidth of the FFT?
How will the resolution of the FFT change if we lowered the number of bins?
Lower the frequency range to 94kHz-106kHz. What is the resolution of the FFT now? What is the new bandwidth of the
FFT?
Using the cursors, what is the value of the lower and upper sidebands? How do they compare in amplitude to the carrier
frequency?
Go back to the Wavegen and slowly increase the AM Index value while observing the Spectrum display. How does the
modulation index affect the relative power of the sidebands and the carrier frequencies? What happens when the
modulation index reaches 200%?
Amplitude Demodulation
Amplitude Demodulation Theory
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 5/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
Note: Before testing or running your LabVIEW code, make sure that you exit WaveForms. The Digilent WaveForms VIs will throw an error if
Digilent WaveForms is still open when you run your code.
Note: If you don't know what a VI does, you can check the Context Help by pressing Ctrl+H, then highlighting the respective VI.
Objective
Design a VI in LabVIEW that will demodulate an AM signal
using envelope detection. You can build your own VI,
following the steps below, or you can download the VI used
in this guide from here: am.zip
(https://digilent.com/reference/_media/reference/test-and-
measurement/guides/complementary-labs/lab5/am.zip)
The Front Panel shows eight graphs. The first two show the
carrier and the modulating signals. Three of the remaining
graphs are in the time domain and show the modulated signal,
the signal after rectification, and finally the recovered signal.
The other three graphs are in the frequency domain and show
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 6/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/vi.jpg?id=test-and-
measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
General Operation
This VI should generate the carrier and modulating signals
required by the user, then output the modulated signal on the
selected Wavegen channel. The selected Scope channel will be
used to acquire the modulated signal. The received signal
should be displayed, then rectified. The rectified signal should
be displayed as well, then filtered with a low-pass filter. After
(https://digilent.com/reference/_detail/reference/test-and-
the low-pass filter, the DC component of the resulting signal
measurement/guides/complementary-labs/lab5/flow.png?id=test-
should be removed before displaying it. The FFT of the
and-measurement%3Aguides%3Acomplementary-
received, the rectified, and the resulting signal should be
labs%3Alab5%3Astart)
displayed on the required frequency range.
The image to the right presents the general program flow of
this VI.
Hardware Setup
For testing the VI, use the same hardware setup as for the
Analysis with WaveForms (https://digilent.com/reference/test-
and-measurement/guides/complementary-
labs/lab5/start#analysis_with_waveforms) section.
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 7/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/wiring_diagram_-
_scope_bb.png?id=test-and-
measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
Software Setup
Setup and Instrument Configuration
As a first step, the control and indicator elements should be
placed by right-clicking on the Front Panel and selecting the
required element. In this VI we need three Combo Boxes: one
which sets the device type, with the elements “Analog
Discovery Studio”, “Analog Discovery 2” and “Analog
Discovery”, one which selects the used Scope channel, with the
elements “mso/1” and “mso/2” and one which sets the used
Wavegen channel, with the elements “fgen/1” and “fgen/2”. A
Stop Button should also be placed on the Front Panel, to
interrupt the program if needed.
(https://digilent.com/reference/_detail/reference/test-and-
Two Graphs and four Knobs are needed to set the amplitude measurement/guides/complementary-labs/lab5/front_panel.jpg?
and the frequency of the carrier, the frequency of the id=test-and-measurement%3Aguides%3Acomplementary-
modulating signal and the modulation index, and to display labs%3Alab5%3Astart)
the resulting signals.
The other three Knobs and six Graphs are used to set the
frequency range on which the FFTs are displayed, to select
the cut-off frequency of the low-pass filter in the
demodulator, and to display the modulated signal, the rectified
signal, the demodulated signal, and the spectrum of these.
Arrange everything on the Front Panel, then right-click on the
y-axis of the time-domain graphs and deselect Autoscale. Set
the range of these axes to make the signals visible. Rename
the placed elements by double-clicking on their name.
Rename the axes of the graphs by double-clicking on them
and also set the multiplier of each axis to match with the
labeled unit of measurement (for example: set the multiplier
to 1e+06 if the labeled unit of measurement is μs).
In the Block diagram, initialize the Scope instrument (MSO),
then configure the selected analog channel (mso/1 or mso/2)
in DC mode, with 1X probe attenuation, set the vertical offset
to 0 and the vertical range to 5V. Enable the channel with a
True constant.
Configure the timing of the Scope to sampling mode, with a
sampling rate of 12 times of the carrier frequency, the
acquisition time of 1
and pretrigger time of
messagef requency
(https://digilent.com/reference/_detail/reference/test-and-
0s. measurement/guides/complementary-labs/lab5/block1.png?
Initialize the Wavegen instrument (FGEN) and select the id=test-and-measurement%3Aguides%3Acomplementary-
desired channel. labs%3Alab5%3Astart)
Amplitude Modulation
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 8/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
Amplitude Demodulation
Measure with the Scope, then extract the data coming from the
selected Scope channel from the result. This will be the
modulated signal. You can rectify this signal by taking the
absolute value of the whole signal. In this case, the absolute
value function behaves like an ideal full-wave rectifier. Filter
the rectified signal with a low-pass filter. You can even remove
the DC component of the filtered signal to eliminate its
offset. (https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/block3.png?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/filter.png?id=test-
and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 9/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/block4.png?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/block5.png?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/spectral.png?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 10/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/windowing.jpg?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/block6.png?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
(https://digilent.com/reference/_detail/reference/test-and-
measurement/guides/complementary-labs/lab5/block7.png?
id=test-and-measurement%3Aguides%3Acomplementary-
labs%3Alab5%3Astart)
Increase the Modulation Coefficient to 15% in steps of 1%. Observe the graphs as you do this. How does the modulation
coefficient affect the demodulated signal? What happens to the demodulated signal as the modulation coefficient increases
past 1?
The maximum buffer size for the Analog Discovery Studio is 8192 samples. This means that the largest number of
samples we can acquire during a single read is 8192 samples. Since the number of samples has a set maximum, how else
can we increase the resolution of the FFT? Recall the formula for df discussed in the Measurements in the Frequency
Domain (https://digilent.com/reference/test-and-measurement/guides/complementary-
labs/lab5/start#measurements_in_the_frequency_domain) section of this lab. What is the practical limitation of using this other
method to increase the FFT resolution?
Further Exploration
The topics below go over two ways you can continue exploring after finishing this lab. The first topic looks into using multiple
instruments to transmit and receive and the second topic goes into transmitting and receiving messages vs single tones.
Analog AM Demodulation
In this lab, we decided to demodulate by implementing a method known as envelope detection in software. However, the steps in
envelope detection (rectifying and filtering) can also be done using hardware. In our previous labs we have talked about both
rectification (Lab 4: Full-Wave Rectifiers (https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab4/start))
and low-pass filtering (Lab 2: Active and Passive Filters (https://digilent.com/reference/test-and-measurement/guides/complementary-
labs/lab2/start)). Use the knowledge and circuits you’ve built from these labs to put together a circuit that performs the same
function as our software demodulator.
Compare the results of your hardware demodulator to the ones from our software demodulator. What are some considerations
and trade-offs between using a hardware system and a software system?
Next Steps
For more complementary laboratories, return to the Complementary Labs for Electrical Engineering
(https://digilent.com/reference/test-and-measurement/guides/complementary-labs/start) page of this wiki.
For technical support, please visit the Test and Measurement (https://forum.digilentinc.com/forum/8-test-and-measurement/)
section of the Digilent Forums.
Company (https://digilent.com/company/)
About Us (https://digilent.com/company/#about-digilent)
FAQs (https://digilent.com/company/#faqs)
Shipping & Returns (https://digilent.com/shipping-returns/)
Jobs (https://digilent.com/company/#jobs)
Legal & Privacy (https://digilent.com/legal-privacy/)
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 12/13
12/18/21, 10:08 PM Lab 5: Amplitude Modulation and Demodulation - Digilent Reference
News (https://digilent.com/news/)
Blog (https://digilent.com/blog/)
Newsletter (https://digilent.com/news/#newsletter)
Events (https://digilent.com/news/#events)
Affiliations (https://digilent.com/affiliations/)
List of Distributors (https://digilent.com/affiliations/#distributors)
Technology Partners (https://digilent.com/affiliations/#partners)
Submit
Contact Us
Support Channels (https://digilent.com/support/#channels)
Digilent
Pullman, WA 99163
(http://twitter.com/DigilentInc)
(http://facebook.com/Digilent)
(https://www.youtube.com/user/DigilentInc)
(https://github.com/digilent)
(https://instagram.com/digilentinc)
(https://www.linkedin.com/company/1454013)
(https://www.flickr.com/photos/127815101@N07)
https://digilent.com/reference/test-and-measurement/guides/complementary-labs/lab5/start 13/13