"""Provides methods to configure the DDemod measurement."""
import functools
import nirfmxdemod.attributes as attributes
import nirfmxdemod.enums as enums
import nirfmxdemod.errors as errors
import nirfmxdemod.internal._helper as _helper
def _raise_if_disposed(f):
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
@functools.wraps(f)
def aux(*xs, **kws):
meas_obj = xs[0] # parameter 0 is 'self' which is the measurement object
if meas_obj._signal_obj.is_disposed:
raise Exception("Cannot access a disposed Demod signal configuration")
return f(*xs, **kws)
return aux
[docs]
class DDemodConfiguration(object):
"""Provides methods to configure the DDemod measurement."""
def __init__(self, signal_obj):
"""Provides methods to configure the DDemod measurement."""
self._signal_obj = signal_obj
self._session_function_lock = signal_obj._session_function_lock
self._interpreter = signal_obj._interpreter
[docs]
@_raise_if_disposed
def get_measurement_enabled(self, selector_string):
r"""Enables digital demodulation measurements.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (bool):
Enables digital demodulation measurements.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_MEASUREMENT_ENABLED.value
)
attr_val = bool(attr_val)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_enabled(self, selector_string, value):
r"""Enables digital demodulation measurements.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
value (bool):
Enables digital demodulation measurements.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_MEASUREMENT_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_modulation_type(self, selector_string):
r"""Gets the digital modulation type of the signal that needs to be analyzed.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **PSK**.
+--------------+---------------------------------------------------------------+
| Name (Value) | Description |
+==============+===============================================================+
| ASK (0) | The modulation type is amplitude-shift keying (ASK). |
+--------------+---------------------------------------------------------------+
| FSK (1) | The modulation type is frequency-shift keying (FSK). |
+--------------+---------------------------------------------------------------+
| PSK (2) | The modulation type is phase-shift keying (PSK). |
+--------------+---------------------------------------------------------------+
| QAM (3) | The modulation type is quadrature-amplitude modulation (QAM). |
+--------------+---------------------------------------------------------------+
| MSK (4) | The modulation type is minimum shift keying (MSK). |
+--------------+---------------------------------------------------------------+
| APSK (5) | The modulation type is amplitude phase-shift keying (APSK). |
+--------------+---------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodModulationType):
Specifies the digital modulation type of the signal that needs to be analyzed.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_MODULATION_TYPE.value
)
attr_val = enums.DDemodModulationType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_modulation_type(self, selector_string, value):
r"""Sets the digital modulation type of the signal that needs to be analyzed.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **PSK**.
+--------------+---------------------------------------------------------------+
| Name (Value) | Description |
+==============+===============================================================+
| ASK (0) | The modulation type is amplitude-shift keying (ASK). |
+--------------+---------------------------------------------------------------+
| FSK (1) | The modulation type is frequency-shift keying (FSK). |
+--------------+---------------------------------------------------------------+
| PSK (2) | The modulation type is phase-shift keying (PSK). |
+--------------+---------------------------------------------------------------+
| QAM (3) | The modulation type is quadrature-amplitude modulation (QAM). |
+--------------+---------------------------------------------------------------+
| MSK (4) | The modulation type is minimum shift keying (MSK). |
+--------------+---------------------------------------------------------------+
| APSK (5) | The modulation type is amplitude phase-shift keying (APSK). |
+--------------+---------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodModulationType, int):
Specifies the digital modulation type of the signal that needs to be analyzed.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodModulationType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_MODULATION_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_m(self, selector_string):
r"""Gets the M-ary number, which is the number of distinct states that represent symbols in the complex baseband
modulated waveform.
The M-ary number is calculated using the following formula:
M = 2\ :sup:`^`\(bits per symbol)
Recommended values of M for the modulation types are as follows:
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **4**.
+--------------+----------------------------+
| Name (Value) | Description |
+==============+============================+
| 2 (2) | The M-ary number is 2. |
+--------------+----------------------------+
| 4 (4) | The M-ary number is 4. |
+--------------+----------------------------+
| 8 (8) | The M-ary number is 8. |
+--------------+----------------------------+
| 16 (16) | The M-ary number is 16. |
+--------------+----------------------------+
| 32 (32) | The M-ary number is 32. |
+--------------+----------------------------+
| 64 (64) | The M-ary number is 64. |
+--------------+----------------------------+
| 128 (128) | The M-ary number is 128. |
+--------------+----------------------------+
| 256 (256) | The M-ary number is 256. |
+--------------+----------------------------+
| 512 (512) | The M-ary number is 512. |
+--------------+----------------------------+
| 1024 (1024) | The M-ary number is 1,024. |
+--------------+----------------------------+
| 2048 (2048) | The M-ary number is 2,048. |
+--------------+----------------------------+
| 4096 (4096) | The M-ary number is 4,096. |
+--------------+----------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodM):
Specifies the M-ary number, which is the number of distinct states that represent symbols in the complex baseband
modulated waveform.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_M.value
)
attr_val = enums.DDemodM(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_m(self, selector_string, value):
r"""Sets the M-ary number, which is the number of distinct states that represent symbols in the complex baseband
modulated waveform.
The M-ary number is calculated using the following formula:
M = 2\ :sup:`^`\(bits per symbol)
Recommended values of M for the modulation types are as follows:
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **4**.
+--------------+----------------------------+
| Name (Value) | Description |
+==============+============================+
| 2 (2) | The M-ary number is 2. |
+--------------+----------------------------+
| 4 (4) | The M-ary number is 4. |
+--------------+----------------------------+
| 8 (8) | The M-ary number is 8. |
+--------------+----------------------------+
| 16 (16) | The M-ary number is 16. |
+--------------+----------------------------+
| 32 (32) | The M-ary number is 32. |
+--------------+----------------------------+
| 64 (64) | The M-ary number is 64. |
+--------------+----------------------------+
| 128 (128) | The M-ary number is 128. |
+--------------+----------------------------+
| 256 (256) | The M-ary number is 256. |
+--------------+----------------------------+
| 512 (512) | The M-ary number is 512. |
+--------------+----------------------------+
| 1024 (1024) | The M-ary number is 1,024. |
+--------------+----------------------------+
| 2048 (2048) | The M-ary number is 2,048. |
+--------------+----------------------------+
| 4096 (4096) | The M-ary number is 4,096. |
+--------------+----------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodM, int):
Specifies the M-ary number, which is the number of distinct states that represent symbols in the complex baseband
modulated waveform.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodM else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_M.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_spectrum_inverted(self, selector_string):
r"""Gets whether to swap the acquired I and Q samples for demodulation.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+====================================================================================+
| False (0) | The acquired I and Q samples are used for demodulation as is. |
+--------------+------------------------------------------------------------------------------------+
| True (1) | The acquired I and Q samples are swapped before using the signal for demodulation. |
+--------------+------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodSpectrumInverted):
Specifies whether to swap the acquired I and Q samples for demodulation.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SPECTRUM_INVERTED.value
)
attr_val = enums.DDemodSpectrumInverted(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_spectrum_inverted(self, selector_string, value):
r"""Sets whether to swap the acquired I and Q samples for demodulation.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+====================================================================================+
| False (0) | The acquired I and Q samples are used for demodulation as is. |
+--------------+------------------------------------------------------------------------------------+
| True (1) | The acquired I and Q samples are swapped before using the signal for demodulation. |
+--------------+------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodSpectrumInverted, int):
Specifies whether to swap the acquired I and Q samples for demodulation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodSpectrumInverted else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_SPECTRUM_INVERTED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_differential_enabled(self, selector_string):
r"""Gets whether the symbols are differentially encoded. This attribute is applicable only to PSK and MSK modulation
types.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The symbols are directly mapped onto the symbol map. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | In case of PSK modulation, the transition between two consecutive symbols is mapped onto the symbol map. In case of MSK |
| | modulation, the consecutive bits are XORed. |
| | Other modulation types do not have any impact. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodDifferentialEnabled):
Specifies whether the symbols are differentially encoded. This attribute is applicable only to PSK and MSK modulation
types.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_DIFFERENTIAL_ENABLED.value
)
attr_val = enums.DDemodDifferentialEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_differential_enabled(self, selector_string, value):
r"""Sets whether the symbols are differentially encoded. This attribute is applicable only to PSK and MSK modulation
types.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The symbols are directly mapped onto the symbol map. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | In case of PSK modulation, the transition between two consecutive symbols is mapped onto the symbol map. In case of MSK |
| | modulation, the consecutive bits are XORed. |
| | Other modulation types do not have any impact. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodDifferentialEnabled, int):
Specifies whether the symbols are differentially encoded. This attribute is applicable only to PSK and MSK modulation
types.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodDifferentialEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_DIFFERENTIAL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_symbol_rate(self, selector_string):
r"""Gets the number of symbols transmitted in one second. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 100 kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the number of symbols transmitted in one second. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_SYMBOL_RATE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_symbol_rate(self, selector_string, value):
r"""Sets the number of symbols transmitted in one second. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 100 kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the number of symbols transmitted in one second. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_SYMBOL_RATE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_symbols(self, selector_string):
r"""Gets the number of symbols to be analyzed. The measurement acquires additional symbols to account for filter
delays.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1,000.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of symbols to be analyzed. The measurement acquires additional symbols to account for filter
delays.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_NUMBER_OF_SYMBOLS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_symbols(self, selector_string, value):
r"""Sets the number of symbols to be analyzed. The measurement acquires additional symbols to account for filter
delays.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1,000.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of symbols to be analyzed. The measurement acquires additional symbols to account for filter
delays.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_NUMBER_OF_SYMBOLS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_samples_per_symbol(self, selector_string):
r"""Gets the samples per symbol used to acquire the signal for the measurement.
*Sample rate* = *Symbol rate* * *Samples per symbol*.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Auto**.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the samples per symbol used to acquire the signal for the measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SAMPLES_PER_SYMBOL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_samples_per_symbol(self, selector_string, value):
r"""Sets the samples per symbol used to acquire the signal for the measurement.
*Sample rate* = *Symbol rate* * *Samples per symbol*.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Auto**.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the samples per symbol used to acquire the signal for the measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_SAMPLES_PER_SYMBOL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_evm_normalization_reference(self, selector_string):
r"""Gets the reference used to normalize the error vector magnitude (EVM).
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Peak**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Peak (0) | The EVM is normalized to the peak magnitude of the reference symbols. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| RMS (1) | The EVM is normalized to the RMS magnitude of the reference symbols. This value is applicable only to modulation types, |
| | such as quadrature-amplitude modulation (QAM). This value is expressed in which the symbols in the map do not have a |
| | constant amplitude. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodEvmNormalizationReference):
Specifies the reference used to normalize the error vector magnitude (EVM).
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_EVM_NORMALIZATION_REFERENCE.value,
)
attr_val = enums.DDemodEvmNormalizationReference(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_evm_normalization_reference(self, selector_string, value):
r"""Sets the reference used to normalize the error vector magnitude (EVM).
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Peak**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Peak (0) | The EVM is normalized to the peak magnitude of the reference symbols. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| RMS (1) | The EVM is normalized to the RMS magnitude of the reference symbols. This value is applicable only to modulation types, |
| | such as quadrature-amplitude modulation (QAM). This value is expressed in which the symbols in the map do not have a |
| | constant amplitude. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodEvmNormalizationReference, int):
Specifies the reference used to normalize the error vector magnitude (EVM).
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodEvmNormalizationReference else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_EVM_NORMALIZATION_REFERENCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fsk_deviation(self, selector_string):
r"""Gets the expected FSK frequency deviation At baseband frequencies, deviations for individual symbols are evenly
spaced in the interval [-*fd*, *fd*], where *fd* represents the frequency deviation. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 15 kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the expected FSK frequency deviation At baseband frequencies, deviations for individual symbols are evenly
spaced in the interval [-*fd*, *fd*], where *fd* represents the frequency deviation. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_FSK_DEVIATION.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fsk_deviation(self, selector_string, value):
r"""Sets the expected FSK frequency deviation At baseband frequencies, deviations for individual symbols are evenly
spaced in the interval [-*fd*, *fd*], where *fd* represents the frequency deviation. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 15 kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the expected FSK frequency deviation At baseband frequencies, deviations for individual symbols are evenly
spaced in the interval [-*fd*, *fd*], where *fd* represents the frequency deviation. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_FSK_DEVIATION.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fsk_reference_compensation_enabled(self, selector_string):
r"""Gets whether the FSK deviation that you specify is used to compensate for gain errors and compute FSK error.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------+
| Name (Value) | Description |
+==============+======================================+
| False (0) | Does not compensate for gain errors. |
+--------------+--------------------------------------+
| True (1) | Compensates for gain errors. |
+--------------+--------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodFskReferenceCompensationEnabled):
Specifies whether the FSK deviation that you specify is used to compensate for gain errors and compute FSK error.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_FSK_REFERENCE_COMPENSATION_ENABLED.value,
)
attr_val = enums.DDemodFskReferenceCompensationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fsk_reference_compensation_enabled(self, selector_string, value):
r"""Sets whether the FSK deviation that you specify is used to compensate for gain errors and compute FSK error.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------+
| Name (Value) | Description |
+==============+======================================+
| False (0) | Does not compensate for gain errors. |
+--------------+--------------------------------------+
| True (1) | Compensates for gain errors. |
+--------------+--------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodFskReferenceCompensationEnabled, int):
Specifies whether the FSK deviation that you specify is used to compensate for gain errors and compute FSK error.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = (
value.value if type(value) is enums.DDemodFskReferenceCompensationEnabled else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_FSK_REFERENCE_COMPENSATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_apsk_r2_to_r1_ratio(self, selector_string):
r"""Gets the ratio of the magnitude of symbols on a ring(R2) to the magnitude of symbols on the inner ring(R1). It is
applicable for both 16-APSK and 32-APSK.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2.84. Valid values are from 2 to 8, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the ratio of the magnitude of symbols on a ring(R2) to the magnitude of symbols on the inner ring(R1). It is
applicable for both 16-APSK and 32-APSK.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_APSK_R2_TO_R1_RATIO.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_apsk_r2_to_r1_ratio(self, selector_string, value):
r"""Sets the ratio of the magnitude of symbols on a ring(R2) to the magnitude of symbols on the inner ring(R1). It is
applicable for both 16-APSK and 32-APSK.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2.84. Valid values are from 2 to 8, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the ratio of the magnitude of symbols on a ring(R2) to the magnitude of symbols on the inner ring(R1). It is
applicable for both 16-APSK and 32-APSK.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.DDEMOD_APSK_R2_TO_R1_RATIO.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_apsk_r3_to_r1_ratio(self, selector_string):
r"""Gets the ratio of the magnitude of symbols on a ring(R3) to the magnitude of symbols on the inner ring(R1). It is
applicable for 32-APSK.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 5.27. Valid values are from 3 to 12, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the ratio of the magnitude of symbols on a ring(R3) to the magnitude of symbols on the inner ring(R1). It is
applicable for 32-APSK.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_APSK_R3_TO_R1_RATIO.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_apsk_r3_to_r1_ratio(self, selector_string, value):
r"""Sets the ratio of the magnitude of symbols on a ring(R3) to the magnitude of symbols on the inner ring(R1). It is
applicable for 32-APSK.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 5.27. Valid values are from 3 to 12, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the ratio of the magnitude of symbols on a ring(R3) to the magnitude of symbols on the inner ring(R1). It is
applicable for 32-APSK.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.DDEMOD_APSK_R3_TO_R1_RATIO.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_symbol_map_type(self, selector_string):
r"""Gets whether the measurement uses the default symbol map or the map that you configure using the
:py:meth:`configure_symbol_map` method.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Auto**.
+--------------+----------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+========================================================================================+
| Auto (0) | Uses a default symbol map. |
+--------------+----------------------------------------------------------------------------------------+
| Custom (1) | Uses the map that you specify using the RFmxDemod DDemod Configure Symbol Map method . |
+--------------+----------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodSymbolMapType):
Specifies whether the measurement uses the default symbol map or the map that you configure using the
:py:meth:`configure_symbol_map` method.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SYMBOL_MAP_TYPE.value
)
attr_val = enums.DDemodSymbolMapType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_symbol_map_type(self, selector_string, value):
r"""Sets whether the measurement uses the default symbol map or the map that you configure using the
:py:meth:`configure_symbol_map` method.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Auto**.
+--------------+----------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+========================================================================================+
| Auto (0) | Uses a default symbol map. |
+--------------+----------------------------------------------------------------------------------------+
| Custom (1) | Uses the map that you specify using the RFmxDemod DDemod Configure Symbol Map method . |
+--------------+----------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodSymbolMapType, int):
Specifies whether the measurement uses the default symbol map or the map that you configure using the
:py:meth:`configure_symbol_map` method.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodSymbolMapType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SYMBOL_MAP_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_pulse_shaping_filter_type(self, selector_string):
r"""Gets the pulse-shaping filter used to transmit the signal. This attribute determines the measurement filter to be
used for analysis when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE`
attribute to **Auto**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Root Raised Cosine**.
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+============================+==========================================================================================================================+
| Rectangular (0) | The transmitted waveform is filtered using a rectangular filter. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Raised Cosine (1) | The transmitted waveform is filtered using a raised cosine filter. Specify the filter Alpha in the DDemod Pulse Shaping |
| | Filter Parameter attribute. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Root Raised Cosine (2) | The transmitted waveform is filtered using a root raised cosine filter. Specify the filter Alpha in the DDemod Pulse |
| | Shaping Filter Parameter attribute. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Gaussian (3) | The transmitted waveform is filtered using a Gaussian filter. Specify the filter bandwidth * sample duration in the |
| | DDemod Pulse Shaping Filter Parameter attribute. This filter is applicable only to FSK and MSK modulation types. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Custom (4) | The transmitted waveform is filtered using the coefficients that you specify in the RFmxDemod DDemod Configure Pulse |
| | Shaping Filter Custom Coefficients method. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Half Sine (5) | The transmitted waveform is filtered using a half sine filter. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Linearized GMSK - EDGE (6) | The transmitted waveform is filtered using an EDGE-specific linearized GMSK filter. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| SOQPSK - TG (7) | The transmitted waveform is filtered using a SOQPSK - TG filter as defined in IRIG standard. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodPulseShapingFilterType):
Specifies the pulse-shaping filter used to transmit the signal. This attribute determines the measurement filter to be
used for analysis when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE`
attribute to **Auto**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_PULSE_SHAPING_FILTER_TYPE.value,
)
attr_val = enums.DDemodPulseShapingFilterType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_pulse_shaping_filter_type(self, selector_string, value):
r"""Sets the pulse-shaping filter used to transmit the signal. This attribute determines the measurement filter to be
used for analysis when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE`
attribute to **Auto**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Root Raised Cosine**.
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+============================+==========================================================================================================================+
| Rectangular (0) | The transmitted waveform is filtered using a rectangular filter. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Raised Cosine (1) | The transmitted waveform is filtered using a raised cosine filter. Specify the filter Alpha in the DDemod Pulse Shaping |
| | Filter Parameter attribute. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Root Raised Cosine (2) | The transmitted waveform is filtered using a root raised cosine filter. Specify the filter Alpha in the DDemod Pulse |
| | Shaping Filter Parameter attribute. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Gaussian (3) | The transmitted waveform is filtered using a Gaussian filter. Specify the filter bandwidth * sample duration in the |
| | DDemod Pulse Shaping Filter Parameter attribute. This filter is applicable only to FSK and MSK modulation types. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Custom (4) | The transmitted waveform is filtered using the coefficients that you specify in the RFmxDemod DDemod Configure Pulse |
| | Shaping Filter Custom Coefficients method. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Half Sine (5) | The transmitted waveform is filtered using a half sine filter. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Linearized GMSK - EDGE (6) | The transmitted waveform is filtered using an EDGE-specific linearized GMSK filter. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| SOQPSK - TG (7) | The transmitted waveform is filtered using a SOQPSK - TG filter as defined in IRIG standard. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodPulseShapingFilterType, int):
Specifies the pulse-shaping filter used to transmit the signal. This attribute determines the measurement filter to be
used for analysis when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE`
attribute to **Auto**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodPulseShapingFilterType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_PULSE_SHAPING_FILTER_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_pulse_shaping_filter_parameter(self, selector_string):
r"""Gets the rolloff factor for raised cosine and root-raised cosine filter that is used as pulse-shaping filter and
measurement filter respectively.
For Gaussian filter, this attribute specifies bandwidth * sample duration.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.5.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the rolloff factor for raised cosine and root-raised cosine filter that is used as pulse-shaping filter and
measurement filter respectively.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string,
attributes.AttributeID.DDEMOD_PULSE_SHAPING_FILTER_PARAMETER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_pulse_shaping_filter_parameter(self, selector_string, value):
r"""Sets the rolloff factor for raised cosine and root-raised cosine filter that is used as pulse-shaping filter and
measurement filter respectively.
For Gaussian filter, this attribute specifies bandwidth * sample duration.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.5.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the rolloff factor for raised cosine and root-raised cosine filter that is used as pulse-shaping filter and
measurement filter respectively.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.DDEMOD_PULSE_SHAPING_FILTER_PARAMETER.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_filter_type(self, selector_string):
r"""Gets whether the measurement needs to compute the measurement filter based on the pulse-shaping filter type or
uses the custom measurement filter coefficients.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Auto**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Auto (0) | The signal analyzer computes the measurement filter coefficients based on the pulse-shaping filter information that you |
| | specify in the DDemod Pulse Shaping Filter Type attribute. If the DDemod Pulse Shaping Filter Type attribute is set to |
| | Custom, the signal analyzer enables equalization. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Custom (1) | The signal analyzer uses the coefficients specified by RFmxDemod DDemod Configure Measurement Filter Custom |
| | Coefficients method. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodMeasurementFilterType):
Specifies whether the measurement needs to compute the measurement filter based on the pulse-shaping filter type or
uses the custom measurement filter coefficients.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE.value
)
attr_val = enums.DDemodMeasurementFilterType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_filter_type(self, selector_string, value):
r"""Sets whether the measurement needs to compute the measurement filter based on the pulse-shaping filter type or
uses the custom measurement filter coefficients.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Auto**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Auto (0) | The signal analyzer computes the measurement filter coefficients based on the pulse-shaping filter information that you |
| | specify in the DDemod Pulse Shaping Filter Type attribute. If the DDemod Pulse Shaping Filter Type attribute is set to |
| | Custom, the signal analyzer enables equalization. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Custom (1) | The signal analyzer uses the coefficients specified by RFmxDemod DDemod Configure Measurement Filter Custom |
| | Coefficients method. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodMeasurementFilterType, int):
Specifies whether the measurement needs to compute the measurement filter based on the pulse-shaping filter type or
uses the custom measurement filter coefficients.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodMeasurementFilterType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_equalizer_mode(self, selector_string):
r"""Gets whether the measurement needs to perform equalization.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Off**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Off (0) | Equalization is not performed. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Train (1) | The adaptive feedforward equalizer is turned ON to compensate for the effect of the channel. You can set the initial |
| | coefficients to be used by the equalizer. If you do not specify the initial coefficients, an impulse is used. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Hold (2) | The filter that you specify using the RFmxDemod DDemod Configure Equalizer Initial Coefficients method is used as the |
| | channel filter, and it is applied before demodulating the acquired signal. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodEqualizerMode):
Specifies whether the measurement needs to perform equalization.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_EQUALIZER_MODE.value
)
attr_val = enums.DDemodEqualizerMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_equalizer_mode(self, selector_string, value):
r"""Sets whether the measurement needs to perform equalization.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Off**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Off (0) | Equalization is not performed. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Train (1) | The adaptive feedforward equalizer is turned ON to compensate for the effect of the channel. You can set the initial |
| | coefficients to be used by the equalizer. If you do not specify the initial coefficients, an impulse is used. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Hold (2) | The filter that you specify using the RFmxDemod DDemod Configure Equalizer Initial Coefficients method is used as the |
| | channel filter, and it is applied before demodulating the acquired signal. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodEqualizerMode, int):
Specifies whether the measurement needs to perform equalization.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodEqualizerMode else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_EQUALIZER_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_equalizer_filter_length(self, selector_string):
r"""Gets the length of the equalization filter to be computed. The length is specified in terms of symbols.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 20.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the length of the equalization filter to be computed. The length is specified in terms of symbols.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_EQUALIZER_FILTER_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_equalizer_filter_length(self, selector_string, value):
r"""Sets the length of the equalization filter to be computed. The length is specified in terms of symbols.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 20.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the length of the equalization filter to be computed. The length is specified in terms of symbols.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_EQUALIZER_FILTER_LENGTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_equalizer_training_count(self, selector_string):
r"""Gets the number of iterations during which the equalizer adapts its coefficients in the training stage. After the
training stage, the measurement is performed over the specified number of averages.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of iterations during which the equalizer adapts its coefficients in the training stage. After the
training stage, the measurement is performed over the specified number of averages.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_EQUALIZER_TRAINING_COUNT.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_equalizer_training_count(self, selector_string, value):
r"""Sets the number of iterations during which the equalizer adapts its coefficients in the training stage. After the
training stage, the measurement is performed over the specified number of averages.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of iterations during which the equalizer adapts its coefficients in the training stage. After the
training stage, the measurement is performed over the specified number of averages.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_EQUALIZER_TRAINING_COUNT.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_equalizer_convergence_factor(self, selector_string):
r"""Gets the incremental step used by the equalizer to adapt to the channel during the training stage.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.0001
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the incremental step used by the equalizer to adapt to the channel during the training stage.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string,
attributes.AttributeID.DDEMOD_EQUALIZER_CONVERGENCE_FACTOR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_equalizer_convergence_factor(self, selector_string, value):
r"""Sets the incremental step used by the equalizer to adapt to the channel during the training stage.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.0001
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the incremental step used by the equalizer to adapt to the channel during the training stage.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.DDEMOD_EQUALIZER_CONVERGENCE_FACTOR.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_synchronization_enabled(self, selector_string):
r"""Gets whether the demodulator needs to search and synchronize the signal to a known reference sequence. The
reference sequence is the symbol representation of a defined set of bits known to be present in the transmitted signal.
If the synchronization is found in the demodulated signal, the measurement is performed from this point onward. If the
synchronization is not found, the entire signal is used for the measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+---------------------------------------------+
| Name (Value) | Description |
+==============+=============================================+
| False (0) | Does not search and synchronize the signal. |
+--------------+---------------------------------------------+
| True (1) | Searches and synchronizes the signal. |
+--------------+---------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodSynchronizationEnabled):
Specifies whether the demodulator needs to search and synchronize the signal to a known reference sequence. The
reference sequence is the symbol representation of a defined set of bits known to be present in the transmitted signal.
If the synchronization is found in the demodulated signal, the measurement is performed from this point onward. If the
synchronization is not found, the entire signal is used for the measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SYNCHRONIZATION_ENABLED.value
)
attr_val = enums.DDemodSynchronizationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_synchronization_enabled(self, selector_string, value):
r"""Sets whether the demodulator needs to search and synchronize the signal to a known reference sequence. The
reference sequence is the symbol representation of a defined set of bits known to be present in the transmitted signal.
If the synchronization is found in the demodulated signal, the measurement is performed from this point onward. If the
synchronization is not found, the entire signal is used for the measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+---------------------------------------------+
| Name (Value) | Description |
+==============+=============================================+
| False (0) | Does not search and synchronize the signal. |
+--------------+---------------------------------------------+
| True (1) | Searches and synchronizes the signal. |
+--------------+---------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodSynchronizationEnabled, int):
Specifies whether the demodulator needs to search and synchronize the signal to a known reference sequence. The
reference sequence is the symbol representation of a defined set of bits known to be present in the transmitted signal.
If the synchronization is found in the demodulated signal, the measurement is performed from this point onward. If the
synchronization is not found, the entire signal is used for the measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodSynchronizationEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_SYNCHRONIZATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_synchronization_bits(self, selector_string):
r"""Gets the synchronization bits used to create the reference sequence that must be located in the demodulated
signal. The synchronization bits are modulated based on the modulation type to create the reference sequence.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the synchronization bits used to create the reference sequence that must be located in the demodulated
signal. The synchronization bits are modulated based on the modulation type to create the reference sequence.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i8_array(
updated_selector_string, attributes.AttributeID.DDEMOD_SYNCHRONIZATION_BITS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_synchronization_bits(self, selector_string, value):
r"""Sets the synchronization bits used to create the reference sequence that must be located in the demodulated
signal. The synchronization bits are modulated based on the modulation type to create the reference sequence.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the synchronization bits used to create the reference sequence that must be located in the demodulated
signal. The synchronization bits are modulated based on the modulation type to create the reference sequence.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i8_array(
updated_selector_string,
attributes.AttributeID.DDEMOD_SYNCHRONIZATION_BITS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_synchronization_measurement_offset(self, selector_string):
r"""Gets the offset, which is the location from which the signal is considered for further measurements. The offset is
specified in symbols of the reference sequence. This offset is not applicable when the synchronization bits are not
found.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset, which is the location from which the signal is considered for further measurements. The offset is
specified in symbols of the reference sequence. This offset is not applicable when the synchronization bits are not
found.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_SYNCHRONIZATION_MEASUREMENT_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_synchronization_measurement_offset(self, selector_string, value):
r"""Sets the offset, which is the location from which the signal is considered for further measurements. The offset is
specified in symbols of the reference sequence. This offset is not applicable when the synchronization bits are not
found.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset, which is the location from which the signal is considered for further measurements. The offset is
specified in symbols of the reference sequence. This offset is not applicable when the synchronization bits are not
found.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_SYNCHRONIZATION_MEASUREMENT_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_enabled(self, selector_string):
r"""Enables averaging for digital demodulation measurements.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The measurement is performed on a single acquisition. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement uses the value of the DDemod Averaging Count attribute for the number of acquisitions over which the |
| | measurement is averaged. The traces are not averaged. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodAveragingEnabled):
Enables averaging for digital demodulation measurements.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_AVERAGING_ENABLED.value
)
attr_val = enums.DDemodAveragingEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_enabled(self, selector_string, value):
r"""Enables averaging for digital demodulation measurements.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The measurement is performed on a single acquisition. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement uses the value of the DDemod Averaging Count attribute for the number of acquisitions over which the |
| | measurement is averaged. The traces are not averaged. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodAveragingEnabled, int):
Enables averaging for digital demodulation measurements.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodAveragingEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_AVERAGING_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_count(self, selector_string):
r"""Gets the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_AVERAGING_ENABLED` attribute to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_AVERAGING_ENABLED` attribute to **True**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_AVERAGING_COUNT.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_count(self, selector_string, value):
r"""Sets the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_AVERAGING_ENABLED` attribute to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_AVERAGING_ENABLED` attribute to **True**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_AVERAGING_COUNT.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_signal_structure(self, selector_string):
r"""Gets whether the signal is either a bursty signal or a continuous signal.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Continuous**.
+----------------+------------------------------------+
| Name (Value) | Description |
+================+====================================+
| Bursted (0) | The signal is a bursty signal. |
+----------------+------------------------------------+
| Continuous (1) | The signal is a continuous signal. |
+----------------+------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodSignalStructure):
Specifies whether the signal is either a bursty signal or a continuous signal.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SIGNAL_STRUCTURE.value
)
attr_val = enums.DDemodSignalStructure(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_signal_structure(self, selector_string, value):
r"""Sets whether the signal is either a bursty signal or a continuous signal.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Continuous**.
+----------------+------------------------------------+
| Name (Value) | Description |
+================+====================================+
| Bursted (0) | The signal is a bursty signal. |
+----------------+------------------------------------+
| Continuous (1) | The signal is a continuous signal. |
+----------------+------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodSignalStructure, int):
Specifies whether the signal is either a bursty signal or a continuous signal.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodSignalStructure else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SIGNAL_STRUCTURE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_burst_start_exclusion_symbols(self, selector_string):
r"""Gets the number of symbols from the start of the burst trigger that is excluded from the measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of symbols from the start of the burst trigger that is excluded from the measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_BURST_START_EXCLUSION_SYMBOLS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_burst_start_exclusion_symbols(self, selector_string, value):
r"""Sets the number of symbols from the start of the burst trigger that is excluded from the measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of symbols from the start of the burst trigger that is excluded from the measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_BURST_START_EXCLUSION_SYMBOLS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_burst_end_exclusion_symbols(self, selector_string):
r"""Gets the number of symbols that is excluded from the measurement before the falling edge of the burst.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of symbols that is excluded from the measurement before the falling edge of the burst.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_BURST_END_EXCLUSION_SYMBOLS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_burst_end_exclusion_symbols(self, selector_string, value):
r"""Sets the number of symbols that is excluded from the measurement before the falling edge of the burst.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of symbols that is excluded from the measurement before the falling edge of the burst.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_BURST_END_EXCLUSION_SYMBOLS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_iq_offset_removal_enabled(self, selector_string):
r"""Gets whether to remove the I/Q offset before the EVM measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+----------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================+
| False (0) | The IQ offset is not removed before the EVM measurement. |
+--------------+----------------------------------------------------------+
| True (1) | The IQ offset is removed before the EVM measurement. |
+--------------+----------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodIQOffsetRemovalEnabled):
Specifies whether to remove the I/Q offset before the EVM measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_IQ_OFFSET_REMOVAL_ENABLED.value,
)
attr_val = enums.DDemodIQOffsetRemovalEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_iq_offset_removal_enabled(self, selector_string, value):
r"""Sets whether to remove the I/Q offset before the EVM measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+----------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================+
| False (0) | The IQ offset is not removed before the EVM measurement. |
+--------------+----------------------------------------------------------+
| True (1) | The IQ offset is removed before the EVM measurement. |
+--------------+----------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodIQOffsetRemovalEnabled, int):
Specifies whether to remove the I/Q offset before the EVM measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodIQOffsetRemovalEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_IQ_OFFSET_REMOVAL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_cfo_estimation_mode(self, selector_string):
r"""Gets the carrier frequency offset estimation capability of the demodulator. If you select **Narrow**, coarse
carrier frequency offset estimation is disabled and only fine carrier frequency offset estimation is performed. This is
useful when analysing low SNR signals.
+--------------+------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================================+
| Narrow (0) | The measurement disables coarse carrier frequency offset estimation. |
+--------------+------------------------------------------------------------------------------+
| Wide (1) | The measurement enables coarse and fine carrier frequency offset estimation. |
+--------------+------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodCfoEstimationMode):
Specifies the carrier frequency offset estimation capability of the demodulator. If you select **Narrow**, coarse
carrier frequency offset estimation is disabled and only fine carrier frequency offset estimation is performed. This is
useful when analysing low SNR signals.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_CFO_ESTIMATION_MODE.value
)
attr_val = enums.DDemodCfoEstimationMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_cfo_estimation_mode(self, selector_string, value):
r"""Sets the carrier frequency offset estimation capability of the demodulator. If you select **Narrow**, coarse
carrier frequency offset estimation is disabled and only fine carrier frequency offset estimation is performed. This is
useful when analysing low SNR signals.
+--------------+------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================================+
| Narrow (0) | The measurement disables coarse carrier frequency offset estimation. |
+--------------+------------------------------------------------------------------------------+
| Wide (1) | The measurement enables coarse and fine carrier frequency offset estimation. |
+--------------+------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodCfoEstimationMode, int):
Specifies the carrier frequency offset estimation capability of the demodulator. If you select **Narrow**, coarse
carrier frequency offset estimation is disabled and only fine carrier frequency offset estimation is performed. This is
useful when analysing low SNR signals.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodCfoEstimationMode else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_CFO_ESTIMATION_MODE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_search_length_auto(self, selector_string):
r"""Gets whether the measurement should search for synchronization bit pattern in the waveform of length determined by
the measurement or search for length duration.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+================================================================================================+
| False (0) | Synchronization bit pattern is searched in a waveform within the search Length duration. |
+--------------+------------------------------------------------------------------------------------------------+
| True (1) | Synchronization bit pattern is searched in a waveform of length determined by the measurement. |
+--------------+------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DDemodSearchLengthAuto):
Specifies whether the measurement should search for synchronization bit pattern in the waveform of length determined by
the measurement or search for length duration.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_SEARCH_LENGTH_AUTO.value
)
attr_val = enums.DDemodSearchLengthAuto(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_search_length_auto(self, selector_string, value):
r"""Sets whether the measurement should search for synchronization bit pattern in the waveform of length determined by
the measurement or search for length duration.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+================================================================================================+
| False (0) | Synchronization bit pattern is searched in a waveform within the search Length duration. |
+--------------+------------------------------------------------------------------------------------------------+
| True (1) | Synchronization bit pattern is searched in a waveform of length determined by the measurement. |
+--------------+------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DDemodSearchLengthAuto, int):
Specifies whether the measurement should search for synchronization bit pattern in the waveform of length determined by
the measurement or search for length duration.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.DDemodSearchLengthAuto else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_SEARCH_LENGTH_AUTO.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_search_length(self, selector_string):
r"""Gets the length of the waveform within which the synchronization bit pattern needs to be searched when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_SEARCH_LENGTH_AUTO` attribute to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.001 seconds.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the length of the waveform within which the synchronization bit pattern needs to be searched when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_SEARCH_LENGTH_AUTO` attribute to **True**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_SEARCH_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_search_length(self, selector_string, value):
r"""Sets the length of the waveform within which the synchronization bit pattern needs to be searched when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_SEARCH_LENGTH_AUTO` attribute to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.001 seconds.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the length of the waveform within which the synchronization bit pattern needs to be searched when you set the
:py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_SEARCH_LENGTH_AUTO` attribute to **True**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string, attributes.AttributeID.DDEMOD_SEARCH_LENGTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_all_traces_enabled(self, selector_string):
r"""Gets whether to enable the traces to be stored and retrieved after performing the digital demodulation.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (bool):
Specifies whether to enable the traces to be stored and retrieved after performing the digital demodulation.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.DDEMOD_ALL_TRACES_ENABLED.value
)
attr_val = bool(attr_val)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_all_traces_enabled(self, selector_string, value):
r"""Sets whether to enable the traces to be stored and retrieved after performing the digital demodulation.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
value (bool):
Specifies whether to enable the traces to be stored and retrieved after performing the digital demodulation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.DDEMOD_ALL_TRACES_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_equalizer_initial_coefficients(self, selector_string, equalizer_initial_coefficients):
r"""Gets the initial equalizer coefficients used by the digital demodulation measurement.
Args:
selector_string (string):
This parameter comprises of the signal name.
Example:
""
You can use the :py:meth:`build_result_string` method to build the `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_.
equalizer_initial_coefficients (numpy.complex64):
This parameter returns the filter coefficients used as the equalizer initial coefficients.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter this parameter always returns 0.
dx (float):
This parameter returns the spacing between the coefficients as a fraction of the symbol spacing. For example, if four
coefficients correspond to one symbol, the spacing is 1/4.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
x0, dx, error_code = self._interpreter.digital_demod_get_equalizer_initial_coefficients(
updated_selector_string, equalizer_initial_coefficients
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code
[docs]
@_raise_if_disposed
def get_symbol_map(self, selector_string, symbol_map):
r"""Gets the symbol map that is used for digital demodulation measurements. Call this method after calling
:py:meth:`commit` method.
Args:
selector_string (string):
This parameter comprises of the signal name.
Example:
""
You can use the :py:meth:`build_result_string` method to build the `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_.
symbol_map (numpy.complex64):
This parameter returns the symbol map used for demodulation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.digital_demod_get_symbol_map(
updated_selector_string, symbol_map
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def set_symbol_map(self, selector_string, symbol_map):
r"""Sets the symbol map that is used for digital demodulation measurements.
Args:
selector_string (string):
Comprises the signal name.
Example:
""
You can use the :py:meth:`build_result_string` function to build the selector string.
symbol_map (numpy.complex64):
Specifies the symbol map used for demodulation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.digital_demod_set_symbol_map(
updated_selector_string, symbol_map
)
finally:
self._session_function_lock.exit_read_lock()
return error_code