comm.SDRTxPluto

Transmit data to Analog Devices ADALM-PLUTO radio

Description

The comm.SDRTxPluto System object™ is a signal source that transmits data to an Analog Devices® ADALM-PLUTO radio. This connection enables you to simulate and develop various software-defined radio applications.

The following diagram shows the interaction between MATLAB®, the comm.SDRTxPluto System object, and the radio hardware.

After connecting a PlutoSDR device to a USB port on the host computer, to transmit data to the radio hardware:

  1. Create the comm.SDRTxPluto object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects? (MATLAB).

Channel Input

The ADALM-PLUTO radio has a single channel for sending data from the comm.SDRTxPluto System object. The SDR System object accepts a column vector signal of fixed length.

When the comm.SDRTxPluto System object is called during simulation, it is possible that the host did not send valid data to the radio hardware. To determine when valid data is present, use the underflow output argument.

Creation

Description

txPluto = sdrtx('Pluto') creates a PlutoSDR transmitter System object with default properties that you can use to receive data from the PlutoSDR device.

example

txPluto = sdrtx('Pluto',Name,Value) creates a PlutoSDR transmitter object 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). Unspecified properties take default values.

Example: tx = sdrtx('Pluto','CenterFrequency',3.5e9,'BasebandSampleRate',2.0e6);

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects (MATLAB).

Main Properties

Radio identification number, specified as one of the following character vectors:

  • (recommended) A device-independent index, with the prefix usb:, such as 'usb:0', 'usb:1', 'usb:2', …, indicating the first, second, third, ..., attached ADALM-PLUTO radio, respectively

  • An IP address, with the prefix ip:, such as 'ip:192.168.2.1'

  • A serial number, represented by a hexadecimal string with the prefix sn:, such as'sn:100000235523730700230031090216eaeb'

Note

When working with multiple radios, if devices are inserted or removed, the host computer assignment of USB addresses might change. Any time an SDR device is inserted or removed from a USB port, the host computer polls all USB ports and assigns or reassigns the radio addresses associated with connected devices.

When operating on Windows® keep these considerations in mind.

  • When running multiple radios on the same host in separate MATLAB sessions, for each MATLAB session the first radio is assigned usb:0, and the ID number increments by one for subsequent radios.

  • Radios that are being used by one MATLAB are not seen by other MATLAB sessions. Use findPlutoRadio and check the reported serial number to identify the radios seen in a particular MATLAB session.

To ensure that all assigned radio identities remain static, do not connect or disconnect radios after SDR objects have been created. The best practice is to connect radios and create SDR objects in this order:

  1. Clear all SDR objects.

  2. Connect all radios.

  3. Check to confirm that the connected radios are recognized by running this command:

    findPlutoRadio

  4. Create SDR objects.

To interface with the radio hardware, the RadioID property of the radio object must match the radio ID of the radio hardware. Update the RadioID property, if necessary.

When running multiple radios on the same host, the host assigns each radio a different radio ID. When identifying the radio by USB ID, the first radio is assigned usb:0, and the ID number increments by one for subsequent radios. For example, to assign IDs to two radios connected on the same host computer, at the MATLAB command prompt, enter:

rx = sdrrx('Pluto','RadioID','usb:0'); 
tx = sdrtx('Pluto','RadioID','usb:1');

RF center frequency setting in Hz, specified as a scalar from 70.0e6 to 6.0e9.

Note

Analog Devices qualifies the PLUTO radio over a tuning range of 325 MHz to 3.8 GHz. This support package enables you to use the PLUTO radio outside the qualified tuning range by configuring the radio to operate using the AD9364 firmware. To extend the frequency range, at the MATLAB command prompt, enter configurePlutoRadio('AD9364').

Tunable: Yes

Data Types: double

Gain, specified as a scalar from -89.75 to 0 dB with a resolution of 0.25 dB.

Tunable: Yes

Data Types: double

This property is read-only.

The channel mapping is always set to 1.

Baseband sampling rate in Hz, specified as a scalar from 65105 to 61.44e6 samples per second.

Note

The actual computed value and your specified setting can have a small mismatch. To confirm that the actual computed value is close enough to your specified setting, call the info object function on the radio object.

Data Types: double

Advance Properties

Option to show advanced properties, specified as true or false.

Use custom filter, specified as one of these values.

  • false — The filter chain uses the default filter design.

  • true — The filter chain uses a custom filter design. To design a custom filter, call the designCustomFilter function.

Note

