Documentation

comm.SDRRTLReceiver System object

Package: comm

Receive data from RTL-SDR radio

Description

The SDRRTLReceiver System object™ supports communication between MATLAB® and an RTL-SDR radio, by way of an RTL-SDR device attached to a USB port on the host computer, allowing simulation and development of various software-defined radio (SDR) applications. Although comm.SDRRTLReceiver receives data from an RTL-SDR radio, the object acts as a signal source that outputs a column vector signal of fixed length.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Supported Data Types

PortSupported Data Types

Output

The output port supports these complex data types only:

  • Double-precision floating point

  • Single-precision floating point

  • 16-bit unsigned integers

Construction

H = comm.SDRRTLReceiver creates an RTL-SDR radio receiver System object, H, that receives data from the RTL-SDR radio.

H = comm.SDRRTLReceiver(Name,Value) creates an RTL-SDR radio receiver object, H, with the specified property Name set to the specified Value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

H = comm.SDRRTLReceiver(RadioAddress,Name,Value) creates an RTL-SDR radio receiver System object, H, where RadioAddress is a character vector containing a non-negative, scalar integer that refers to the USB ID of the RTL-SDR radio, and the other specified properties set to the specified values.

Properties

RadioAddress

USB address of the RTL-SDR device

Specify the USB address of the radio you want to communicate with as a character vector. The default value is '0'. Use the sdrinfo function to discover which radios are connected to your computer.

    About USB port addresses   USB address are not assigned in a manner that it is intuitive. If a device is plugged into the first USB port, it is always at address 0. But if there is a device plugged into a second or third port, the address varies depending on whether there is a device in any of the previous ports. See the following illustrations for a visual explanation.

    This diagram illustrates how the USB port addresses are assigned when devices are added and then removed in FIFO order.

    This diagram illustrates how the USB port addresses are assigned when devices are added and then removed from port 0. Note that the radio address for the second RTL device changes based on whether or not the first port has a device in it. You must keep track of the plugged-in devices in order to access a radio with the correct radio address.

CenterFrequency

Desired center frequency in Hz

Specify the desired center frequency as a double precision, nonnegative scalar. The default value is 102.5 MHz. The valid range of this property depends on the tuner chip of the RTL-SDR radio. You can get a list of tuner chips and their frequency ranges at http://sdr.osmocom.org/trac/wiki/rtl-sdr#SupportedHardware and http://sdr.osmocom.org/trac/wiki/rtl-sdr#Specifications.

EnableTunerAGC

Turn the tuner automatic gain control (AGC) on (true) or off (false).

When set to true, this property will enable the tuner AGC to provide almost constant amplitude signals. The default value is true.

TunerGain

Desired tuner gain in dB

Specify the desired tuner gain as a double precision scalar. The default is 0 dB. The valid range of this property depends on the tuner chip of the RTL-SDR radio. Use the info method to get valid values. This property applies and appears only when EnableTunerAGC is set to false. This property is tunable.

SampleRate

Desired ADC sample rate in Hz

Specify the desired sample rate of the output samples of the step method, in Hertz, as a double-precision, positive, scalar value. The allowed range is 225-300 kHz and 900-3200 kHz. Above 2800 kHz, you might lose samples. The default is 250 kHz.

OutputDataType

Data type of output

Specify the output data type as one of double, single, or int16. When you select double or single data type, the complex values are scaled to the range of [-1,1]. When selecting int16, the complex values are the raw 16-bit I and Q samples from the board. The default value is int16.

SamplesPerFrame

Number of samples in a frame

Specify the number of samples in a frame for the step method to output. This value must be a positive, scalar integer. The default value is 1024.

FrequencyCorrection

Frequency correction value in ppm

Specify the frequency correction value in ppm as an integer. The valid range is [-1e4 1e4] ppm. The default value is 0. This property value is used to correct for frequency shifts that occur as a result of local oscillator offsets or clock rate inaccuracies.

EnableBurstMode

Turn burst mode on or off

Set this property to true to buffer a set of contiguous frames so that your processing loop is not overrun. Use this setting to simulate models that cannot run in real time. When this property is set to true, specify the amount of contiguous data using the NumFramesInBurst property. The default value is false.

NumFramesInBurst

Number of frames in contiguous burst

This property is valid when EnableBurstMode is set to true. This value must be a positive scalar integer. The default number of frames in a burst is 10.

Methods

info Returns RTL-SDR radio settings
resetReset the internal states of the RTL-SDR radio System object
stepReceive data from RTL-SDR radio
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

See either of the following featured examples for some basic radio functionality with the RTL-SDR Radio support package:

For more examples featuring the RTL-SDR radio receiver System object, enter sdrexamples at the MATLAB command prompt.

See Also

Topics

  • Radio Management (Communications System Toolbox Support Package for RTL-SDR Radio)
Was this topic helpful?