Sunteți pe pagina 1din 2

Software-Defined Radio in MATLAB Simulink with

RTL-SDR Hardware
Alexander B. Sergienko
Saint Petersburg Electrotechnical University LETI,
Saint-Petersburg, Russia, 197376, 5 Prof. Popov street, E-mail: sandy@ieee.org

AbstractUSB TV receivers based on Realtek RTL2832U


demodulator can serve as a cheap software-defined radio platform (RTL-SDR) with broad frequency range. Starting with
Release 2013b, MATLAB/Simulink contains support package
that provides interface to these devices. The paper describes
RTL-SDR capabilities and possible applications implemented in
MATLAB/Simulink.

Devices based on the Realtek RTL2832U demodulator chip


appeared at the market in 2010. This chip is designed to
be used primarily as a digital television receiver (DVB-T
standard), but it also supports software-defined radio (SDR)
mode (in this mode, the software supplied with the device can
demodulate analog FM radio and digital broadcasting standard
DAB). Official documentation of the chip is not publicly
available, so for a certain period of time its SDR capabilities
remained unnoticed. However, by 2012 this information was
widely spread through the Internet, and USB receivers based
of this demodulator become widely used by radio amateurs
as a simple and cheap SDR platform [1] commonly called
RTL-SDR.
Retail price of RTL-SDR devices currently starts from
approximately $7, it depends primarily on the tuner chip. Main
characteristics of the receiver are as follows: analog-to digital
converter resolution8 bits, maximum sampling frequency
3.2 MHz. Frequency range is defined by the tuner chip used in
the particular device. The widest frequency range is provided
by the tuner Elonics E4000 [2]: 52 to 2200 MHz, except for
the gap from about 1100 to 1250 MHz. Currently, the most
common tuner is Rafael Micro R820T [3], its frequency range
spans from 24 to 1766 MHz.
As RTL-SDR receivers are consumer devices, such their
parameters as sensitivity, dynamic range, frequency stability,
phase noise, etc., compared with professional SDR equipment
leave much to be desiredthe main advantages are extremely
low price, small size and wide frequency range.
Starting with Release 2013b, MATLAB/Simulink contains
support package that provides interface to RTL-SDR devices
[4].
For Simulink, the package contains a single block RTLSDR receiver that performs communication with the device.
The block allows to tune the following parameters:
Center frequencythrough the block property or via an
input port.
Tuner gainthrough the block property or via an input
port. It is also possible to engage automatic gain control
function of the chip.
978-1-4799-5317-2/14/$31.00 2014 IEEE

Sampling rateas this property can not be modified onthe-fly, it can be set only through the block property.
Frequency correction factor (it allows to compensate
for local oscillator frequency error).
The block can output complex envelope (in-phase and quadrature components) of the received signal in both floatingpoint (double, single) and integer (int16) formats. The output
samples are grouped together in the frames with frame size
being an integer multiple of 256 (parameter Samples per
frame).
To monitor data transfer, two auxiliary outputs can be set
up. The Lost samples output port outputs the number of lost
samples during host-hardware data transfers. It is a useful
diagnostic tool for determining real time operation of the
block. The Latency output port indicates latency (in number
of frames) during data transfers.

Figure 1. Simulink model showing multipath correlation function of DVB-T2


signal

To use the device from MATLAB scripts, the package


provides wrapper for Simulink block in the form of System
Object (class comm.SDRRTLReceiver). The properties of
this class closely mimic the set of parameters for Simulink
block.
To illustrate the use of RTL-SDR devices in Simulink
and MATLAB, the support package provides five examples:
Spectral Analysis (RTL-SDR is used as a signal source for
Spectrum Analyzer block), Frequency Offset Calibration
(calculation of Frequency correction factor parameter using
external reference narrow-band signal), FM Monophonic and
Stereo Receivers (for analog FM), and FRS/GMRS Receiver
(FRS and GMRS are walkie-talkie systems used in the USA).

Every example is implemented in two forms: as a Simulink


model and as a MATLAB script.
Since this device is a receiver only, for experiments it
should be used with signals that are permanently or almost
permanently present in the air, or with signals emitted by
various consumer devices that can be easily activated at
any time. The review of signals that can be processed for
educational purposes (lecture demonstrations, laboratory tests,
course projects, etc.) is presented in [5].
As an example, in Fig. 1 a simple Simulink model is
shown that calculates and displays the correlation function of
digital TV signal (DVB-T2, Saint Petersburg, 45th channel,
666 MHz). The shape of the correlation function clearly shows
multipath structure of this radio channel.
The author would like to acknowledge the financial support

of this work by the Ministry of the Education and Science of


the Russian Federation (basic state assignment No. 2014/187,
project code 1031).
R EFERENCES
[1] S. Cass. A $40 Software-Defined Radio. IEEE Spectrum, Vol. 50, No. 7,
July 2013, pp. 2223.
[2] Multi-Standard CMOS Terrestrial RF Tuner E4000 Datasheet. Elonics
Ltd., 2010.
[3] R820T High Performance Low Power Advanced Digital TV Silicon
Tuner. Datasheet. Rafael Microelectronics, Inc., 2011.
[4] Communications System Toolbox Support Package for RTL-SDR Radio.
User Guide. MathWorks, 2013.
[5] A. B. Sergienko. Possible Uses of USB Receivers Based on RTL2832U
Demodulator for University Courses. Proc. 16th Int. Conf. on Digital
Signal Processing and its Applications (DSPA-2014), Moscow, March
2628, 2014, pp. 126130.in Russian.

S-ar putea să vă placă și