HarmResults

Provides methods to fetch and read the Harm measurement results.

class nirfmxspecan.harm_results.HarmResults(signal_obj)[source]

Bases: object

Provides methods to fetch and read the Harm measurement results.

fetch_harmonic_measurement(selector_string, timeout)[source]

Returns the power measured at the harmonic frequency. Use “harmonic<n>” as the selector channel string to read results from this method.

Parameters:
  • selector_string (string) –

    This parameter specifies a Selector String comprising of result name, and harmonic number.

    Example:

    ”harmonic0”

    ”result::r1/harmonic0”

    You can use the build_harmonic_string() method to build the selector string.

  • timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.

Returns:

average_relative_power (float):

This parameter returns the average power, in dB, relative to the fundamental power measured at the harmonic.

average_absolute_power (float):

This parameter returns the average absolute power, in dBm, measured at the harmonic.

rbw (float):

This parameter returns the resolution bandwidth (RBW), in Hz, which is used by the harmonic measurement, for the harmonic.

frequency (float):

This parameter returns the RF frequency, in Hz, of the harmonic.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (average_relative_power, average_absolute_power, rbw, frequency, error_code)

fetch_harmonic_measurement_array(selector_string, timeout)[source]

Returns the array of powers measured at the harmonic frequency.

Parameters:
  • selector_string (string) –

    This parameter specifies a Selector String comprising of result name.

    Example:

    ””

    ”result::r1”

    You can use the build_result_string() method to build the selector string.

  • timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.

Returns:

average_relative_power (float):

This parameter returns the array of average powers, in dB, relative to the fundamental power measured at each harmonic.

average_absolute_power (float):

This parameter returns the array of average absolute powers, in dBm, measured at each harmonic.

rbw (float):

This parameter returns the array of resolution bandwidths (RBW), in Hz, which is used by the harmonic measurement, for each harmonic.

frequency (float):

This parameter returns the array of frequencies, in Hz, of each harmonic.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (average_relative_power, average_absolute_power, rbw, frequency, error_code)

fetch_harmonic_power_trace(selector_string, timeout, power)[source]

Fetches the power trace for the harmonics measurement. Use “harmonic<n>” as the selector string to read results from this method.

Parameters:
  • selector_string (string) –

    This parameter specifies a Selector String comprising of result name, and harmonic number.

    Example:

    ”harmonic0”

    ”result::r1/harmonic0”

    You can use the build_harmonic_string() method to build the selector string.

  • timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.

  • power (numpy.float32) – This parameter returns the measured average power, in units specified by POWER_UNITS attribute, at each time instance.

Returns:

x0 (float):

This parameter returns the start time, in seconds.

dx (float):

This parameter returns the sample duration, in seconds.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (x0, dx, error_code)

fetch_total_harmonic_distortion(selector_string, timeout)[source]

Returns the total harmonics distortion (THD), measured as a percentage of the power in the fundamental signal.

Parameters:
  • selector_string (string) –

    This parameter specifies a Selector String comprising of result name.

    Example:

    ””

    ”result::r1”

    You can use the build_result_string() method to build the selector string.

  • timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.

Returns:

total_harmonic_distortion (float):

This parameter returns the total harmonics distortion (THD), measured as a percentage of the power in the fundamental signal. THD calculation involves only the harmonics that are enabled.

THD (%) = SQRT (Total power of all enabled harmonics - Power in fundamental) * 100 / Power in fundamental.

average_fundamental_power (float):

This parameter returns the average power, in dBm, measured at the fundamental frequency.

fundamental_frequency (float):

This parameter returns the frequency, in Hz, used as the fundamental frequency.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (total_harmonic_distortion, average_fundamental_power, fundamental_frequency, error_code)

get_average_fundamental_power(selector_string)[source]

Gets the average power measured at the fundamental frequency. This value is expressed in dBm.

You do not need to use a selector string to read this result for default signal and result instance. Refer to the Selector String topic for information about the string syntax for named signals and results.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the average power measured at the fundamental frequency. This value is expressed in dBm.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (attr_val, error_code)

get_fundamental_frequency(selector_string)[source]

Gets the frequency used as the fundamental frequency. 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 topic for information about the string syntax for named signals.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the frequency used as the fundamental frequency. 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.

Return type:

Tuple (attr_val, error_code)

get_harmonic_average_absolute_power(selector_string)[source]

Gets the average absolute power measured at the harmonic specified by the selector string. This value is expressed in dBm.

Use “harmonic<n>” as the Selector String to read this result.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the average absolute power measured at the harmonic specified by the selector string. This value is expressed in dBm.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (attr_val, error_code)

get_harmonic_average_relative_power(selector_string)[source]

Gets the average power relative to the fundamental power measured at the harmonic specified by the selector string. This value is expressed in dB.

Use “harmonic<n>” as the Selector String to read this result.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the average power relative to the fundamental power measured at the harmonic specified by the selector string. 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.

Return type:

Tuple (attr_val, error_code)

get_harmonic_frequency(selector_string)[source]

Gets the RF frequency of the harmonic. This value is expressed in Hz.

Use “harmonic<n>” as the Selector String to read this result.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the RF frequency of the harmonic. 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.

Return type:

Tuple (attr_val, error_code)

get_harmonic_rbw(selector_string)[source]

Gets the resolution bandwidth (RBW) which is used by the harmonic measurement, for the harmonic specified by the selector string. This value is expressed in Hz.

Use “harmonic<n>” as the Selector String to read this result.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the resolution bandwidth (RBW) which is used by the harmonic measurement, for the harmonic specified by the selector string. 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.

Return type:

Tuple (attr_val, error_code)

get_total_harmonic_distortion(selector_string)[source]

Gets the total harmonics distortion (THD), measured as a percentage of the power in the fundamental signal.

THD (%) = SQRT (Total power of all enabled harmonics - Power in fundamental) * 100 / Power in fundamental

You do not need to use a selector string to read this result for default signal and result instance. Refer to the Selector String topic for information about the string syntax for named signals and results.

Parameters:

selector_string (string) – Pass an empty string.

Returns:

attr_val (float):

Returns the total harmonics distortion (THD), measured as a percentage of the power in the fundamental signal.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (attr_val, error_code)

read(selector_string, timeout)[source]

Configures hardware for acquisition, performs measurement on acquired data, and returns Harmonics measurement results.

Parameters:
  • selector_string (string) – Pass an empty string. The signal name that is passed when creating the signal configuration is used.

  • timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. The default value is 10.

Returns:

total_harmonic_distortion (float):

This parameter returns the total harmonics distortion (THD), measured as a percentage of the power in the fundamental signal. THD calculation involves only the harmonics that are enabled.

THD (%) = SQRT (Total power of all enabled harmonics - Power in fundamental) * 100 / Power in fundamental.

average_fundamental_power (float):

This parameter returns the average power, in dBm, measured at the fundamental frequency.

error_code (int):

Returns the status code of this method. The status code either indicates success or describes a warning condition.

Return type:

Tuple (total_harmonic_distortion, average_fundamental_power, error_code)