OrderLevels#

class ansys.sound.core.order_analysis.OrderLevels(signal=None, rpm_profile=None, orders=None, order_width=10.0, order_resolution=2.0)#

Compute order levels from a signal and its associated RPM profile.

This class analyzes a time-domain signal associated with its RPM profile to compute the levels over RPM of a specified list of orders. This is achieved with the following method:

  • Firstly, an RPM-order representation is computed by applying a short-time Fourier transform (STFT) to a resampled constant-angle version of the input signal, using the associated RPM profile;

  • Then, the specified order levels are extracted from this representation by integrating order energy over the user-specified width.

Two additional parameters allow you to refine the obtained result:

  • Order resolution (in percent of order): defines how fine the order definition is in the obtained RPM-order representation;

  • Order width (in percent of order): defines the width over which the representation energy is summed to produce an order level. It is expected that order width is greater or equal to order resolution.

Examples

>>> from ansys.sound.core import OrderLevels
>>> my_order_analysis = OrderLevels(
...     signal=my_signal,
...     rpm_profile=my_rpm_profile,
...     orders=[1, 2, 3]
... )
>>> my_order_analysis.process()
>>> order_levels = my_order_analysis.get_order_levels_dB(reference_value=2e-5)

Added in DPF Sound plugin version 2027.1.0.

Class instantiation takes the following parameters.

Parameters:
signalField, default: None

Input signal.

rpm_profileField, default: None

RPM profile associated with the input signal.

orderslist[float], default: None

List of orders at which to extract levels.

order_widthfloat, default: 10.0

Width in percent of order for the order level extraction. It defines the order range around each value in orders over which the energy is integrated to compute the order level.

order_resolutionfloat, default: 2.0

Order resolution in percent of order for the RPM-order representation computation. Note that reducing this value increases the RPM step between each RPM value where order levels are computed, and conversely. Note also that the actual order resolution of the computed RPM-order representation might slightly differ from the value specified here, because the number of order values in the representation must be a power of two.

Methods

OrderLevels.get_order_level_dB(order[, ...])

Get the level over RPM of a single order, in dB.

OrderLevels.get_order_level_squared_linear(order)

Get the level over RPM of a single order, in squared signal units.

OrderLevels.get_order_levels_dB([...])

Get the order levels, in dB.

OrderLevels.get_order_levels_squared_linear()

Get the order levels, in squared signal unit.

OrderLevels.get_output()

Get the order levels.

OrderLevels.get_output_as_nparray()

Get the order levels as NumPy arrays.

OrderLevels.get_rpm_scale()

Get the RPM scale associated with the order levels.

OrderLevels.plot([display_in_dB, ...])

Plot the order levels over RPM.

OrderLevels.process()

Run the order analysis with the parameters specified in this object.

OrderLevels.save_as_AnsysSound_Orders(filepath)

Save the computed order levels to a text file with AnsysSound_Orders header.

Attributes

OrderLevels.order_resolution

Order resolution, in percent of order.

OrderLevels.order_width

Order width in percent of order.

OrderLevels.orders

List of orders at which to extract levels.

OrderLevels.rpm_order_representation

RPM-order representation of the input signal.

OrderLevels.rpm_profile

RPM profile associated with signal.

OrderLevels.signal

Input signal.