Source code for nirfmxdemod.analog_demod_configuration

"""Provides methods to configure the ADemod 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 ADemodConfiguration(object): """Provides methods to configure the ADemod measurement.""" def __init__(self, signal_obj): """Provides methods to configure the ADemod 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"""Gets whether to enable analog 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): Specifies whether to enable analog 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.ADEMOD_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"""Sets whether to enable analog 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): Specifies whether to enable analog 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.ADEMOD_MEASUREMENT_ENABLED.value, int(value), ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_audio_measurement_enabled(self, selector_string): r"""Gets whether to enable the audio signal measurements, such as SINAD, SNR, THD and THD+Noise. The default value is **True**. +--------------+----------------------------------+ | Name (Value) | Description | +==============+==================================+ | False (0) | Disables the audio measurements. | +--------------+----------------------------------+ | True (1) | Enables the audio measurements. | +--------------+----------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodAudioMeasurementEnabled): Specifies whether to enable the audio signal measurements, such as SINAD, SNR, THD and THD+Noise. 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.ADEMOD_AUDIO_MEASUREMENT_ENABLED.value, ) attr_val = enums.ADemodAudioMeasurementEnabled(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_audio_measurement_enabled(self, selector_string, value): r"""Sets whether to enable the audio signal measurements, such as SINAD, SNR, THD and THD+Noise. The default value is **True**. +--------------+----------------------------------+ | Name (Value) | Description | +==============+==================================+ | False (0) | Disables the audio measurements. | +--------------+----------------------------------+ | True (1) | Enables the audio measurements. | +--------------+----------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodAudioMeasurementEnabled, int): Specifies whether to enable the audio signal measurements, such as SINAD, SNR, THD and THD+Noise. 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.ADemodAudioMeasurementEnabled else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_AUDIO_MEASUREMENT_ENABLED.value, 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 analog modulation type of the signal that needs to be analyzed. The default value is **AM**. +--------------+---------------------------------------------------+ | Name (Value) | Description | +==============+===================================================+ | AM (0) | The signal to be analyzed is amplitude modulated. | +--------------+---------------------------------------------------+ | FM (1) | The signal to be analyzed is frequency modulated. | +--------------+---------------------------------------------------+ | PM (2) | The signal to be analyzed is phase modulated. | +--------------+---------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodModulationType): Specifies the analog 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.ADEMOD_MODULATION_TYPE.value ) attr_val = enums.ADemodModulationType(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 analog modulation type of the signal that needs to be analyzed. The default value is **AM**. +--------------+---------------------------------------------------+ | Name (Value) | Description | +==============+===================================================+ | AM (0) | The signal to be analyzed is amplitude modulated. | +--------------+---------------------------------------------------+ | FM (1) | The signal to be analyzed is frequency modulated. | +--------------+---------------------------------------------------+ | PM (2) | The signal to be analyzed is phase modulated. | +--------------+---------------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodModulationType, int): Specifies the analog 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.ADemodModulationType else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_MODULATION_TYPE.value, value ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_am_carrier_suppressed(self, selector_string): r"""Gets whether the carrier of the AM (amplitude modulated) signal is absent. 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 carrier of the AM signal is present. | +--------------+------------------------------------------+ | True (1) | The carrier of the AM signal is absent. | +--------------+------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodAMCarrierSuppressedEnabled): Specifies whether the carrier of the AM (amplitude modulated) signal is absent. 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.ADEMOD_AM_CARRIER_SUPPRESSED.value ) attr_val = enums.ADemodAMCarrierSuppressedEnabled(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_am_carrier_suppressed(self, selector_string, value): r"""Sets whether the carrier of the AM (amplitude modulated) signal is absent. 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 carrier of the AM signal is present. | +--------------+------------------------------------------+ | True (1) | The carrier of the AM signal is absent. | +--------------+------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodAMCarrierSuppressedEnabled, int): Specifies whether the carrier of the AM (amplitude modulated) signal is absent. 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.ADemodAMCarrierSuppressedEnabled else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_AM_CARRIER_SUPPRESSED.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_rbw_filter_type(self, selector_string): r"""Gets the shape of the digital RBW filter. 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 **Flat**. +---------------------+------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +=====================+======================================================================================================+ | None (0) | RBW filter is not applied on the acquired signal. | +---------------------+------------------------------------------------------------------------------------------------------+ | Gaussian (1) | RBW filter has a Gaussian response. | +---------------------+------------------------------------------------------------------------------------------------------+ | Flat (2) | RBW filter has a Flat response. | +---------------------+------------------------------------------------------------------------------------------------------+ | Synch Tuned - 4 (3) | RBW filter has a response of a 4-pole synchronously-tuned filter. | +---------------------+------------------------------------------------------------------------------------------------------+ | Synch Tuned - 5 (4) | RBW filter has a response of a 5-pole synchronously-tuned filter. | +---------------------+------------------------------------------------------------------------------------------------------+ | RRC (5) | RRC | | | filter with roll-off specified by the ADemod RBW RRC Alpha attribute is used as the RBW filter. | +---------------------+------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodRbwFilterType): Specifies the shape of the digital RBW filter. 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.ADEMOD_RBW_FILTER_TYPE.value ) attr_val = enums.ADemodRbwFilterType(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_rbw_filter_type(self, selector_string, value): r"""Sets the shape of the digital RBW filter. 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 **Flat**. +---------------------+------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +=====================+======================================================================================================+ | None (0) | RBW filter is not applied on the acquired signal. | +---------------------+------------------------------------------------------------------------------------------------------+ | Gaussian (1) | RBW filter has a Gaussian response. | +---------------------+------------------------------------------------------------------------------------------------------+ | Flat (2) | RBW filter has a Flat response. | +---------------------+------------------------------------------------------------------------------------------------------+ | Synch Tuned - 4 (3) | RBW filter has a response of a 4-pole synchronously-tuned filter. | +---------------------+------------------------------------------------------------------------------------------------------+ | Synch Tuned - 5 (4) | RBW filter has a response of a 5-pole synchronously-tuned filter. | +---------------------+------------------------------------------------------------------------------------------------------+ | RRC (5) | RRC | | | filter with roll-off specified by the ADemod RBW RRC Alpha attribute is used as the RBW filter. | +---------------------+------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodRbwFilterType, int): Specifies the shape of the digital RBW filter. 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.ADemodRbwFilterType else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_RBW_FILTER_TYPE.value, value ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_rbw_filter_bandwidth(self, selector_string): r"""Gets the bandwidth of the resolution bandwidth (RBW) filter to be applied to the acquired signal. 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 bandwidth of the resolution bandwidth (RBW) filter to be applied to the acquired signal. 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.ADEMOD_RBW_FILTER_BANDWIDTH.value ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def set_rbw_filter_bandwidth(self, selector_string, value): r"""Sets the bandwidth of the resolution bandwidth (RBW) filter to be applied to the acquired signal. 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 bandwidth of the resolution bandwidth (RBW) filter to be applied to the acquired signal. 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.ADEMOD_RBW_FILTER_BANDWIDTH.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_rbw_filter_alpha(self, selector_string): r"""Gets the roll-off factor of the root-raised cosine (RRC) filter. 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.1. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Specifies the roll-off factor of the root-raised cosine (RRC) filter. 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.ADEMOD_RBW_FILTER_ALPHA.value ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def set_rbw_filter_alpha(self, selector_string, value): r"""Sets the roll-off factor of the root-raised cosine (RRC) filter. 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.1. Args: selector_string (string): Pass an empty string. value (float): Specifies the roll-off factor of the root-raised cosine (RRC) filter. 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.ADEMOD_RBW_FILTER_ALPHA.value, value ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_measurement_interval(self, selector_string): r"""Gets the signal acquisition time for the analog demodulation measurement. This value is expressed in seconds. 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 ms. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Specifies the signal acquisition time for the analog demodulation measurement. This value is expressed in seconds. 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.ADEMOD_MEASUREMENT_INTERVAL.value ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def set_measurement_interval(self, selector_string, value): r"""Sets the signal acquisition time for the analog demodulation measurement. This value is expressed in seconds. 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 ms. Args: selector_string (string): Pass an empty string. value (float): Specifies the signal acquisition time for the analog demodulation measurement. This value is expressed in seconds. 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.ADEMOD_MEASUREMENT_INTERVAL.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_carrier_correction_frequency_enabled(self, selector_string): r"""Gets whether to correct the frequency error in the carrier when demodulating frequency-modulated (FM) or phase-modulated (PM) signals. 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) | Does not correct the carrier frequency error. | +--------------+-----------------------------------------------+ | True (1) | Corrects the carrier frequency error. | +--------------+-----------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodCarrierFrequencyCorrectionEnabled): Specifies whether to correct the frequency error in the carrier when demodulating frequency-modulated (FM) or phase-modulated (PM) 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.ADEMOD_CARRIER_CORRECTION_FREQUENCY_ENABLED.value, ) attr_val = enums.ADemodCarrierFrequencyCorrectionEnabled(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_carrier_correction_frequency_enabled(self, selector_string, value): r"""Sets whether to correct the frequency error in the carrier when demodulating frequency-modulated (FM) or phase-modulated (PM) signals. 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) | Does not correct the carrier frequency error. | +--------------+-----------------------------------------------+ | True (1) | Corrects the carrier frequency error. | +--------------+-----------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodCarrierFrequencyCorrectionEnabled, int): Specifies whether to correct the frequency error in the carrier when demodulating frequency-modulated (FM) or phase-modulated (PM) 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.ADemodCarrierFrequencyCorrectionEnabled else value ) error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_CARRIER_CORRECTION_FREQUENCY_ENABLED.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_carrier_correction_phase_enabled(self, selector_string): r"""Gets whether to correct the carrier phase error when demodulating phase-modulated signals. 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) | Does not correct the carrier phase error. | +--------------+-------------------------------------------+ | True (1) | Corrects the carrier phase error. | +--------------+-------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodCarrierPhaseCorrectionEnabled): Specifies whether to correct the carrier phase error when demodulating phase-modulated 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.ADEMOD_CARRIER_CORRECTION_PHASE_ENABLED.value, ) attr_val = enums.ADemodCarrierPhaseCorrectionEnabled(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_carrier_correction_phase_enabled(self, selector_string, value): r"""Sets whether to correct the carrier phase error when demodulating phase-modulated signals. 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) | Does not correct the carrier phase error. | +--------------+-------------------------------------------+ | True (1) | Corrects the carrier phase error. | +--------------+-------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodCarrierPhaseCorrectionEnabled, int): Specifies whether to correct the carrier phase error when demodulating phase-modulated 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.ADemodCarrierPhaseCorrectionEnabled else value ) error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_CARRIER_CORRECTION_PHASE_ENABLED.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_fm_de_emphasis(self, selector_string): r"""Gets the time constant of de-emphasis filter, which compensates for the pre-emphasis filter in the FM transmitter. This value is expressed in seconds. The lowpass characteristic transfer function of the de-emphasis filter is as shown in the following equation: *H*(*f*) = 1/(1+*j*(2*pi**f**Ï„) where Ï„ is the de-emphasis filter time constant. This value is expressed in seconds. 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 seconds. No filter is applied on the demodulated signal when de-emphasis is set to 0. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Specifies the time constant of de-emphasis filter, which compensates for the pre-emphasis filter in the FM transmitter. This value is expressed in seconds. 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.ADEMOD_FM_DE_EMPHASIS.value ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def set_fm_de_emphasis(self, selector_string, value): r"""Sets the time constant of de-emphasis filter, which compensates for the pre-emphasis filter in the FM transmitter. This value is expressed in seconds. The lowpass characteristic transfer function of the de-emphasis filter is as shown in the following equation: *H*(*f*) = 1/(1+*j*(2*pi**f**Ï„) where Ï„ is the de-emphasis filter time constant. This value is expressed in seconds. 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 seconds. No filter is applied on the demodulated signal when de-emphasis is set to 0. Args: selector_string (string): Pass an empty string. value (float): Specifies the time constant of de-emphasis filter, which compensates for the pre-emphasis filter in the FM transmitter. This value is expressed in seconds. 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.ADEMOD_FM_DE_EMPHASIS.value, value ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_audio_filter_type(self, selector_string): r"""Gets the audio filter to be applied on the analog demodulated 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 **None**. +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +=================+==========================================================================================================================+ | None (0) | Does not use any audio filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | Custom (1) | Uses the filter specified by the Ademod Audio Filter Lower Cutoff attribute and the Ademod Audio Filter Upper Cutoff | | | attribute. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | A - Weight (2) | Uses an A-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | B - Weight (3) | Uses a B-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | C - Weight (4) | Uses a C-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | CCITT (5) | Uses the filter specified by CCITT. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | ITU-R 468-4 (6) | Uses the filter specified by ITU-R 468-4. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodAudioFilterType): Specifies the audio filter to be applied on the analog demodulated 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.ADEMOD_AUDIO_FILTER_TYPE.value ) attr_val = enums.ADemodAudioFilterType(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_audio_filter_type(self, selector_string, value): r"""Sets the audio filter to be applied on the analog demodulated 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 **None**. +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +=================+==========================================================================================================================+ | None (0) | Does not use any audio filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | Custom (1) | Uses the filter specified by the Ademod Audio Filter Lower Cutoff attribute and the Ademod Audio Filter Upper Cutoff | | | attribute. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | A - Weight (2) | Uses an A-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | B - Weight (3) | Uses a B-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | C - Weight (4) | Uses a C-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | CCITT (5) | Uses the filter specified by CCITT. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | ITU-R 468-4 (6) | Uses the filter specified by ITU-R 468-4. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodAudioFilterType, int): Specifies the audio filter to be applied on the analog demodulated 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.ADemodAudioFilterType else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_audio_filter_lower_cutoff_frequency(self, selector_string): r"""Gets the lower cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Specifies the lower cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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.ADEMOD_AUDIO_FILTER_LOWER_CUTOFF_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def set_audio_filter_lower_cutoff_frequency(self, selector_string, value): r"""Sets the lower cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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. Args: selector_string (string): Pass an empty string. value (float): Specifies the lower cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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.ADEMOD_AUDIO_FILTER_LOWER_CUTOFF_FREQUENCY.value, value, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_audio_filter_upper_cutoff_frequency(self, selector_string): r"""Gets the upper cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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 10,000. Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (float): Specifies the upper cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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.ADEMOD_AUDIO_FILTER_UPPER_CUTOFF_FREQUENCY.value, ) finally: self._session_function_lock.exit_read_lock() return attr_val, error_code
[docs] @_raise_if_disposed def set_audio_filter_upper_cutoff_frequency(self, selector_string, value): r"""Sets the upper cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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 10,000. Args: selector_string (string): Pass an empty string. value (float): Specifies the upper cutoff frequency of the custom audio filter. This attribute is applicable only when you set the :py:attr:`~nirfmxdemod.attributes.AttributeID.ADEMOD_AUDIO_FILTER_TYPE` attribute to **Custom**. 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.ADEMOD_AUDIO_FILTER_UPPER_CUTOFF_FREQUENCY.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"""Gets whether to enable averaging for the analog demodulation 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) | The measurement is performed on a single acquisition. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | True (1) | The analog demodulation measurement uses the ADemod Averaging Count attribute to calculate the number of acquisitions | | | over which the measurement is averaged. Traces are not averaged. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodAveragingEnabled): Specifies whether to enable averaging for the analog demodulation 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.ADEMOD_AVERAGING_ENABLED.value ) attr_val = enums.ADemodAveragingEnabled(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"""Sets whether to enable averaging for the analog demodulation 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) | The measurement is performed on a single acquisition. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | True (1) | The analog demodulation measurement uses the ADemod Averaging Count attribute to calculate the number of acquisitions | | | over which the measurement is averaged. Traces are not averaged. | +--------------+--------------------------------------------------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodAveragingEnabled, int): Specifies whether to enable averaging for the analog demodulation 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.ADemodAveragingEnabled else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_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.ADEMOD_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.ADEMOD_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.ADEMOD_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.ADEMOD_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.ADEMOD_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.ADEMOD_AVERAGING_COUNT.value, value ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def get_averaging_type(self, selector_string): r"""Gets the averaging type 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 **Linear**. +--------------+---------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+=================================================================================+ | Linear (0) | The averaged result is the mean value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ | Max (1) | The averaged result is the maximum value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ | Min (2) | The averaged result is the minimum value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. Returns: Tuple (attr_val, error_code): attr_val (enums.ADemodAveragingType): Specifies the averaging type 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.ADEMOD_AVERAGING_TYPE.value ) attr_val = enums.ADemodAveragingType(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_type(self, selector_string, value): r"""Sets the averaging type 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 **Linear**. +--------------+---------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+=================================================================================+ | Linear (0) | The averaged result is the mean value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ | Max (1) | The averaged result is the maximum value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ | Min (2) | The averaged result is the minimum value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ Args: selector_string (string): Pass an empty string. value (enums.ADemodAveragingType, int): Specifies the averaging type 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.ADemodAveragingType else value error_code = self._interpreter.set_attribute_i32( updated_selector_string, attributes.AttributeID.ADEMOD_AVERAGING_TYPE.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 analog demodulation 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. 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 analog demodulation 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.ADEMOD_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 analog demodulation 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. Args: selector_string (string): Pass an empty string. value (bool): Specifies whether to enable the traces to be stored and retrieved after performing the analog demodulation 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.ADEMOD_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): r"""Configures the modulation type for analog 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>`_. modulation_type (enums.ADemodModulationType, int): This parameter specifies the analog modulation type of the signal that needs to be analyzed. The default value is **AM**. +--------------+---------------------------------------------------+ | Name (Value) | Description | +==============+===================================================+ | AM (0) | The signal to be analyzed is amplitude modulated. | +--------------+---------------------------------------------------+ | FM (1) | The signal to be analyzed is frequency modulated. | +--------------+---------------------------------------------------+ | PM (2) | The signal to be analyzed is phase modulated. | +--------------+---------------------------------------------------+ 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.ADemodModulationType else modulation_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.analog_demod_configure_modulation_type( updated_selector_string, modulation_type ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_measurement_interval(self, selector_string, measurement_interval): r"""Configures the measurement interval for analog 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>`_. measurement_interval (float): This parameter specifies the signal acquisition time, in seconds, for the analog demodulation 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() _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.analog_demod_configure_measurement_interval( updated_selector_string, measurement_interval ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_am_carrier_suppressed(self, selector_string, am_carrier_suppressed_enabled): r"""Configures the presence of the amplitude modulated (AM) carrier. 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>`_. am_carrier_suppressed_enabled (enums.ADemodAMCarrierSuppressedEnabled, int): This parameter specifies whether the carrier of the AM signal is absent. The default value is **False**. +--------------+------------------------------------------+ | Name (Value) | Description | +==============+==========================================+ | False (0) | The carrier of the AM signal is present. | +--------------+------------------------------------------+ | True (1) | The carrier of the AM signal is absent. | +--------------+------------------------------------------+ 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") am_carrier_suppressed_enabled = ( am_carrier_suppressed_enabled.value if type(am_carrier_suppressed_enabled) is enums.ADemodAMCarrierSuppressedEnabled else am_carrier_suppressed_enabled ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.analog_demod_configure_am_carrier_suppressed( updated_selector_string, am_carrier_suppressed_enabled ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_audio_filter( self, selector_string, audio_filter_type, audio_filter_lower_cutoff_frequency, audio_filter_upper_cutoff_frequency, ): r"""Configures the audio filter for analog 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>`_. audio_filter_type (enums.ADemodAudioFilterType, int): This parameter specifies the audio filter to be applied on the analog demodulated signal. The default value is **None**. For more information about filter response refer to the `Analog Demod <https://www.ni.com/docs/en-US/bundle/rfmx-demod/page/analog-demod.html>`_ topic page. +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +=================+==========================================================================================================================+ | None (0) | Does not use any audio filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | Custom (1) | Uses the filter specified by the Ademod Audio Filter Lower Cutoff attribute and the Ademod Audio Filter Upper Cutoff | | | attribute. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | A - Weight (2) | Uses an A-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | B - Weight (3) | Uses a B-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | C - Weight (4) | Uses a C-weighted filter. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | CCITT (5) | Uses the filter specified by CCITT. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ | ITU-R 468-4 (6) | Uses the filter specified by ITU-R 468-4. | +-----------------+--------------------------------------------------------------------------------------------------------------------------+ audio_filter_lower_cutoff_frequency (float): This parameter specifies the lower cutoff frequency, in Hz, of the custom audio filter. audio_filter_upper_cutoff_frequency (float): This parameter specifies the upper cutoff frequency, in Hz, of the custom audio filter. 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") audio_filter_type = ( audio_filter_type.value if type(audio_filter_type) is enums.ADemodAudioFilterType else audio_filter_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.analog_demod_configure_audio_filter( updated_selector_string, audio_filter_type, audio_filter_lower_cutoff_frequency, audio_filter_upper_cutoff_frequency, ) 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, averaging_type ): r"""Configures averaging for analog 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.ADemodAveragingEnabled, int): This parameter enables averaging for analog 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**. averaging_type (enums.ADemodAveragingType, int): This parameter specifies the averaging type for the measurement. +--------------+---------------------------------------------------------------------------------+ | Name (Value) | Description | +==============+=================================================================================+ | Linear (0) | The averaged result is the mean value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ | Max (1) | The averaged result is the maximum value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ | Min (2) | The averaged result is the minimum value measured across multiple acquisitions. | +--------------+---------------------------------------------------------------------------------+ 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.ADemodAveragingEnabled else averaging_enabled ) averaging_type = ( averaging_type.value if type(averaging_type) is enums.ADemodAveragingType else averaging_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.analog_demod_configure_averaging( updated_selector_string, averaging_enabled, averaging_count, averaging_type ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_carrier_correction( self, selector_string, carrier_frequency_correction_enabled, carrier_phase_correction_enabled, ): r"""Configures the carrier correction in analog 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>`_. carrier_frequency_correction_enabled (enums.ADemodCarrierFrequencyCorrectionEnabled, int): This parameter specifies whether to correct the frequency error in the carrier when demodulating frequency-modulated or phase-modulated signals. The default value is **True**. +--------------+-----------------------------------------------+ | Name (Value) | Description | +==============+===============================================+ | False (0) | Does not correct the carrier frequency error. | +--------------+-----------------------------------------------+ | True (1) | Corrects the carrier frequency error. | +--------------+-----------------------------------------------+ carrier_phase_correction_enabled (enums.ADemodCarrierPhaseCorrectionEnabled, int): This parameter specifies whether to correct the phase error in the carrier when demodulating phase-modulated signals. The default value is **True**. +--------------+-------------------------------------------+ | Name (Value) | Description | +==============+===========================================+ | False (0) | Does not correct the carrier phase error. | +--------------+-------------------------------------------+ | True (1) | Corrects the carrier phase 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() _helper.validate_not_none(selector_string, "selector_string") carrier_frequency_correction_enabled = ( carrier_frequency_correction_enabled.value if type(carrier_frequency_correction_enabled) is enums.ADemodCarrierFrequencyCorrectionEnabled else carrier_frequency_correction_enabled ) carrier_phase_correction_enabled = ( carrier_phase_correction_enabled.value if type(carrier_phase_correction_enabled) is enums.ADemodCarrierPhaseCorrectionEnabled else carrier_phase_correction_enabled ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.analog_demod_configure_carrier_correction( updated_selector_string, carrier_frequency_correction_enabled, carrier_phase_correction_enabled, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_fm_de_emphasis(self, selector_string, de_emphasis): r"""Configures the FM de-emphasis filter for analog 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>`_. de_emphasis (float): This parameter specifies the time constant, in seconds, of the de-emphasis filter, which compensates for the pre-emphasis filter in the FM 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.analog_demod_configure_fm_de_emphasis( updated_selector_string, de_emphasis ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_rbw_filter(self, selector_string, rbw, rbw_filter_type, rbw_rrc_alpha): r"""Configures the resolution bandwidth (RBW) filter for analog 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>`_. rbw (float): This parameter specifies the bandwidth, in Hz, of the resolution bandwidth (RBW) filter to be applied to the acquired signal. rbw_filter_type (enums.ADemodRbwFilterType, int): This parameter specifies the shape of the digital RBW filter. +---------------------+------------------------------------------------------------------------------------------------------+ | Name (Value) | Description | +=====================+======================================================================================================+ | None (0) | RBW filter is not applied on the acquired signal. | +---------------------+------------------------------------------------------------------------------------------------------+ | Gaussian (1) | RBW filter has a Gaussian response. | +---------------------+------------------------------------------------------------------------------------------------------+ | Flat (2) | RBW filter has a Flat response. | +---------------------+------------------------------------------------------------------------------------------------------+ | Synch Tuned - 4 (3) | RBW filter has a response of a 4-pole synchronously-tuned filter. | +---------------------+------------------------------------------------------------------------------------------------------+ | Synch Tuned - 5 (4) | RBW filter has a response of a 5-pole synchronously-tuned filter. | +---------------------+------------------------------------------------------------------------------------------------------+ | RRC (5) | RRC | | | filter with roll-off specified by the ADemod RBW RRC Alpha attribute is used as the RBW filter. | +---------------------+------------------------------------------------------------------------------------------------------+ rbw_rrc_alpha (float): This parameter specifies the roll-off factor of the root-raised cosine (RRC) filter. 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") rbw_filter_type = ( rbw_filter_type.value if type(rbw_filter_type) is enums.ADemodRbwFilterType else rbw_filter_type ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.analog_demod_configure_rbw_filter( updated_selector_string, rbw, rbw_filter_type, rbw_rrc_alpha ) finally: self._session_function_lock.exit_read_lock() return error_code