# adi.ADRV9002.Tx
<!-- <div class="sysobj_h1">adi.ADRV9002.Tx</div> -->

<!-- <div class="sysobj_top_desc">
Receive data from Analog Devices AD9361 transceiver
</div> -->

<!-- <div class="sysobj_desc_title">Description</div> -->

<div class="sysobj_desc_txt">
<span>
    The adi.ADRV9002.Tx System object is a signal sink that can tranmsit<br>    complex data from the ADRV9002.<br> <br>    tx = adi.ADRV9002.Tx;<br>    tx = adi.ADRV9002.Tx('uri','ip:192.168.2.1');<br> <br>    <a href="http://www.analog.com/media/en/technical-documentation/data-sheets/ADRV9002.pdf">ADRV9002 Datasheet</a><br>
</span>

</div>

<div class="sysobj_desc_title">Creation</div>

The class can be instantiated in the following way with and without property name value pairs.

```matlab
dev = adi.ADRV9002.Tx
dev = adi.ADRV9002.Tx(Name, Value)
```

<div class="sysobj_desc_title">Properties</div>

<div class="sysobj_desc_txt">
<span>
Unless otherwise indicated, properties are non-tunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.
<br><br>
If a property is tunable, you can change its value at any time.
<br><br>
For more information on changing property values, see <a href="https://www.mathworks.com/help/matlab/matlab_prog/system-design-in-matlab-using-system-objects.html">System Design in MATLAB Using System Objects.</a>
</span>
</div>
<br>



:::{dropdown} ENSMModeChannel0
specified as one of the following: 'calibrated' 'primed' 'rf_enabled'
:::

:::{dropdown} ENSMModeChannel1
specified as one of the following: 'calibrated' 'primed' 'rf_enabled'
:::

:::{dropdown} AttenuationChannel0
Attentuation specified as a scalar from -89.75 to 0 dB with a resolution of 0.25 dB.
:::

:::{dropdown} AttenuationChannel1
Attentuation specified as a scalar from -89.75 to 0 dB with a resolution of 0.25 dB.
:::

:::{dropdown} AttenuationControlModeChannel0
Control attenuation through: - bypass - spi - pin
:::

:::{dropdown} AttenuationControlModeChannel1
Control attenuation through: - bypass - spi - pin
:::

:::{dropdown} PortEnableControlChannel0
specified as one of the following: 'spi' 'pin'
:::

:::{dropdown} PortEnableControlChannel1
specified as one of the following: 'spi' 'pin'
:::

:::{dropdown} ClosedLoopTrackingChannel0

:::

:::{dropdown} ClosedLoopTrackingChannel1

:::

:::{dropdown} LOLeakageTrackingChannel0

:::

:::{dropdown} LOLeakageTrackingChannel1

:::

:::{dropdown} LoopbackDelayTrackingChannel0

:::

:::{dropdown} LoopbackDelayTrackingChannel1

:::

:::{dropdown} PACorrectionTrackingChannel0

:::

:::{dropdown} PACorrectionTrackingChannel1

:::

:::{dropdown} QuadratureTrackingChannel0
Quadrature Error Correction on the fly tracking calibration for channel 0
:::

:::{dropdown} QuadratureTrackingChannel1
Quadrature Error Correction on the fly tracking calibration for channel 1
:::

:::{dropdown} SamplesPerFrame
Number of samples per frame, specified as an even positive integer from 2 to 16,777,216. Using values less than 3660 can yield poor performance.
:::

:::{dropdown} EnableCustomProfile
Enable use of custom Profile file to set SamplingRate, RFBandwidth, and other features of transceiver
:::

:::{dropdown} CustomProfileFileName
Path to custom Profile file created from profile wizard
:::

:::{dropdown} CustomStreamFileName
Path to custom stream file created from profile wizard
:::

:::{dropdown} SamplingRate
Baseband sampling rate in Hz, specified as a scalar in samples per second. This is a read-only property
:::

:::{dropdown} CenterFrequencyChannel0
RF center frequency, specified in Hz as a scalar. The default is 2.4e9. This property is tunable.
:::

:::{dropdown} CenterFrequencyChannel1
RF center frequency, specified in Hz as a scalar. The default is 2.4e9. This property is tunable.
:::

:::{dropdown} NCOCorrectionFrequencyChannel0
NCO correction frequency, specified in Hz as a scalar. The default is 0. This property is tunable.
:::

:::{dropdown} NCOCorrectionFrequencyChannel1
NCO correction frequency, specified in Hz as a scalar. The default is 0. This property is tunable.
:::

:::{dropdown} EnabledChannels
Indexs of channels to be enabled. Input should be a [1xN] vector with the indexes of channels to be enabled. Order is irrelevant
:::

:::{dropdown} uri
Hostname or IP address of remote libIIO device
:::

:::{dropdown} enIO
If true, connects to libIIO device during simulation
:::

:::{dropdown} DataSource
Data source, specified as one of the following: 'DMA' — Specify the host as the source of the data. 'DDS' — Specify the DDS on the radio hardware as the source of the data. In this case, each channel has two additive tones.
:::

:::{dropdown} DDSFrequencies
Frequencies values in Hz of the DDS tone generators. For complex data devices the input is a [2xN] matrix where N is the available channels on the board. For complex data devices this is at most max(EnabledChannels)*2. For non-complex data devices this is at most max(EnabledChannels). If N < this upper limit, other DDSs are not set.
:::

:::{dropdown} DDSScales
Scale of DDS tones in range [0,1]. For complex data devices the input is a [2xN] matrix where N is the available channels on the board. For complex data devices this is at most max(EnabledChannels)*2. For non-complex data devices this is at most max(EnabledChannels). If N < this upper limit, other DDSs are not set.
:::

:::{dropdown} DDSPhases
Phases of DDS tones in range [0,360000]. For complex data devices the input is a [2xN] matrix where N is the available channels on the board. For complex data devices this is at most max(EnabledChannels)*2. For non-complex data devices this is at most max(EnabledChannels). If N < this upper limit, other DDSs are not set.
:::

:::{dropdown} EnableCyclicBuffers
Enable Cyclic Buffers, configures transmit buffers to be cyclic, which makes them continuously repeat
:::


<br>
<div class="sysobj_desc_title">Example Usage</div>

```matlab

%% Configure device
tx = adi.ADRV9002.Tx;
tx.uri = 'ip:analog.local';

tx.CenterFrequencyChannel0 = 1e9;

tx.DataSource = 'DMA';
tx.EnableCyclicBuffers = true;
tx.EnabledChannels = 1;
%% Generate tone
amplitude = 2^15; frequency = 0.12e6;
swv1 = dsp.SineWave(amplitude, frequency);
swv1.ComplexOutput = true;
swv1.SamplesPerFrame = 2^14;
swv1.SampleRate = tx.SamplingRate;
y = swv1();
% Send
tx(y);

```