"""Provides methods to fetch and read the Qevm measurement results."""
import functools
import nirfmxwcdma.attributes as attributes
import nirfmxwcdma.errors as errors
import nirfmxwcdma.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 Wcdma signal configuration")
return f(*xs, **kws)
return aux
[docs]
class QevmResults(object):
"""Provides methods to fetch and read the Qevm measurement results."""
def __init__(self, signal_obj):
"""Provides methods to fetch and read the Qevm measurement results."""
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_mean_rms_evm(self, selector_string):
r"""Gets the mean of the RMS EVM values for a QPSK signal. This value is expressed as a percentage. This value is
obtained by averaging the RMS EVMs over all averaging iterations. The number of acquisitions is specified by the value
of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The EVM of a chip is the magnitude of the vector difference between the received chip and the ideal chip. The
RMS EVM is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of the RMS EVM values for a QPSK signal. This value is expressed as a percentage. This value is
obtained by averaging the RMS EVMs over all averaging iterations. The number of acquisitions is specified by the value
of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MEAN_RMS_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_rms_evm(self, selector_string):
r"""Gets the maximum value of the RMS EVMs for a QPSK signal. This value is expressed as a percentage. This value is
obtained over all averaging iterations.
The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The EVM of a chip is the magnitude of the vector difference between the received chip and the ideal chip. The
RMS EVM is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the RMS EVMs for a QPSK signal. This value is expressed as a percentage. This value is
obtained over all averaging iterations.
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.QEVM_RESULTS_MAXIMUM_RMS_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_peak_evm(self, selector_string):
r"""Gets the mean of peak EVMs for a QPSK signal. This value is expressed as a percentage. This value is obtained by
averaging the peak EVMs over all averaging acquisitions. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The EVM of a chip is the magnitude of the vector difference between the received chip and the ideal chip. The
peak EVM is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of peak EVMs for a QPSK signal. This value is expressed as a percentage. This value is obtained by
averaging the peak EVMs over all averaging acquisitions. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MEAN_PEAK_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_peak_evm(self, selector_string):
r"""Gets the maximum value of the peak EVMs for a QPSK signal. This value is expressed as a percentage. This value is
obtained over all averaging iterations.
The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The EVM of a chip is the magnitude of the vector difference between the received chip and the ideal chip. The
peak EVM is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the peak EVMs for a QPSK signal. This value is expressed as a percentage. This value is
obtained over all averaging iterations.
The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MAXIMUM_PEAK_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_magnitude_error(self, selector_string):
r"""Gets the mean of RMS magnitude errors for a QPSK signal. This value is expressed as a percentage.
This value is obtained by averaging the RMS magnitude errors over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The magnitude error of a chip is the difference in the magnitudes of the received chip and the ideal chip. The
RMS magnitude error is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of RMS magnitude errors for a QPSK signal. This value is expressed as a percentage.
This value is obtained by averaging the RMS magnitude errors over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
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.QEVM_RESULTS_MEAN_MAGNITUDE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_magnitude_error(self, selector_string):
r"""Gets the maximum value of the RMS magnitude errors for a QPSK signal. This value is expressed as a percentage. This
value is obtained over all averaging iterations. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The magnitude error of a chip is the difference in the magnitudes of the received chip and the ideal chip. The
RMS magnitude error is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the RMS magnitude errors for a QPSK signal. This value is expressed as a percentage. This
value is obtained over all averaging iterations. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MAXIMUM_MAGNITUDE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_phase_error(self, selector_string):
r"""Gets the mean of the RMS phase error values for a QPSK signal. This value is expressed as a percentage.
This value is obtained by averaging the RMS phase errors obtained over all averaging acquisitions. The number
of acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The phase error of a chip is the difference in the phases of the received chip and the ideal chip. The RMS
phase error is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of the RMS phase error values for a QPSK signal. This value is expressed as a percentage.
This value is obtained by averaging the RMS phase errors obtained over all averaging acquisitions. The number
of acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
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.QEVM_RESULTS_MEAN_PHASE_ERROR.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_phase_error(self, selector_string):
r"""Gets the maximum value of the RMS phase errors for a QPSK signal. This value is expressed in degrees. This value is
obtained over all averaging iterations. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The phase error of a chip is the difference in the phases of the received chip and the ideal chip. The RMS
phase error is obtained from all the chips in the measurement interval.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the RMS phase errors for a QPSK signal. This value is expressed in degrees. This value is
obtained over all averaging iterations. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MAXIMUM_PHASE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_frequency_error(self, selector_string):
r"""Gets the mean of the frequency errors for a QPSK signal. This value is expressed in Hz.
This value is obtained by the mean of frequency errors obtained over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The frequency error is the estimated difference between the carrier frequency of the received signal and the
ideal signal.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of the frequency errors for a QPSK signal. This value is expressed in Hz.
This value is obtained by the mean of frequency errors obtained over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
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.QEVM_RESULTS_MEAN_FREQUENCY_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_frequency_error(self, selector_string):
r"""Gets the maximum value of the frequency errors for a QPSK signal. This value is expressed in Hz.
This value is obtained over all averaging iterations. The number of acquisitions is specified by the value of
the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The frequency error is the estimated difference between the carrier frequency of the received signal and the ideal
signal.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the frequency errors for a QPSK signal. This value is expressed in Hz.
This value is obtained over all averaging iterations. The number of acquisitions is specified by the value of
the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MAXIMUM_FREQUENCY_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_iq_origin_offset(self, selector_string):
r"""Gets the mean of I/Q origin offsets for a QPSK signal. This value is expressed in dB.
This value is obtained by averaging the I/Q origin offsets over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The I/Q origin offset is a measure of the DC component present in the I/Q signal being measured.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of I/Q origin offsets for a QPSK signal. This value is expressed in dB.
This value is obtained by averaging the I/Q origin offsets over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
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.QEVM_RESULTS_MEAN_IQ_ORIGIN_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_iq_origin_offset(self, selector_string):
r"""Gets the maximum value of the I/Q origin offsets for a QPSK signal. This value is expressed in dB.
This value is obtained over all averaging iterations. The number of acquisitions is specified by the value of
the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The I/Q Origin Offset is the amount of DC component present in the I/Q signal being measured.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value of the I/Q origin offsets for a QPSK signal. This value is expressed in dB.
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.QEVM_RESULTS_MAXIMUM_IQ_ORIGIN_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_mean_chip_rate_error(self, selector_string):
r"""Gets the mean of the chip rate errors for a QPSK signal. This value is expressed in ppm. This value is obtained by
averaging the chip rate errors over all averaging acquisitions. The number of acquisitions is specified by the value of
the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The chip rate error is the estimated error between the chip clock rate of the transmitted signal and the chip
clock rate at the receiver.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the mean of the chip rate errors for a QPSK signal. This value is expressed in ppm. This value is obtained by
averaging the chip rate errors over all averaging acquisitions. The number of acquisitions is specified by the value of
the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
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.QEVM_RESULTS_MEAN_CHIP_RATE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_maximum_chip_rate_error(self, selector_string):
r"""Gets the maximum chip rate error value for a QPSK signal. This value is expressed in ppm. This value is obtained
over all averaging iterations.
The number of acquisitions is specified by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The chip rate error is the estimated error between the chip clock rate of the transmitted signal and the chip
clock rate at the receiver.
You do not need to use a selector string to read this result for default signal and result 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 and results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum chip rate error value for a QPSK signal. This value is expressed in ppm. This value is obtained
over all averaging iterations.
The number of acquisitions is specified by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
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.QEVM_RESULTS_MAXIMUM_CHIP_RATE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def fetch_evm(self, selector_string, timeout):
r"""Fetches the mean chip rate error, mean frequency error, mean RMS EVM, maximum peak EVM, mean magnitude error, and mean
phase error of the complex chips of the corrected signal for the QEVM measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name.
Example:
"result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed
in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_rms_evm, maximum_peak_evm, mean_frequency_error, mean_magnitude_error, mean_phase_error, mean_chip_rate_error, error_code):
mean_rms_evm (float):
This parameter returns the mean of the RMS EVM values for a QPSK signal. This value is obtained by averaging the RMS
EVMs over all averaging iterations. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute. This value is expressed as a
percentage.
The EVM of a chip is the magnitude of the vector difference between the received chip and the ideal chip. The
RMS EVM is obtained from all the chips in the measurement interval.
maximum_peak_evm (float):
This parameter returns the maximum value of the peak EVMs for a QPSK signal. This value is expressed as a percentage.
This value is obtained over all averaging iterations.
The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The EVM of a chip is the magnitude of the vector difference between the received chip and the ideal chip. The
peak EVM is obtained from all the chips in the measurement interval.
mean_frequency_error (float):
This parameter returns the mean of the frequency errors for a QPSK signal. This value is expressed in Hz.
This value is obtained by the mean of frequency errors obtained over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The frequency error is the estimated difference between the carrier frequency of the received signal and the
ideal signal.
mean_magnitude_error (float):
This parameter returns the mean of RMS magnitude errors for a QPSK signal. This value is expressed as a percentage.
This value is obtained by averaging the RMS magnitude errors over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The magnitude error of a chip is the difference in the magnitudes of the received chip and the ideal chip. The
RMS magnitude error is obtained from all the chips in the measurement interval.
mean_phase_error (float):
This parameter returns the mean of the RMS phase error values for a QPSK signal. This value is expressed as a
percentage.
This value is obtained by averaging the RMS phase errors obtained over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
The phase error of a chip is the difference in the phases of the received chip and the ideal chip. The RMS
phase error is obtained from all the chips in the measurement interval.
mean_chip_rate_error (float):
This parameter returns the mean of the chip rate errors for a QPSK signal. This value is expressed in ppm. This value
is obtained by averaging the chip rate errors over all averaging acquisitions. The number of acquisitions is specified
by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The chip rate error is the estimated error between the chip clock rate of the transmitted signal and the chip
clock rate at the receiver.
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
)
(
mean_rms_evm,
maximum_peak_evm,
mean_frequency_error,
mean_magnitude_error,
mean_phase_error,
mean_chip_rate_error,
error_code,
) = self._interpreter.qevm_fetch_evm(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
mean_rms_evm,
maximum_peak_evm,
mean_frequency_error,
mean_magnitude_error,
mean_phase_error,
mean_chip_rate_error,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_iq_impairments(self, selector_string, timeout):
r"""Fetches the mean and maximum I/Q origin offsets, I/Q gain imbalances, and I/Q quadrature errors for the QEVM
measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of the signal name and result
name.
Example:
"result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed
in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (mean_iq_origin_offset, mean_iq_gain_imbalance, mean_iq_quadrature_error, maximum_iq_origin_offset, maximum_iq_gain_imbalance, maximum_iq_quadrature_error, error_code):
mean_iq_origin_offset (float):
This parameter returns the mean of I/Q origin offsets for a QPSK signal. This value is expressed in dB.
This value is obtained by averaging the I/Q origin offsets over all averaging acquisitions. The number of acquisitions
is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The I/Q origin offset is a measure of the DC component present in the I/Q signal being measured.
mean_iq_gain_imbalance (float):
This parameter returns the mean of the I/Q gain imbalances for a QPSK signal. This value is expressed in dB.
This value is obtained by the I/Q gain imbalances obtained over all averaging acquisitions. The number of acquisitions
is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The I/Q gain imbalance is the ratio of the magnitude of the I component to the Q component of the I/Q signal being
measured. This result is for future use.
mean_iq_quadrature_error (float):
This parameter returns the mean of the I/Q quadrature errors for a QPSK signal. This value is expressed in degrees.
This value is obtained by the mean of I/Q quadrature errors obtained over all averaging acquisitions. The number of
acquisitions is specified by the value of the :py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT`
attribute.
Quadrature error is a measure of the error in the phase between I and Q components of the signal being measured. This
result is for future use.
maximum_iq_origin_offset (float):
This parameter returns the maximum I/Q origin offset for a QPSK signal. This value is expressed in dB.
maximum_iq_gain_imbalance (float):
This parameter returns the maximum value of I/Q gain imbalances for a QPSK signal. This value is expressed in dB. This
value is obtained over all averaging iterations. The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
The I/Q gain imbalance is the ratio of the magnitude of the I component to the Q component of the I/Q signal being
measured. This result is for future use.
maximum_iq_quadrature_error (float):
This parameter returns the maximum value of I/Q quadrature errors for a QPSK signal. This value is expressed in
degrees. This value is obtained over all averaging iterations.
The number of acquisitions is specified by the value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.QEVM_AVERAGING_COUNT` attribute.
Quadrature error is a measure of the error in the phase between I and Q components of the signal being measured. This
result is for future use.
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
)
(
mean_iq_origin_offset,
mean_iq_gain_imbalance,
mean_iq_quadrature_error,
maximum_iq_origin_offset,
maximum_iq_gain_imbalance,
maximum_iq_quadrature_error,
error_code,
) = self._interpreter.qevm_fetch_iq_impairments(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
mean_iq_origin_offset,
mean_iq_gain_imbalance,
mean_iq_quadrature_error,
maximum_iq_origin_offset,
maximum_iq_gain_imbalance,
maximum_iq_quadrature_error,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_evm_trace(self, selector_string, timeout, evm):
r"""Fetches the EVM trace for the QEVM measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of the signal name and result
name.
Example:
"result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed
in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
evm (numpy.float32):
This parameter returns the EVM value. This value is expressed as a percentage.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter returns the start time. This value is expressed in seconds.
dx (float):
This parameter returns the chip duration. 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()
_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.qevm_fetch_evm_trace(
updated_selector_string, timeout, evm
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code
[docs]
@_raise_if_disposed
def fetch_constellation_trace(self, selector_string, timeout, constellation):
r"""Fetches the complex chips of the composite corrected signal for the QEVM measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of the signal name and result
name.
Example:
"result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed
in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
constellation (numpy.complex64):
This parameter returns an array of complex chips of the QPSK corrected signal for the last acquisition. You can use
these chips to obtain the constellation diagram.
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.qevm_fetch_constellation_trace(
updated_selector_string, timeout, constellation
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def fetch_magnitude_error_trace(self, selector_string, timeout, magnitude_error):
r"""Fetches the magnitude error trace for the QEVM measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of the signal name and result
name.
Example:
"result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed
in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
magnitude_error (numpy.float32):
This parameter returns the magnitude error values. This value is expressed as a percentage.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter returns the start time. This value is expressed in seconds.
dx (float):
This parameter returns the chip duration. 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()
_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.qevm_fetch_magnitude_error_trace(
updated_selector_string, timeout, magnitude_error
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code
[docs]
@_raise_if_disposed
def fetch_phase_error_trace(self, selector_string, timeout, phase_error):
r"""Fetches the phase error trace for the QEVM measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of the signal name and result
name.
Example:
"result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the time for which the method waits for the measurement to complete. This value is expressed
in seconds. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
phase_error (numpy.float32):
This parameter returns an array of phase error values. This value is expressed in degrees.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter returns the start time. This value is expressed in seconds.
dx (float):
This parameter returns the chip duration. 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()
_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.qevm_fetch_phase_error_trace(
updated_selector_string, timeout, phase_error
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code