Radio Control Functions#
Enable and Disable#
Each subdevice may allow the TX and RX sections be enabled or disabled by the functions below.
-
bool vxsdr::get_tx_enabled(const uint8_t subdev = 0)#
Determine if the transmit RF section is enabled.
- Parameters:
subdev – the subdevice number
- Returns:
true if the command succeeds and the section is enabled, false otherwise
-
bool vxsdr::get_rx_enabled(const uint8_t subdev = 0)#
Determine if the receive RF section is enabled.
- Parameters:
subdev – the subdevice number
- Returns:
true if the command succeeds and the section is enabled, false otherwise
Tuning#
Each subdevice may have an adjustable RF frequency, with information and control provided by the functions below.
-
std::optional<std::array<double, 2>> vxsdr::get_tx_freq_range(const uint8_t subdev = 0)#
Get the transmit center frequency range.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum frequencies in Hz
-
std::optional<std::array<double, 2>> vxsdr::get_rx_freq_range(const uint8_t subdev = 0)#
Get the receive center frequency range.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum frequencies in Hz
-
std::optional<double> vxsdr::get_tx_freq(const uint8_t subdev = 0)#
Get the transmit center frequency. If the external transmit LO has been enabled, this command will return an error.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the center frequency in Hz
-
std::optional<double> vxsdr::get_rx_freq(const uint8_t subdev = 0)#
Get the receive center frequency. If the external receive LO has been enabled, this command will return an error.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the center frequency in Hz
-
bool vxsdr::set_tx_freq(const double freq_hz, const uint8_t subdev = 0)#
Set the transmit center frequency. If the external transmit LO has been enabled, this command will return an error. Set the external transmit LO to disabled to allow internal tuning.
- Parameters:
freq_hz – the desired frequency in Hz
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_freq(const double freq_hz, const uint8_t subdev = 0)#
Set the receive center frequency. If the external receive LO has been enabled, this command will return an error. Set the external receive LO to disabled to allow internal tuning.
- Parameters:
freq_hz – the desired frequency in Hz
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
-
std::optional<double> vxsdr::get_tx_if_freq(const uint8_t subdev = 0)#
Get the transmit intermediate frequency.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the intermediate frequency in Hz
-
std::optional<double> vxsdr::get_rx_if_freq(const uint8_t subdev = 0)#
Get the receive intermediate frequency.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the intermediate frequency in Hz
Tuning by Stage#
When multiple tuning stages are available, the functions below may be used to determine their ranges and control settings for each stage. Note that stage-level settings override the subdevice-level settings shown above; the user must ensure that the combined settings for all stages produce the desired frequency.
-
std::optional<unsigned> vxsdr::get_tx_num_freq_stages(const uint8_t subdev = 0)#
Get the number of transmit tuning stages.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the number of stages
-
std::optional<unsigned> vxsdr::get_rx_num_freq_stages(const uint8_t subdev = 0)#
Get the number of receive tuning stages.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the number of stages
-
std::optional<std::string> vxsdr::get_tx_freq_stage_name(const unsigned stage_num, const uint8_t subdev = 0)#
Get the name of a transmit tuning stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::string containing the name
-
std::optional<std::string> vxsdr::get_rx_freq_stage_name(const unsigned stage_num, const uint8_t subdev = 0)#
Get the name of a receive tuning stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::string containing the name
-
std::optional<std::array<double, 2>> vxsdr::get_tx_freq_range_stage(const unsigned stage_num, const uint8_t subdev = 0)#
Get the center frequency range for a transmit tuning stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum frequencies in Hz
-
std::optional<std::array<double, 2>> vxsdr::get_rx_freq_range_stage(const unsigned stage_num, const uint8_t subdev = 0)#
Get the center frequency range for a receive tuning stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum frequencies in Hz
-
std::optional<double> vxsdr::get_tx_freq_stage(const unsigned stage_num, const uint8_t subdev = 0)#
Get the center frequency of a transmit tuning stage. If the external transmit LO has been enabled, requesting the frequency of the internal LO stage will return an error. All stages which are tunable when an external LO is used will return a result.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with the center frequency in Hz
-
std::optional<double> vxsdr::get_rx_freq_stage(const unsigned stage_num, const uint8_t subdev = 0)#
Get the center frequency of a receive tuning stage. If the external receive LO has been enabled, requesting the frequency of the internal LO stage will return an error. All stages which are tunable when an external LO is used will return a result.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with the center frequency in Hz
-
bool vxsdr::set_tx_freq_stage(const double freq_hz, const unsigned stage_num, const uint8_t subdev = 0)#
Set the center frequency of a transmit tuning stage. If the external transmit LO has been enabled, tuning the internal LO stage will return an error. All stages which are tunable when an external LO is used will return a result. Disable the external LO setting to allow tuning the internal LO.
- Parameters:
freq_hz – the desired frequency in Hz
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_freq_stage(const double freq_hz, const unsigned stage_num, const uint8_t subdev = 0)#
Set the center frequency of a receive tuning stage. If the external receive LO has been enabled, tuning the internal LO stage will return an error. All stages which are tunable when an external LO is used will return a result. Disable the external LO setting to allow tuning the internal LO.
- Parameters:
freq_hz – the desired frequency in Hz
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
External LO#
Each subdevice may allow selection of an external LO, allowing phase synchronization across many devices.
-
bool vxsdr::get_tx_external_lo_enabled(const uint8_t subdev = 0)#
Determine if the transmit external LO input is enabled.
- Parameters:
subdev – the subdevice number
- Returns:
true if the command succeeds and the external LO is enabled, false otherwise
-
bool vxsdr::get_rx_external_lo_enabled(const uint8_t subdev = 0)#
Determine if the receive external LO input is enabled.
- Parameters:
subdev – the subdevice number
- Returns:
true if the command succeeds and the external LO is enabled, false otherwise
-
bool vxsdr::set_tx_external_lo_enabled(const bool enabled, const uint8_t subdev = 0)#
Enable or disable the transmit external LO input. If the transmit external LO is enabled, all transmit tuning commands which adjust the internal LO will return an error; you must disable the external LO in order to tune the internal LO. When switching from external to internal LO inputs, you will need to set the transmit frequency again so that the internal LO is properly configured. The radio does not necessarily retain previously tuned internal frequencies when the LO is switched from internal to external and back.
- Parameters:
enabled – the desired state
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_external_lo_enabled(const bool enabled, const uint8_t subdev = 0)#
Enable or disable the receive external LO input. If the receive external LO is enabled, all receive tuning commands which adjust the internal LO will return an error; you must disable the external LO in order to tune the internal LO. When switching from external to internal LO inputs, you will need to set the receive frequency again so that the internal LO is properly configured. The radio does not necessarily retain previously tuned internal frequencies when the LO is switched from internal to external and back.
- Parameters:
enabled – the desired state
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
Gain Control#
Each channel may have an adjustable gain, with information and control provided by the functions below.
-
std::optional<std::array<double, 2>> vxsdr::get_tx_gain_range(const uint8_t subdev = 0)#
Get the gain range for transmit channels.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum gains in dB
-
std::optional<std::array<double, 2>> vxsdr::get_rx_gain_range(const uint8_t subdev = 0)#
Get the gain range for receive channels.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum gains in dB
-
std::optional<double> vxsdr::get_tx_gain(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the gain for a transmit channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the gain in dB
-
std::optional<double> vxsdr::get_rx_gain(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the gain for a receive channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the gain in dB
-
bool vxsdr::set_tx_gain(const double gain_db, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the gain for a transmit channel.
- Parameters:
gain_db – the desired gain in dB
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_gain(const double gain_db, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the gain for a receive channel.
- Parameters:
gain_db – the desired gain in dB
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
Gain Control by Stage#
When multiple gain control stages are available, the functions below may be used to determine their ranges and control settings for each stage. Note that stage-level settings override the channel-level settings shown above; the user must ensure that the combined settings of all stages produce the desired gain.
-
std::optional<unsigned> vxsdr::get_tx_num_gain_stages(const uint8_t subdev = 0)#
Get the number of transmit gain stages.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the number of stages
-
std::optional<unsigned> vxsdr::get_rx_num_gain_stages(const uint8_t subdev = 0)#
Get the number of receive gain stages.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the number of stages
-
std::optional<std::string> vxsdr::get_tx_gain_stage_name(const unsigned stage_num, const uint8_t subdev = 0)#
Get the name of a transmit gain stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::string containing the name
-
std::optional<std::string> vxsdr::get_rx_gain_stage_name(const unsigned stage_num, const uint8_t subdev = 0)#
Get the name of a receive gain stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::string containing the name
-
std::optional<std::array<double, 2>> vxsdr::get_tx_gain_range_stage(const unsigned stage_num, const uint8_t subdev = 0)#
Get the gain range for a transmit gain control stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum gains in dB
-
std::optional<std::array<double, 2>> vxsdr::get_rx_gain_range_stage(const unsigned stage_num, const uint8_t subdev = 0)#
Get the gain range for a receive gain control stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum gains in dB
-
std::optional<double> vxsdr::get_tx_gain_stage(const unsigned stage_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the gain for a transmit gain control stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the gain in dB
-
std::optional<double> vxsdr::get_rx_gain_stage(const unsigned stage_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the gain for a receive gain control stage.
- Parameters:
stage_num – the number of the stage
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the gain in dB
-
bool vxsdr::set_tx_gain_stage(const double gain_db, const unsigned stage_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the gain for a transmit gain control stage.
- Parameters:
gain_db – the desired gain in dB
stage_num – the number of the stage
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_gain_stage(const double gain_db, const unsigned stage_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the gain for a receive gain control stage.
- Parameters:
gain_db – the desired gain in dB
stage_num – the number of the stage
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
Sampling Rate#
Each subdevice may have an adjustable sampling rate, with information and control provided by the functions below.
-
std::optional<std::array<double, 2>> vxsdr::get_tx_rate_range(const uint8_t subdev = 0)#
Get the transmit sample rate range.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum sample rates in samples/s
-
std::optional<std::array<double, 2>> vxsdr::get_rx_rate_range(const uint8_t subdev = 0)#
Get the receive sample rate range.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a std::array containing the minimum and maximum sample rates in samples/s
-
std::optional<double> vxsdr::get_tx_rate(const uint8_t subdev = 0)#
Get the transmit sample rate.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the rate in samples/s
-
std::optional<double> vxsdr::get_rx_rate(const uint8_t subdev = 0)#
Get the receive sample rate.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the rate in samples/s
Inputs and Outputs#
Each channel may have selectable input and output ports, with information and control provided by the functions below.
-
std::optional<unsigned> vxsdr::get_tx_num_ports(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the number of transmit output ports for a channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the number of output ports
-
std::optional<unsigned> vxsdr::get_rx_num_ports(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the number of receive input ports for a channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the number of input ports
-
std::optional<std::string> vxsdr::get_tx_port_name(const unsigned port_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the name of a transmit output port.
- Parameters:
port_num – the port number
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::string containing the name of the specified output port
-
std::optional<std::string> vxsdr::get_rx_port_name(const unsigned port_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the name of a receive input port.
- Parameters:
port_num – the port number
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::string containing the name of the specified input port
-
std::optional<unsigned> vxsdr::get_tx_port(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the transmit output port.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the port number
-
std::optional<unsigned> vxsdr::get_rx_port(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the receive input port.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with the port number
-
bool vxsdr::set_tx_port(const unsigned port_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the transmit output port.
- Parameters:
port_num – the desired output port number
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_port(const unsigned port_num, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the receive input port.
- Parameters:
port_num – the desired input port number
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
Radio Information#
Each subdevice provides several functions to determine its properties and its state.
-
std::optional<unsigned> vxsdr::get_tx_num_channels(const uint8_t subdev = 0)#
Get the number of transmit channels.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the number of channels
-
std::optional<unsigned> vxsdr::get_rx_num_channels(const uint8_t subdev = 0)#
Get the number of receive channels.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the number of channels
-
std::optional<vxsdr::stream_state> vxsdr::get_tx_stream_state(const uint8_t subdev = 0)#
Get the current radio transmit stream state.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a stream_state containing the transmit stream state
-
std::optional<vxsdr::stream_state> vxsdr::get_rx_stream_state(const uint8_t subdev = 0)#
Get the current radio receive stream state.
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with a stream_state containing the receive stream state
IQ Corrections and Filtering#
Corrections#
Each channel may allow manual adjustment of IQ bias, which provides control of LO feedthrough. On current devices, this adjustment is only enabled for the tx.
-
std::optional<std::array<double, 2>> vxsdr::get_tx_iq_bias(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the IQ DC bias for a transmit channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::array containing \(i_{bias}, q_{bias}\)
-
std::optional<std::array<double, 2>> vxsdr::get_rx_iq_bias(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the IQ DC bias for a receive channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::array containing \(i_{bias}, q_{bias}\)
-
bool vxsdr::set_tx_iq_bias(const std::array<double, 2> bias, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the IQ DC bias for the transmitter to control LO feedthrough.
Bias correction adds a constant offset to the data stream:
On transmit, this adjusts the mixer inputs so that local oscillator feedthrough can be minimized.\[\begin{split} \begin{bmatrix} i_{out} \\ q_{out} \end{bmatrix} = \begin{bmatrix} i_{in} \\ q_{in} \end{bmatrix} + \begin{bmatrix} i_{bias} \\ q_{bias} \end{bmatrix} \end{split}\]The values are normalized so that \(1 \ge i_{bias} \ge -1\) and \(1 \ge q_{bias} \ge -1\), where the extremes are the maximum values allowed by the device. Settings outside this range are clamped to the allowed range.
Most devices have a fixed precision (e.g. 12 bits) for the coefficients. The actual coefficients used can be determined by reading the coefficients back after they are set with the
get_tx_iq_bias()command.- Parameters:
bias – a std::array containing \(i_{bias}, q_{bias}\) in that order
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_iq_bias(const std::array<double, 2> bias, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the IQ DC bias for the receiver to control LO feedthrough.
The values are normalized so that \(1 \ge i_{bias} \ge -1\) and \(1 \ge q_{bias} \ge -1\), where the extremes are the maximum values allowed by the device. Settings outside this range are clamped to the allowed range.
Most devices have a fixed precision (e.g. 12 bits) for the coefficients. The actual coefficients used can be determined by reading the coefficients back after they are set with the
get_rx_iq_bias()command.- Parameters:
bias – a std::array containing \(i_{bias}, q_{bias}\) in that order (see the definition in the
set_tx_iq_bias()section)subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
Each channel may also allow manual correction of IQ amplitude and phase imbalance, which provides control of image rejection.
-
std::optional<std::array<double, 4>> vxsdr::get_tx_iq_corr(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the IQ correction for a transmit channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::array containing \(a_{ii}, a_{iq}, a_{qi}, a_{qq}\) (in that order), which are the coefficients of the matrix which transforms the IQ data on transmission.
-
std::optional<std::array<double, 4>> vxsdr::get_rx_iq_corr(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the IQ correction for a receive channel.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::array containing \(a_{ii}, a_{iq}, a_{qi}, a_{qq}\) (in that order), which are the coefficients of the matrix which transforms the IQ data on reception.
-
bool vxsdr::set_tx_iq_corr(const std::array<double, 4> corr, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the IQ correction for a transmit channel to control image rejection.
IQ correction transforms the sample stream using the following equation:
If no transformation is needed, the matrix can be the identity matrix (which is the default). Normally, it is sufficient to use only two coefficients to transform the data:\[\begin{split} \begin{bmatrix} i_{out} \\ q_{out} \end{bmatrix} = \begin{bmatrix} a_{ii} & a_{iq} \\ a_{qi} & a_{qq} \end{bmatrix} \begin{bmatrix} i_{in} \\ q_{in} \end{bmatrix} \end{split}\]where \(a_{qi} \approx 0\) and \(a_{qq} \approx 1\).\[\begin{split} \begin{bmatrix} i_{out} \\ q_{out} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ a_{qi} & a_{qq} \end{bmatrix} \begin{bmatrix} i_{in} \\ q_{in} \end{bmatrix} \end{split}\]Most devices have a fixed precision (e.g. 12 bits) for the coefficients. Some devices also restrict one of the four coefficients to be zero for efficiency reasons; for these devices, a Givens rotation is used to zero that coefficient if needed.
The actual coefficients used can be determined by reading the coefficients back after they are set with the
get_tx_iq_corr()command.- Parameters:
corr – a std::array containing \(a_{ii}, a_{iq}, a_{qi}, a_{qq}\) (in that order), which are the coefficients of the matrix which transforms the IQ data on transmission.
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_iq_corr(const std::array<double, 4> corr, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the IQ correction for a receive channel to control image rejection.
Most devices have a fixed precision and restrictions on which coefficients can be nonzero (as discussed in the
set_tx_iq_corr()section). The actual coefficients used can be determined by reading the coefficients back after they are set with theget_rx_iq_corr()command.- Parameters:
corr – a std::array containing \(a_{ii}, a_{iq}, a_{qi}, a_{qq}\) (in that order), which are the coefficients of the matrix which transforms the IQ data on reception (see the definition in the
set_tx_iq_corr()section)subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
Digital Filters#
Each channel may have a complex FIR filter which operates at the master clock rate for equalization, fractional delay, or other purposes.
The filter lengths are the same across all channels, and the filters on all channels are enabled or disabled together.
-
std::optional<unsigned> vxsdr::get_tx_filter_length(const uint8_t subdev = 0)#
Get the transmit frontend FIR filter’s length (maximum number of complex coefficients).
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the length (zero if no filter is present)
-
std::optional<unsigned> vxsdr::get_rx_filter_length(const uint8_t subdev = 0)#
Get the receive frontend FIR filter’s length (maximum number of complex coefficients).
- Parameters:
subdev – the subdevice number
- Returns:
a std::optional with the with the length (zero if no filter is present)
-
bool vxsdr::set_tx_filter_enabled(const bool enabled, const uint8_t subdev = 0)#
Enable or disable the transmit frontend FIR filter.
- Parameters:
enabled – the desired state
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_filter_enabled(const bool enabled, const uint8_t subdev = 0)#
Enable or disable the receive frontend FIR filter.
- Parameters:
enabled – the desired state
subdev – the subdevice number
- Returns:
true if the command succeeds, false otherwise
The coefficients of the filters may differ across channels.
-
std::optional<std::vector<filter_coefficient>> vxsdr::get_tx_filter_coeffs(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the transmit frontend FIR filter coefficients.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::vector<filter_coefficient> containing the filter coefficients
-
std::optional<std::vector<filter_coefficient>> vxsdr::get_rx_filter_coeffs(const uint8_t subdev = 0, const uint8_t channel = 0)#
Get the receive frontend FIR filter coefficients.
- Parameters:
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
a std::optional with a std::vector<filter_coefficient> containing the filter coefficients
-
bool vxsdr::set_tx_filter_coeffs(const std::vector<filter_coefficient> &coeffs, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the transmit frontend FIR filter coefficients.
- Parameters:
coeffs – a std::vector<filter_coefficient> containing the filter coefficients
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise
-
bool vxsdr::set_rx_filter_coeffs(const std::vector<filter_coefficient> &coeffs, const uint8_t subdev = 0, const uint8_t channel = 0)#
Set the receive frontend FIR filter coefficients.
- Parameters:
coeffs – a std::vector<filter_coefficient> containing the filter coefficients
subdev – the subdevice number
channel – the channel number within the subdevice
- Returns:
true if the command succeeds, false otherwise