You are on page 1of 6

Analog and Digital Demodulation Process

Examples Using GNU Radio


Marcelo R. Doallo Jorge Nestor Rodriguez Mallo
Universidad Tecnológica Nacional Universidad Tecnológica Nacional
Facultad Regional Buenos Aires Facultad Regional Buenos Aires
Buenos Aires, Argentina Buenos Aires, Argentina
m.doallo@frba.utn.edu.ar jrodriguezmallo@frba.utn.edu.ar

Abstract—At present, the Argentine students of Communi-


cation System introductory courses do not have any practical
knowledge on communication because many of these students did
not study in technical high schools. We have to cope with this
situation. Lab works would be the solution; however, equipment
is not always available or at least it is difficult to implement.
This paper describes lab work procedures to explain some
common modulated analog signals such as AM, SSB, Broadcast- Fig. 1. SDR Receiver
ing FM, and elemental digital signals such as OOK and BPSK
using GNU Radio as workspace.
These lab works are being implemented in Communication is using GNU Radio as a simulation environment to implement
System introductory courses in the Electronics Department of demodulation practices of analog or digital bandpass signals.
Universidad Tecnológica Nacional, Facultad Regional Buenos
Aires, with excellent results. This means that students must understand the fundamentals of
These practices are inexpensive because no instruments are software defined radio operation and especially, the meaning
required; all that is necessary is an adequate computer running of complex envelope signal of a bandpass signal. From the
GNU Radio, an open-source software which can be run anywhere. complex envelope signal the processing to recover the modu-
Index Terms—GNU Radio, Education, Communication Sys- lated message.
tems, Software Defined Radio, Complex Envelope, UTN, FRBA,
AM, SSB, FM, OOK, BPSK. The available resources are files with fragments of complex
envelope signals of modulated signals (e.g. AM, SSB, FM,
I. I NTRODUCTION OOK, BPSK) and the blocks of signal treatment developed in
At present, it is widely known that teaching any engineering GNU Radio. This work is aimed at describing examples of
course, regardless of its level, requires dynamism. Introduction demodulation using GNU Radio.
to Communications Systems courses are not the exception and II. S OFTWARE D EFINED R ADIO FUNDAMENTALS
teaching using only Books, Notes, Problem-solving Practice
Guides and Presentations makes it difficult to capture students’ The same official GNU Radio website [2] defines Software
attention. Defined Radio (SDR) as follows: “... a software radio is a
Practical classes are the key, but they require equipment radio system which performs the required signal processing
that is not always available, and in these cases, simulations in software instead of using dedicated integrated circuits in
are very useful. Even with equipment, simulations are also hardware. The benefit is that since software can be easily
a good complement, especially if they can be taken to the replaced in the radio system, the same hardware can be
students’ homes. GNU Radio is proposed as a useful tool for used to create many kinds of radios for different transmission
simulations and practices. standards; thus, one software radio can be used for a variety
In response to the question “What is GNU [1] Radio and of applications!”.
why do I want it?” the GNU Radio official web site [2] The operation principle of a SDR receiver is based on
states that “GNU Radio is a free & open-source software the Nyquist sampling theorem and figure 1 shows the block
development toolkit that provides signal processing blocks diagram of an SDR receiver.
to implement software radios. It can be used with readily- The RF front end adapts the radio signals coming from the
available low-cost external RF hardware to create software antenna for digital conversion, that is:
defined radios, or without hardware in a simulation-like • Amplification of the received signal,
environment. It is widely used in hobbyist, academic and • Limitation in band (Low Pass Filter) and
commercial environments to support both wireless communi- • Optionally Traslation of frequency (down conversion)
cations research and real-world radio systems.”. The proposal with image frequency rejection.
978-1-5386-4889-6/18/$31.00 2018
c IEEE
Fig. 2. Signal capturing

Fig. 3. File Source Block


The analogical digital converter (ADC) converts radio sig-
nals (analogical) to digital samples representing them. ADC’s
are characterized by the number of bits representing the signals • Ettus Research USRPTM , B200 [4]
(typically from 8 to 24) and the rate of operation or conversion • Great Scott Gadgets, HackRF One [5]