When applying a custom filter to a comm.SDRTxPluto System object, the UseCustomFilter property is automatically set to true. To switch between the default and your custom filter, set UseCustomFilter property to false or true, respectively.

For more information, see Baseband Sampling Rate and Filter Chains.

Data Types: logical

Frequency correction value in ppm, specified as a scalar from -200 to 200. This property value corrects frequency shifts in data due to local oscillator frequency offset or clock rate inaccuracy.

Note

  • When the FrequencyCorrection setting is 0, the factory-calibrated setting of the radio will be used.

  • The FrequencyCorrection property changes the actual radio setting for BasebandSampleRate and CenterFrequency.

Tunable: Yes

Dependencies

To view this property, set ShowAdvancedProperties to true.

Data Types: double

Select data source, specified as 'Input Port' or 'DDS'.

When you select direct digital synthesis ('DDS') as the source of data, the object enables two additive tones for each channel. To set the tone frequency and tone scale of these tones, use the DDSTone1Freq, DDSTone2Freq, DDSTone1Scale, and DDSTone2Scale properties. The DDS signals are generated on the FPGA.

Dependencies

To enable this property, set ShowAdvancedProperties to true.

Data Types: char | string

First DDS tone frequency in Hz, specified as one of these options:

  • Numeric scalar — Use this option for a single channel or to specify the same frequency for two channels. The object applies scalar expansion for each channel specified by the ChannelMapping property.

  • 1-by-2 numeric vector — Use this option to specify different frequencies for two channels. The Nth element of the vector is applied to the Nth channel specified by the ChannelMapping property.

The valid range of DDSTone1Freq is from 0 to BasebandSampleRate divided by 2.

Dependencies

To enable this property, set DataSourceSelect to 'DDS'.

Data Types: double

Second DDS tone frequency in Hz, specified as one of these options:

  • Numeric scalar — Use this option for a single channel or to specify the same frequency for two channels. The object applies scalar expansion for each channel specified by the ChannelMapping property.

  • 1-by-2 numeric vector — Use this option to specify different frequencies for two channels. The Nth element of the vector is applied to the Nth channel specified by the ChannelMapping property.

The valid range of DDSTone2Freq is 0 Hz to BasebandSampleRate divided by 2.

Dependencies

To enable this property, set DataSourceSelect to 'DDS'.

Data Types: double

First DDS tone scale in millionths of full scale, specified as one of these options:

  • Numeric scalar — Use this option for a single channel or to specify the same scale for two channels. The object applies scalar expansion for each channel specified by the ChannelMapping property.

  • 1-by-2 numeric vector — Use this option to specify different scales for two channels. The Nth element of the vector is applied to the Nth channel specified by the ChannelMapping property.

The valid range of DDSTone1Scale is from 0 to 1.

Dependencies

To enable this property, set DataSourceSelect to 'DDS'.

Data Types: double

Second DDS tone scale in millionths of full scale, specified as one of these options:

  • Numeric scalar — Use this option for a single channel or to specify the same scale for two channels. The object applies scalar expansion for each channel specified by the ChannelMapping property.

  • 1-by-2 numeric vector — Use this option to specify different scales for two channels. The Nth element of the vector is applied to the Nth channel specified by the ChannelMapping property.

The valid range of DDSTone2Scale is from 0 to 1.

Dependencies

To enable this property, set DataSourceSelect to 'DDS'.

Data Types: double

Built-in self-test loopback mode, specified as one of these options:

  • 'Disabled' — Disable BIST loopback.

  • 'Digital Tx -> Digital Rx' — Enable digital signals to loop back within the AD936x device. The signals bypass the RF stage.

  • 'RF Rx -> RF Tx' — Enable incoming receiver RF signals to loop back to the RF transmitter port. The signals bypass the FPGA.

Dependencies

To enable this property, set ShowAdvancedProperties to true.

Data Types: char | string

BIST signal injection mode, specified as one of these options:

  • 'Disabled' — Disable BIST signal injection.

  • 'Tone Inject Tx' — Enable BIST signal injection to transmit path.

  • 'Tone Inject Rx' — Enable BIST signal injection to receive path.

When you enable BIST signal injection, you can set the source of BIST signal generation with the BISTSignalGen property.

Dependencies

To enable this property, set ShowAdvancedProperties to true.

Data Types: char | string

Source of BIST signal generation, specified as one of these options:

  • 'PRBS' — Use the pseudo random binary sequence (PRBS) generator of the board.

  • 'Tone' — Use the tone generator of the board. To set the tone frequency and tone level, use the BISTToneFreq and BISTToneLevel properties, respectively.

