Documentation

RTL-SDR Receiver

Receive data from RTL-SDR device

  • Library:
  • Communications System Toolbox Support Package for RTL-SDR Radio

Description

The RTL-SDR Receiver block is a signal source that receives data from an RTL-SDR device and outputs a column vector signal of fixed length specified by the samples per frame parameter.

This RTL-SDR Receiver block icon shows all optional ports.

This block diagram shows the interaction between Simulink®, the RTL-SDR Receiver block, and the RTL-SDR device.

When the host computer is not connected to the radio hardware, you can still use the block to develop a model that propagates sample time and data type information. To propagate this information, you must update your model.

Ports

Input

expand all

Center frequency setting in Hz, specified as a positive scalar.

Example: 88.9e6 tunes the receiver to a center frequency of 88.9 MHz.

Data Types: double

Receiver gain setting in dB, specified as a scalar.

Example: -10.5 sets the receiver gain level to –10.5 dB.

Data Types: double

Output

expand all

Received data, returned as one of these values.

  • 16-bit signed integers — The complex values are the raw 16-bit I and Q samples from the RTL-SDR device.

  • Single-precision floating point — The complex values are scaled to the range of [–1, 1].

  • Double-precision floating point — The complex values are scaled to the range of [–1, 1].

Dependencies

To specify the base type, use the Output data type parameter.

Data Types: int16 | single | double
Complex Number Support: Yes

Number of lost samples, returned as a nonnegative integer. lost is 0 if samples were lost.

Dependencies

This port appears when Lost samples output port is selected.

Latency of the received data in frames, returned as a nonnegative integer. late1 if the received frames of data have no latency.

Dependencies

This port appears when Latency output port is selected.

Parameters

expand all

Radio Connection

USB address of the radio you want to communicate with, specified as a nonnegative integer. Use the Info button to update block parameters in model associated with the specified Radio address.

USB Port Address Assignment

The assignment of USB port addresses is not intuitive. If a device is plugged into the first USB port, it is always at address 0. However, if a device is plugged into any port after the first one, the address varies depending on whether a device is plugged into any of the previous ports.

This diagram shows how the USB port addresses are assigned when devices are added and then removed in first in, first out (FIFO) order.

The following diagram shows 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 the first port has a device in it. To access a radio with the correct radio address, you must keep track of the plugged-in devices in order.

Update block parameters in the model associated with the specified Radio address. Clicking Info opens the RTL-SDR Radio Information window, which displays information and parameter settings associated with the specified Radio address. Use the Info button to check connectivity between the block and the radio hardware, and to synchronize radio settings between them. If the block is not connected to the radio device, the window displays the text RadioName:'Cannot find radio' and RadioIsOpen: false.

Radio Configuration

When you select Dialog, the Center frequency (Hz) parameter setting is used for the center frequency. When you select Input port, the fc port is used to set the center frequency.

Center frequency setting in Hz, specified as a positive scalar. For a list of tuner chips and their frequency ranges, see [1].

Dependencies

This parameter appears when you set the Source of center frequency parameter to Dialog.

When you select Dialog, the Tuner gain (dB) parameter setting is used for the center frequency. When you select Input port, the gain port is used to set the center frequency. When you select AGC, the RTL-SDR device uses an internal automatic gain control algorithm to optimize the receiver gain setting.

Gain setting of tuner in dB, specified as a scalar.

Dependencies

This parameter appears when you set the Source of gain parameter to Dialog.

Desired ADC sample rate in Hz, specified as a positive scalar. The allowed range is 225-300 kHz and 900-3200 kHz. A SampleRate setting above 2560 kHz may result in lost samples. For more information about maximum reliable sample rate, see [1].

Frequency correction in ppm, specified as a scalar.

Data transfer Configuration

Select this parameter to show the lost output port.

Select this parameter to show the late output port.

Data type of output, specified as int16, single, or double. When you select the single or double data type, the complex values are scaled to the range of [–1,1]. When you select int16, the complex values are the raw 16-bit I and Q samples from the device.

Number of samples per frame output by the block, specified as a positive integer.

Select this parameter to buffer a set of contiguous frames so that your processing loop is not overrun.

Use this setting to simulate systems that cannot run in real time. When you select this parameter, specify the amount of contiguous data using the Number of frames in burst parameter.

Number of contiguous frames in a burst, specified as a positve scalar.

Dependencies

This parameter appears when you select Enable burst mode.

References

See Also

System Objects

Introduced in R2014a

Was this topic helpful?