frequency (typically from some thousands to many millions • Zephyr Engineering Inc, UDPSDR-HF1 [6]

of samples per second). This determines the signal bandwidth The hardware requires at least the following parameters to
that may be processed digitally. operate:
The digital process is divided into two parts: • Central frequency (ωc = 2.π. fc )
• High Speed Processing (FPGA) • Bandwidth (BT )
• GNU Radio Processing (PC) In GNU Radio Companion (GRC) [7] the hardware is
If the sample rate is high, the processing capacity of a per- represented by a “UHD USRP Source” source block (it may
sonal computer may be insufficient. Then, an FPGA extracts be another similar block depending on the SDR adopted). This
an even more reduced portion of the digitalized spectrum and block is connected to a “File Sink” block with the aim to store
thus reduces the sample rate to be processed in a PC. complex samples in one file.
Following this, the samples are treated in the demodulation It is important to remember at which rate the file’s samples
process using blocks for the treatment of signals developed were stored since it is a fundamental parameter for the
using GNU Radio on a PC and, finally, the demodulated environment of simulations of hands-on experiences of ana-
message is reproduced through a sound card or is visualized logical or digital passband signal demodulation. The file name
on the screen. may contain this information, for example “capture-100MHz-
20MSps”, where the central frequency and the sample rates
III. M EANING OF COMPLEX ENVELOPE were stored. The type of stored modulation may also be added.
A modulated signal available on the antenna, s(t) (bandpass The size of the file will depend on the sample rate and the
signal with BT bandwidth) is mathematically represented [3] duration of the capture.
as follows: A real source block of data (hardware including an ADC
receiving in real time) differs from a source file block with
s(t) = x(t) cos(ωc t) − y(t) sin(ωc t) (1) data (which once were a real signal) in the temporization.
In the former, data enter to the rate determined by the ADC
The expression: and associated hardware; while in the source file block, the
limitation is the ability to process data from the PC. For the
g(t) = x(t) + j y(t) (2) simulation with source file block to respect the original rate
of the captured signal, a Throttle block must be added as
is called the complex envelope of s(t) and it is the modulated
indicated in figure 3. Otherwise, GRC would take samples
signal’s spectrum translated to baseband.
from the file, processing them one after the other and thus
The complex envelope is the input information for GNU
consume all the PC’s processing ability. The Throttle block
Radio, it is a data stream representing complex samples of g(t)
administers the required pause between the samples to be
to be demodulated. This data stream can be stored in a file, as
processed.
indicated in figure 2 and then the examples can be developed
using the file without the need for additional hardware to the IV. F ILTERING AND C ONVOLUTION
PC, figure 3. The signal coming from the hardware to implement an
There are several hardware options to implement an SDR SDR receiver, or from a “File Source” block (figure 3),
receiver. Some of the characteristics to choose from are: can have such a sample rate as to allow for more than
• Number of ADC bits, which determines the receiver’s one communication service. For example, if it is a spectrum
sensitivity. taken in FM Broadcasting band where each service requires
• Sample rate per second (Sps), which determines the approximately 200 KHz and the complex sample rate were
available bandwidth. of 2 MSps without oversampling, then there could be more
• Operation frequency (Minimum and Maximum). than one available service to demodulate since the captured
• Available software. bandwidth is 2 MHz. In these cases, it is necessary to reduce
• Cost. the bandwidth before demodulating and, to that aim, GRC get
Some examples of tested hardware are: available filter blocks.
Fig. 4. Convolution and Filtering
Fig. 5. Envelope detector blocks

In addition, it is likely that the complex envelope under test


will not have a modulated signal of interest in the baseband,
so it is necessary to perform a spectral translation process
to take it to baseband. To this aim, a “Multiply” block and a
“Signal Source” block are used. An example of both processes,
Filtering and Convolution, is shown in figure 4.
The Signal Source block determines the spectral translation
with the frequency parameter, which can take positive or
negative values, depending on the direction of the translation.
The “Frequency Xlating FIR Filter” block integrates the
features of the “Multiply”, “Signal Source” and “Filter” blocks
in a single block.
Once the desired signal has been selected and the appropri-
ate bandwidth has been chosen, the modulation process may
begin.

V. D EMODULATION
Fig. 6. Color Mapping
Demodulation is the process that retrieves the message sent
from the complex envelope with the appropriate bandwidth.
The characteristics of the process will depend on the modula- B. AM and DSB-SC demodulation with synchronous detector
tion used. Another way to retrieve the AM modulated message is by
If the message is audible, then the message data may go means of a synchronic or product detector. Mathematically,
to the PC’s speaker throughout “Audio Sink” sink block. This the output satisfies the following:
block works with a sample rate corresponding to the audible
spectrum (8, 16, 22.05, 24, 32, 44.1, 48 KSps), well below r(t) = x(t) (4)
the rates obtained from hardware or work files.
The reduction of the sample rate is achieved through the Where x(t) is the real part of the complex envelope, g(t) ,
decimation process that is available in blocks such as: Filters, of the signal of interest. The “Complex to Real” block strictly
AM Demod, FM Demod, and Rational Resamplers. satisfies equation 4, figure 7.

