Source code for nirfmxdemod.digital_demod_configuration

"""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_psk_format(self, selector_string): r"""Gets the PSK format. 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 **Normal**. +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +========================+==========================================================================================================================+ | Normal (0) | Sets the modulation type to PSK. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Offset QPSK (1) | Sets the modulation type to offset quadrature PSK (OQPSK). The ideal symbol timing of Q is offset by half of a symbol | | | period from the ideal symbol timing of I. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | PI/4 - QPSK (2) | Sets the modulation type to pi/4 QPSK. In this modulation, each QPSK symbol is rotated by | | | pi/4. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | PI/8 - 8PSK (3) | Sets the modulation type to pi/8-8 PSK. In this modulation, each 8 PSK symbol is rotated by pi/8. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | 3*PI/8 - 8PSK (4) | Sets the modulation type to 3*pi/8-8 PSK. In this modulation, each 8 PSK symbol is rotated by 3*pi/8. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Shaped Offset QPSK (5) | Sets the modulation type to Shaped Offset QPSK.The ideal symbol timing of Q is offset by half of a symbol period from | | | the ideal symbol timing of I and the waveform is shaped using frequency pulse filter. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.DDemodPskFormat): Specifies the PSK format. 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_PSK_FORMAT.value ) attr_val = enums.DDemodPskFormat(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_psk_format(self, selector_string, value): r"""Sets the PSK format. 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 **Normal**. +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +========================+==========================================================================================================================+ | Normal (0) | Sets the modulation type to PSK. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Offset QPSK (1) | Sets the modulation type to offset quadrature PSK (OQPSK). The ideal symbol timing of Q is offset by half of a symbol | | | period from the ideal symbol timing of I. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | PI/4 - QPSK (2) | Sets the modulation type to pi/4 QPSK. In this modulation, each QPSK symbol is rotated by | | | pi/4. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | PI/8 - 8PSK (3) | Sets the modulation type to pi/8-8 PSK. In this modulation, each 8 PSK symbol is rotated by pi/8. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | 3*PI/8 - 8PSK (4) | Sets the modulation type to 3*pi/8-8 PSK. In this modulation, each 8 PSK symbol is rotated by 3*pi/8. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Shaped Offset QPSK (5) | Sets the modulation type to Shaped Offset QPSK.The ideal symbol timing of Q is offset by half of a symbol period from | | | the ideal symbol timing of I and the waveform is shaped using frequency pulse filter. | +------------------------+--------------------------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.DDemodPskFormat, int): Specifies the PSK format. 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.DDemodPskFormat else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.DDEMOD_PSK_FORMAT.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 configure_modulation_type(self, selector_string, modulation_type, m, differential_enabled): r"""Configures the modulation type of the signal to be analyzed. 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>`_. modulation_type (enums.DDemodModulationType, int): This parameter specifies the digital modulation type of the signal that needs to be analyzed. 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). | +--------------+---------------------------------------------------------------+ m (enums.DDemodM, int): This parameter specifies the M-ary number, which is the number of distinct states that represent symbols in the complex baseband modulated waveform. .. note:: Recommended values of M for modulation types are as follows: - ASK: 2, 4, 8 - FSK , PSK: 2, 4, 8, 16 - QAM: 16, 32, 64, 128, 256, 512, 1028, 2048, 4096. 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. | +--------------+----------------------------+ differential_enabled (enums.DDemodDifferentialEnabled, int): This parameter specifies whether the symbols are differentially encoded. This attribute is applicable only to PSK and MSK modulation types. 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. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ 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") modulation_type = ( modulation_type.value if type(modulation_type) is enums.DDemodModulationType else modulation_type ) m = m.value if type(m) is enums.DDemodM else m differential_enabled = ( differential_enabled.value if type(differential_enabled) is enums.DDemodDifferentialEnabled else differential_enabled ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_modulation_type( updated_selector_string, modulation_type, m, differential_enabled ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_m(self, selector_string, m): r"""Configures the M-ary number. 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>`_. m (enums.DDemodM, int): This parameter specifies the M-ary number, which is the number of distinct states that represent symbols in the complex baseband modulated waveform. .. note:: Recommended values of M for modulation types are as follows: - ASK: 2, 4, 8 - FSK , PSK: 2, 4, 8, 16 - QAM: 16, 32, 64, 128, 256, 512, 1028, 2048, 4096. 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. | +--------------+----------------------------+ 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") m = m.value if type(m) is enums.DDemodM else m updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_m(updated_selector_string, m) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_number_of_symbols(self, selector_string, number_of_symbols): r"""Configures the number of symbols to be measured. 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>`_. number_of_symbols (int): This parameter 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() _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_configure_number_of_symbols( updated_selector_string, number_of_symbols ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_samples_per_symbol(self, selector_string, samples_per_symbol): r"""Configures the samples per symbol to be used to acquire the signal for the 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>`_. samples_per_symbol (int): This parameter specifies the samples per symbol used to acquire the signal for the measurement. +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+==========================================================================================================================+ | Auto (-1) | The measurement uses appropriate samples per symbol (SPS) based on modulation type and pulse shaping filter.SPS=8, for | | | FSK.SPS=4, for ASK,PSK, QAM, MSK when pulse shape filter is not rectangular.SPS=8, for ASK, PSK, QAM, MSK when pulse | | | shape filter is rectangular. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | 4 (4) | The samples per symbol value is 4. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | 8 (8) | The samples per symbol value is 8. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | 16 (16) | The samples per symbol value is 16. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ 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_configure_samples_per_symbol( updated_selector_string, samples_per_symbol ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_symbol_rate(self, selector_string, symbol_rate): r"""Configures the symbol rate for digital demodulation measurements. 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_rate (float): This parameter specifies the symbol rate in Hz. The default value is 100 kHz. 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_configure_symbol_rate( updated_selector_string, symbol_rate ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_psk_format(self, selector_string, psk_format): r"""Configures the PSK format. 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>`_. psk_format (enums.DDemodPskFormat, int): This parameter specifies the PSK format. The default value is **Normal**. +-------------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +===================+==========================================================================================================================+ | Normal (0) | Sets the modulation type to PSK. | +-------------------+--------------------------------------------------------------------------------------------------------------------------+ | Offset QPSK (1) | Sets the modulation type to offset quadrature PSK (OQPSK). The ideal symbol timing of Q is offset by half of a symbol | | | period from the ideal symbol timing of I. | +-------------------+--------------------------------------------------------------------------------------------------------------------------+ | PI/4 - QPSK (2) | Sets the modulation type to pi/4 QPSK. In this modulation, each QPSK symbol is rotated by pi/4. | +-------------------+--------------------------------------------------------------------------------------------------------------------------+ | PI/8 - 8PSK (3) | Sets the modulation type to pi/8 8PSK. In this modulation, each 8PSK symbol is rotated by pi/8. | +-------------------+--------------------------------------------------------------------------------------------------------------------------+ | 3*PI/8 - 8PSK (4) | Sets the modulation type to 3*pi/8-8 PSK. In this modulation, each 8 PSK symbol is rotated by 3*pi/8. | +-------------------+--------------------------------------------------------------------------------------------------------------------------+ 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") psk_format = ( psk_format.value if type(psk_format) is enums.DDemodPskFormat else psk_format ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_psk_format( updated_selector_string, psk_format ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_fsk_deviation(self, selector_string, fsk_deviation, fsk_ref_comp_enabled): r"""Configures the expected FSK deviation. 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>`_. fsk_deviation (float): This parameter specifies the expected FSK frequency deviation, in Hz. fsk_ref_comp_enabled (enums.DDemodFskReferenceCompensationEnabled, int): This parameter specifies whether the FSK deviation that you specify is used to compensate for gain errors and to compute the FSK error. Default value is **False**. +--------------+--------------------------------------+ | Name (Value) | Description | +==============+======================================+ | False (0) | Does not compensate for gain errors. | +--------------+--------------------------------------+ | True (1) | Compensates for gain errors. | +--------------+--------------------------------------+ 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") fsk_ref_comp_enabled = ( fsk_ref_comp_enabled.value if type(fsk_ref_comp_enabled) is enums.DDemodFskReferenceCompensationEnabled else fsk_ref_comp_enabled ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_fsk_deviation( updated_selector_string, fsk_deviation, fsk_ref_comp_enabled ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_spectrum_inverted(self, selector_string, spectrum_inverted): r"""Configures swapping of I and Q channels in the acquired waveform before demodulation. 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>`_. spectrum_inverted (enums.DDemodSpectrumInverted, int): This parameter specifies whether to swap the acquired I and Q samples for demodulation. 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. | +--------------+------------------------------------------------------------------------------------+ 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") spectrum_inverted = ( spectrum_inverted.value if type(spectrum_inverted) is enums.DDemodSpectrumInverted else spectrum_inverted ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_spectrum_inverted( updated_selector_string, spectrum_inverted ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_averaging(self, selector_string, averaging_enabled, averaging_count): r"""Configures averaging for digital demodulation measurements. 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>`_. averaging_enabled (enums.DDemodAveragingEnabled, int): This parameter enables averaging for digital demodulation measurement. +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+==========================================================================================================================+ | False (0) | The measurement is performed on a single acquisition. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | True (1) | The measurement uses the value of the Averaging Count parameter for the number of acquisitions over which the | | | measurement is averaged. The traces are not averaged. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ averaging_count (int): This parameter specifies the number of acquisitions used for averaging when you set the **Averaging Enabled** parameter 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() _helper.validate_not_none(selector_string, "selector_string") averaging_enabled = ( averaging_enabled.value if type(averaging_enabled) is enums.DDemodAveragingEnabled else averaging_enabled ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_averaging( updated_selector_string, averaging_enabled, averaging_count ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_pulse_shaping_filter_custom_coefficients( self, selector_string, x0, dx, pulse_shaping_filter_custom_coefficients ): r"""Configures the pulse-shaping filter coefficients. 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>`_. x0 (float): This parameter specifies the filter coefficients used as the pulse shaping filter on the transmitter. dx (float): This parameter specifies 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. pulse_shaping_filter_custom_coefficients (float): This parameter specifies the filter coefficients used as the pulse shaping filter on the transmitter. 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_configure_pulse_shaping_filter_custom_coefficients( updated_selector_string, x0, dx, pulse_shaping_filter_custom_coefficients ) ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_measurement_filter_custom_coefficients( self, selector_string, x0, dx, measurement_filter_custom_coefficients ): r"""Configures the measurement filter custom coefficients. 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>`_. x0 (float): This parameter specifies the filter coefficients to be used by demodulator. dx (float): This parameter specifies 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. measurement_filter_custom_coefficients (float): This parameter specifies the filter coefficients to be used by demodulator. 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_configure_measurement_filter_custom_coefficients( updated_selector_string, x0, dx, measurement_filter_custom_coefficients ) ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_synchronization( self, selector_string, synchronization_enabled, sync_bits, measurement_offset ): r"""Configures bit pattern synchronization. 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>`_. synchronization_enabled (enums.DDemodSynchronizationEnabled, int): This parameter 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. +--------------+---------------------------------------------+ | Name (Value) | Description | +==============+=============================================+ | False (0) | Does not search and synchronize the signal. | +--------------+---------------------------------------------+ | True (1) | Searches and synchronizes the signal. | +--------------+---------------------------------------------+ sync_bits (numpy.int8): This parameter specifies the synchronization bits used to create the reference sequence that needs to be searched in the demodulated signal. measurement_offset (int): This parameter specifies the offset, which is the location from which the signal is considered for further 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() _helper.validate_not_none(selector_string, "selector_string") synchronization_enabled = ( synchronization_enabled.value if type(synchronization_enabled) is enums.DDemodSynchronizationEnabled else synchronization_enabled ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_synchronization( updated_selector_string, synchronization_enabled, sync_bits, measurement_offset ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_evm_normalization_reference(self, selector_string, evm_normalization_reference): r"""Configures the error vector magnitude (EVM) normalization reference. 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>`_. evm_normalization_reference (enums.DDemodEvmNormalizationReference, int): This parameter specifies the reference used to normalize the EVM. +--------------+--------------------------------------------------------------------------------------------------------------------------+ | 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. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ 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") evm_normalization_reference = ( evm_normalization_reference.value if type(evm_normalization_reference) is enums.DDemodEvmNormalizationReference else evm_normalization_reference ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_evm_normalization_reference( updated_selector_string, evm_normalization_reference ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_signal_structure(self, selector_string, signal_structure): r"""Configures the structure of the incoming signal to be either a continuous signal or a bursty signal. 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>`_. signal_structure (enums.DDemodSignalStructure, int): This parameter specifies whether the signal is either a bursty signal or a continuous signal. The default value is **Continuous**. +----------------+------------------------------------+ | Name (Value) | Description | +================+====================================+ | Bursted (0) | The signal is a bursty signal. | +----------------+------------------------------------+ | Continuous (1) | The signal is 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() _helper.validate_not_none(selector_string, "selector_string") signal_structure = ( signal_structure.value if type(signal_structure) is enums.DDemodSignalStructure else signal_structure ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_signal_structure( updated_selector_string, signal_structure ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_equalizer( self, selector_string, equalizer_mode, equalizer_filter_length, x0, dx, equalizer_initial_coefficients, equalizer_training_count, equalizer_convergence_factor, ): r"""Configures the equalizer. 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_mode (enums.DDemodEqualizerMode, int): This parameter specifies whether the measurement needs to perform equalization. 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 initial coefficients is used as the channel filter and is applied before | | | demodulating the acquired signal. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ equalizer_filter_length (int): This parameter specifies the length of the equalization filter to be computed. The length is specified in terms of symbols. This parameter is ignored when the equalizer initial coefficients are specified. x0 (float): This parameter always pass 0 to this parameter. Any other values are ignored. dx (float): This parameter specifies 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. equalizer_initial_coefficients (numpy.complex64): This parameter specifies the initial coefficients to be used by the equalizer. equalizer_training_count (int): This parameter specifies the number of iterations during which the equalizer adapts its coefficients in the training stage. equalizer_convergence_factor (float): This parameter specifies the incremental step used to adapt the equalizer to the channel during the training stage. The default value is 0.0001. 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") equalizer_mode = ( equalizer_mode.value if type(equalizer_mode) is enums.DDemodEqualizerMode else equalizer_mode ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_equalizer( updated_selector_string, equalizer_mode, equalizer_filter_length, x0, dx, equalizer_initial_coefficients, equalizer_training_count, equalizer_convergence_factor, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_measurement_filter( self, selector_string, measurement_filter_type, x0, dx, measurement_filter_custom_coefficients, ): r"""Configures the measurement filter. 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>`_. measurement_filter_type (enums.DDemodMeasurementFilterType, int): This parameter specifies whether the measurement needs to compute the measurement filter based on the pulse shaping filter type or uses the custom measurement filter coefficients. 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 | | | Pulse Shaping Filter Type parameter of the RFmxDemod DDemod Configure Pulse Shaping Filter method. If the | | | Pulse Shaping Filter Type parameter 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. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ x0 (float): This parameter always pass 0 to this parameter. Any other values are ignored. dx (float): This parameter specifies 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. measurement_filter_custom_coefficients (numpy.float32): This parameter specifies the filter coefficients to be used by demodulator. 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") measurement_filter_type = ( measurement_filter_type.value if type(measurement_filter_type) is enums.DDemodMeasurementFilterType else measurement_filter_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_measurement_filter( updated_selector_string, measurement_filter_type, x0, dx, measurement_filter_custom_coefficients, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_pulse_shaping_filter( self, selector_string, pulse_shaping_filter_type, pulse_shaping_filter_parameter, x0, dx, pulse_shaping_filter_custom_coefficients, ): r"""Configures the pulse-shaping filter. 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>`_. pulse_shaping_filter_type (enums.DDemodPulseShapingFilterType, int): This parameter specifies the pulse-shaping filter used to transmit the signal and determines the measurement filter to be used for analysis when the :py:attr:`~nirfmxdemod.attributes.AttributeID.DDEMOD_MEASUREMENT_FILTER_TYPE` attribute is set to **Auto**. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | 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. | +----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | Linearised GMSK - EDGE (6) | The transmitted waveform is filtered using an EDGE-specific linearized GMSK filter. | +----------------------------+--------------------------------------------------------------------------------------------------------------------------+ pulse_shaping_filter_parameter (float): This parameter specifies the rolloff factor for the raised cosine and root-raised cosine filters that are used as pulse shaping filter, and measurement filter respectively. When pulse-shaping filter type is Gaussian, this attribute specifies bandwidth * sample duration (BT). x0 (float): This parameter always pass 0 to this parameter. Any other values are ignored. dx (float): This parameter specifies 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. pulse_shaping_filter_custom_coefficients (numpy.float32): This parameter specifies the filter coefficients used as the pulse shaping filter on the transmitter. 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") pulse_shaping_filter_type = ( pulse_shaping_filter_type.value if type(pulse_shaping_filter_type) is enums.DDemodPulseShapingFilterType else pulse_shaping_filter_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_pulse_shaping_filter( updated_selector_string, pulse_shaping_filter_type, pulse_shaping_filter_parameter, x0, dx, pulse_shaping_filter_custom_coefficients, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_symbol_map(self, selector_string, symbol_map_type, symbol_map): r"""Configures the symbol map that you use during measurements. 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_type (enums.DDemodSymbolMapType, int): This parameter specifies whether the measurement uses the default symbol map or the map that you configure using the RFmxDemod DDemod Configure Symbol Map method. +--------------+--------------------------------+ | Name (Value) | Description | +==============+================================+ | Auto (0) | Uses a default symbol map. | +--------------+--------------------------------+ | Custom (1) | Uses the map that you specify. | +--------------+--------------------------------+ symbol_map (numpy.complex64): This parameter specifies the custom symbol map. 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") symbol_map_type = ( symbol_map_type.value if type(symbol_map_type) is enums.DDemodSymbolMapType else symbol_map_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.digital_demod_configure_symbol_map( updated_selector_string, symbol_map_type, symbol_map ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_equalizer_initial_coefficients( self, selector_string, x0, dx, equalizer_initial_coefficients ): r"""Configures the equalizer coefficients. 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>`_. x0 (float): This parameter always pass 0 to this parameter. Any other values are ignored. dx (float): This parameter specifies 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. equalizer_initial_coefficients (numpy.complex64): This parameter specifies the initial coefficients to be used by the equalizer. 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_configure_equalizer_initial_coefficients( updated_selector_string, x0, dx, equalizer_initial_coefficients ) 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