Main Content

hdlcoder.sdr

Create transmitter and receiver for AD936x-based software-defined radio hardware

Since R2024a

Add-On Required: This feature requires the HDL Coder™ Support Package for Xilinx® FPGA and SoC Devices add-on.

Description

The hdlcoder.sdr System object™ is a signal source that transmits and receives data from an AD936x-based software-defined radio (SDR) hardware device. Use this object to simulate and develop various SDR applications.

To use this object, when setting up the hardware in Guided Hardware Setup, select Xilinx Zynq® ZC706 Evaluation Kit with Analog Devices® FMCOMMS2/3/4 RF card.

To transmit and receive data from the radio hardware:

  1. Create the hdlcoder.sdr 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?

Creation

Description

sdrTxRx = hdlcoder.sdr("Device") creates a transmitter and receiver System object with default properties for the specified hardware device.

Example: sdrTxRx = hdlcoder.sdr('AD936x');

example

sdrTxRx = hdlcoder.sdr('Device',Name=Value) creates a transmitter and receiver object using one or more name-value arguments. You can specify additional name-value arguments in any order as (Name1,Value1,...,NameN,ValueN). If you do not specify a property, it uses the default value.

Example: sdrTxRx = hdlcoder.sdr('AD936x',CenterFrequency=2.4e9,BasebandSampleRate=3.8e6);

example

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.

Internet Protocol (IP) address of the radio device, specified as character vector.

This value must match the physical IP address of the radio hardware assigned during hardware setup. If you configure the radio hardware with an IP address other than the default address, update IPAddress accordingly.

Example: sdrTxRx = hdlcoder.sdr('AD936x',IPAddress='192.168.3.2');

Data Types: char | string

RF center frequency setting in Hz, specified as a nonnegative finite scalar.

Example: sdrTxRx = hdlcoder.sdr('AD936x',CenterFrequency=2.4e9);

Tunable: Yes

Data Types: double

This property is read-only.

Channel output mapping, specified as one of these values:

  • 1 — Only channel 1 is in use.

  • 2 — Only channel 2 is in use.

  • [1 2] — Both channels are in use.

The RF chip of the radio hardware determines the number of channels you can use for receiving data.

Supported Radio HardwareRF ChipNumber of ChannelsSupported RF Ports

ZC706 and FMCOMMS2 or FMCOMMS3

AD93612

TX1A, RX1A, TX2A, RX2A

ZC706 and FMCOMMS4

AD93641

TXA, RXA

Baseband sampling rate in Hz, specified as a scalar.

Example: sdrTxRx = hdlcoder.sdr('AD936x',BasebandSampleRate=3.0e6);

Data Types: double

Radio transmitter gain in dB, specified as a scalar.

Example: sdrTxRx = hdlcoder.sdr('AD936x',TxGain=-10);

Tunable: Yes

Data Types: double

Receiver gain in dB, specified as a scalar.

Example: sdrTxRx = hdlcoder.sdr('AD936x',RxGain=10);

Tunable: Yes

Data Types: double

Number of samples per frame, specified as an even positive integer.

Example: sdrTxRx = hdlcoder.sdr('AD936x',SamplesPerFrame=2048);

Data Types: double

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

setupOne-time set up tasks for System objects
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Create a transmitter and receiver system object for the AD936x-based Zynq radio hardware with the default properties. Make sure that the hardware board is connected to your computer.

sdrTxRx = hdlcoder.sdr('AD936x')
sdrTxRx = 

  hdlcoder.sdr with properties:

            DeviceName: 'AD936x'
             IPAddress: '192.168.3.2'
       CenterFrequency: 2.4000e+09
                TxGain: -10
                RxGain: 4
    BasebandSampleRate: 1000000

Create a transmitter and receiver system object for the AD936x-based Zynq radio hardware with the specified properties. Make sure that the hardware board is connected to your computer.

sdrTxRx = hdlcoder.sdr('AD936x', ...
    IPAddress = '192.168.3.2',...
    CenterFrequency = 2.4e9,...
    ChannelMapping = [1 2],...
    BasebandSampleRate = 3840000,...
    TxGain = -10,...
    RxGain = 1,...
    SamplesPerFrame = 2048);
sdrTxRx = 

  hdlcoder.sdr with properties:

            DeviceName: 'AD936x'
             IPAddress: '192.168.3.2'
       CenterFrequency: 2.4000e+09
                TxGain: -10
                RxGain: 1
    BasebandSampleRate: 3840000

Setup the sdrTxRx system object.

setup(sdrTxRx);
## Establishing connection to hardware. This process can take several seconds.
## Establishing connection to hardware. This process can take several seconds.

After the setup completes, you can transmit and receive the data from the AD936x-based Zynq radio hardware. For more information, see Use MATLAB FPGA I/O Host Interface to Communicate with FPGA on Zynq-Based Radio.

Version History

Introduced in R2024a