A. AM modulation with envelope detector


The simplest way to demodulate an AM signal is through
an envelope detector. In this case, instead of using a diode
and a capacitor, the complex samples are processed so that Fig. 7. Product detector block
the demodulator output satisfies the following:
In the same way, modulated signals can be demodulated in
double sideband suppressed carrier (DSB-SC).
r(t) = |g(t) | (3)

The “Complex to Mag” block strictly satisfies equation 3. C. Single side band demodulation
Another alternative is the “AM Demod”, which also enables The demodulation of modulated signals in single sideband
output filtration and decimation. (lower or upper) is achieved through: the Hilbert Transform,
Note the colour difference between input port, Complex Weaver’s Method or the Filter Method. The latter is the easiest
of 32 bits on the right side (complex enveloping signal) and to implement.
floating point output of 32 bits on the left side, at figure 5. The filter method consists in filtering the complex envelope,
GRC handles different types of data and figure 6 shows those only allowing the desired sideband to pass. In the case of the
available. This information is available in the help menu of lower sideband (LSB), only the negative spectral components
the software. of the complex envelope are allowed; and in the case of the
upper sideband (USB), the positive spectral components. The VI. V ISUALIZATION BLOCKS
“Frequency Xlating FIR Filter” can be useful for this. GNU Radio uses the wxWidgets (WX) multi-platform li-
After filtration, the signal is treated as a DSB-SC signal and braries and the Qt object-oriented multi-platform framework
is retrieved with a product detector, figure 7. for the user graphic interface (QT). The graphic resources
available will depend on the Operating System of the PC.
D. FM Broadcasting demodulation The time representation of the (modulated or modulating)
signals is obtained through the “WX GUI Scope Sink” block
GRC has a block to demodulate FM Broadcasting signals, or its representation in the spectrum with the “WX GUI FFT
the “FM Demod” block, which can perform de-emphasis, Sink” block (Figure 9). These are especially useful if the
decimation and filtration. message is a periodic signal.
The demodulation of this kind of signals using GRC makes
it possible to visualize the characteristics of the stereo FM
emission (MPX). Figure 8 shows the demodulated spectrum,
where is appreciated the left channel plus right channel signal
(x L(t ) + xR(t ) ) at baseband, a pilot tone of stereo FM on 19 KHz
and the left channel less right channel signal (x L(t ) −xR(t ) ) DSB-
SC modulated on 38 KHz. In addition, is possible appreciate
the digital signal of Radio Data System (RDS) on 57 KHz.

Fig. 9. 1 KHz tone AM modulated FFT Plot

The time and spectrum representation of the signals is also


available for Qt and is done through the “QT GUI Time Sink”
and “QT GUI Frequency Sink” blocks, respectively.
In addition, the evolution in time of the signal spectrum
can be observed with the “WX GUI Waterfall Sink” block in
wxWidgets and with the “QT GUI Waterfall Sink” block in
Qt. This way of visualizing the signal is appealing because
of the colors used. Figure 10 shows 16 seconds of time of a
Fig. 8. FM Broadcasting demodulated FFT Plot spectrum of 48 KHz in amateur band of 7 MHz.

E. OOK demodulation
The On-Off Keying binary digital signals receive the same
treatment as the analog signals modulated in amplitude, AM.
Therefore, the same resources used for AM are used to
demodulate OOK signals, i.e. envelope detector (figure 5) for
simplicity.
Should the complex envelope of the signal to be processed
be centered with the frequency carrying the OOK signal, a
product detector may also be used.
Then a “Threshold” block defines which symbol is received
[8].