Dependencies

To enable this property, set BISTToneInject to 'Tone Inject Tx' or 'Tone Inject Rx'.

Data Types: char | string

BIST tone frequency, specified as 'Fs/32', 'Fs/16', 'Fs*3/32', or 'Fs/8'.

Dependencies

To enable this property, set BISTSignalGen to 'Tone'.

Data Types: char | string

BIST tone level in dB, specified as '0', '-6', '-12', or '-18' .

Dependencies

To enable this property, set BISTSignalGen to 'Tone'.

Data Types: char | string

Usage

Description

txPluto(data) transmits signal data from an PlutoSDR device, as represented by a comm.SDRTxPluto System object.

example

underflow = txPluto(data) assigns the lost sample indicator output to underflow.

Input Arguments

expand all

Transmission data, specified as a column vector with an even number of elements from 2 to 16,777,216. The transmission data must be complex. This is enforced due to potential for corruption of the input signal by the radio hardware IQ imbalance correction when input transmission signal is real-valued. For more information, see Quadrature Tracking.

These data types are valid for transmitted data:

  • double — Double-precision floating point with values scaled to the range of [–1,1].

  • single — Single-precision floating point with values scaled to the range of [–1,1].

  • int16 — 16-bit signed integers. The range of values is [-32768,32767], but the data transmitted by the ADALM-PLUTO radio loses the four LSBs of precision.

Note

The AD936X RF chip has a 12-bit DAC. Only the 12 most significant bits of the transmitted data are used. Values of magnitude less than 0.0625 are lost.

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

Output Arguments

expand all

Lost samples indicator, returned as a logical.

  • A 0 indicates that no samples were lost.

  • A 1 indicates that samples were lost.

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

infoObtain radio information
designCustomFilterDesign custom filter for Analog Devices AD936x RF chip
transmitRepeatDownload waveform to radio and repeatedly transmit it over the air
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

Create Transmitter System Object

Configure an ADALM-PLUTO radio with a RadioID set to usb:0. Transmit at 2.4 GHz with a baseband rate of 1 MHz. Use a DPSK modulator as the data source.

txPluto = sdrtx('Pluto','RadioID','usb:0','CenterFrequency',2.4e9, ...
               'BasebandSampleRate',1e6,'ChannelMapping',1);
modObj = comm.DPSKModulator('BitInput',true);

for counter = 1:20
   data = randi([0 1],30,1);
   modSignal = modObj(data);
   txPluto(modSignal);
end

Using Frequency Correction with One ADALM-PLUTO Radio

When transmitting and receiving using one ADALM-PLUTO radio, individual transmitter and receiver objects use the same underlying radio hardware setting for frequency correction.

rx = sdrrx('Pluto');
tx = sdrtx('Pluto');
rx.ShowAdvancedProperties = true;
tx.ShowAdvancedProperties = true;

% This uses the default value of 0 for FrequencyCorrection 
% of the received and transmitted data.
data = rx();
tx(zeros(1024,1));

% This uses 1 for FrequencyCorrection of the received and transmitted data.
rx.FrequencyCorrection = 1;
data = rx();
tx(zeros(1024,1));

% This uses 2 for FrequencyCorrection of the transmitted and received data.
tx.FrequencyCorrection = 2;
tx(zeros(1024,1));
data = rx();

The last update of the radio hardware frequency correction setting is made by the transmitter object, the radio uses the setting as updated by the value set with tx.FrequencyCorrection the next time the receiver object is executed.

Get Pluto Radio Information

Use the info object function to get information from the connected PlutoSDR. The actual values used in the radio are shown by info and can be vary slightly from the values specified in the object.

tx = sdrtx('Pluto');
info(tx)
tx = 

  comm.SDRTxPluto with properties:

   Main
            DeviceName: 'Pluto'
               RadioID: 'usb:0'
       CenterFrequency: 2.4000e+09
                  Gain: -10
        ChannelMapping: 1
    BasebandSampleRate: 1000000

  Show all properties

ans = 

  struct with fields:

                     Status: 'Full information'
            CenterFrequency: 2.4000e+09
         BasebandSampleRate: 999999
                  SerialNum: '104473222a870010050020009db5d52277'
                       Gain: -10
       RadioFirmwareVersion: "0.26"
    ExpectedFirmwareVersion: "0.26"
            HardwareVersion: "B0"

Introduced in R2017a