F. BPSK demodulation
Fig. 10. WX GUI Waterfall
Binary Phase Shift Keying (BPSK) binary digital signals
receive the same treatment as the analog signals modulated The signal histogram can be analyzed through the “WX GUI
in double sideband suppressed carrier, DSB-SC. Therefore, a Histo Sink” or the “QT GUI Histogram Sink” blocks. This is
product detector is used to demodulate BPSK signals (figure useful to explain the benefits of companding in the reduction
7). Then, a “threshold block” defines which symbol is received of the quantification noise. Figure 11 shows the histogram of
[9]. a music fragment and it is compared with the theory [10].
EIUTNBA0003921). Files with captures of the signals used
for the simulations are available from the web server of the
Electronics Engineering Department [11].
Labs using GRC can be combined with other labs using real
equipment, such as: signal generators, oscilloscopes, spectrum
analyzers, transmitters, receivers. This contributes to a better
understanding of the concept of complex envelope of a mod-
ulated signal.
If a question or doubt arises during theoretical lessons, GRC
simulations can be used as a tool to develop or complement
the explanation.
If hardware for SDR is available, students might generate
their own emission capture files and then simulate the same
practices or variants of it at home.
Even an academic institution lacking the equipment can
perform simulations with files provided by another institution.
In this way, Communication System introductory courses will
not be fully theoretical and they will foster students’ interest
in the subject.
GRC is a free & open-source software. Since it is free of
charge, it can be implemented without requiring the submis-
sion of a budget to purchase software licenses for laboratories.
Licensed software programs offering similar features require
purchase paperwork which usually take time to deal with.
Fig. 11. WX GUI Histogram Generally, user licenses do not allow students to install the
software at home. GNU Radio avoids ethical or moral con-
flicts, especially for those in charge of software in laboratories.
For QAM digital signals (including BPSK, QPSK, MPSK), The student can investigate how each GNU Radio block was
the “QT GUI Constellation Sink” block shows the constella- programmed. In order to understand how a block works, it is
tions (figure 12). first necessary to know what that block does and what purpose
it has, and this means learning about Communication Systems.
This investigation links the course with the contents of other
courses, such as programming or signal digital processing.
There are sites which promote this research [12] [13].
For this reason, we recommend the use of GNU Radio in
Communication Systems courses.

ACKNOWLEDGMENT
The authors are grateful for the collaboration given by
students, teaching assistants, professors and researches, who in
one way or another contributed to this work, especially María
Victoria García, Eng. Matías Barneto and Luciano Arroyo.
We would also like to thank the Department of Electronics
Engineering and the Science, Technology and Productive Inno-
vation Office, both part of Universidad Tecnológica Nacional,
Fig. 12. QPSK Constellation example Facultad Regional Buenos Aires.

R EFERENCES
VII. C ONCLUSIONS
[1] Free Software Foundation, The GNU Operating System and the Free
The students of the Communication Systems courses in Software Movement. Accessed on Oct. 19, 2017. [Online]. Available:
the Electronics Engineering undergraduate program at UTN- https://www.gnu.org/home.en.html
[2] GNU Radio, What is GNU Radio. Accessed on Oct. 19, 2017. [Online].
FRBA found the simulations performed interesting. These Available: https://wiki.gnuradio.org/index.php/What_is_GNU_Radio%3F
simulations and others are part of the results of the research [3] Leon W. Couch, Sistemas de Comunicaciones digitales y analógicos,
and development project entitled “Development of Commu- 7ma ed., PEARSON Education, 2008, pp. 230-246.
[4] Ettus Research, Ettus Research USRPTM , B200. Accessed on Oct. 19,
nication Systems based on Software-Defined Radio (SDR) 2017. [Online]. Available: https://www.ettus.com/product/details/UB200-
and their Application to Education” approved by UTN (ID KIT
[5] Great Scott Gadgets, Great Scott Gadgets - HackRF One. Accessed on TATA McGRAW-HILL, 2010, pp. 548-554.
Oct. 19, 2017. [Online]. Available: https://greatscottgadgets.com/hackrf/ [11] UTN-FRBA Electronic Department, SDR - Capture files. Accessed on
[6] Zephyr Engineering Inc, UDPSDR-HF1. Accessed on Oct. 19, 2017. [On- Oct. 19, 2017. [Online]. Available:
line]. Available: http://www.zpci.com/products/sdr/sdrstick/udpsdr-hf1/ http://www2.electron.frba.utn.edu.ar/ mdoallo/sc/descargas/sdr/
[7] GNU Radio, InstallingGR. Accessed on Oct. 19, 2017. [Online]. Avail-
able: https://wiki.gnuradio.org/index.php/InstallingGR [12] GNU Radio, Guided Tutorial GNU Radio in Python. Accessed on Oct.
[8] A. Bruce Carlson and Paul B. Crilly, Communication Systems, 5th ed., 19, 2017. [Online]. Available: https://wiki.gnuradio.org/index.php/
TATA McGRAW-HILL, 2010, pp. 673-677. Guided_Tutorial_GNU_Radio_in_Python
[9] A. Bruce Carlson and Paul B. Crilly, Communication Systems, 5th ed., [13] GNU Radio, Guided Tutorial GNU Radio in C++. Accessed on Oct.
TATA McGRAW-HILL, 2010, pp. 668-670. 19, 2017. [Online]. Available: https://wiki.gnuradio.org/index.php/
[10] A. Bruce Carlson and Paul B. Crilly, Communication Systems, 5th ed., Guided_Tutorial_GNU_Radio_in_C%2B%2B

You might also like