OctaveLevelsFromSignal#

class ansys.sound.core.standard_levels.OctaveLevelsFromSignal(signal=None, reference_value=1.0, frequency_weighting='')#

Compute octave levels from a time-domain signal input.

This class computes octave levels from a time-domain signal.

Notes

For consistency with other Ansys Sound applications, octave-band levels are derived from one-third-octave levels, and frequency weighting is applied before the conversion. In other words, each octave-band level is obtained by summing the 3 one-third-octave levels within (in squared units), each weighted with the frequency weighting obtained at the one-third-octave-band center frequency. Note that the highest-frequency octave band (centered at 16000 Hz) is obtained by only summing the 2 highest one-third-octave bands (since the 30th one-third-octave band centered at 20000 Hz is not considered).

Added in DPF server version 11.0.

Class instantiation takes the following parameters.

Parameters:
signalField, default: None

The time-domain signal from which the levels are computed.

reference_valuefloat, default: 1.0

The reference value for the levels’ computation. If the levels are computed with a PSD in Pa^2/Hz, the reference value should be 2e-5 (Pa).

frequency_weightingstr, default: “”

The frequency weighting to apply to the signal before computing the levels. Available options are “”, “A”, “B”, and “C”, to get levels in dB (or dBSPL), dBA, dBB, and dBC, respectively.

Methods

OctaveLevelsFromSignal.convert_fields_container_to_np_array(fc)

Convert a DPF fields container to a NumPy array.

OctaveLevelsFromSignal.get_band_levels()

Return the band levels in dB as a numpy array.

OctaveLevelsFromSignal.get_center_frequencies()

Return the center frequencies in Hz of the band levels as a numpy array.

OctaveLevelsFromSignal.get_output()

Return the band levels in dB.

OctaveLevelsFromSignal.get_output_as_nparray()

Return the band levels in dB and center frequencies in Hz as a tuple of numpy arrays.

OctaveLevelsFromSignal.plot()

Plot the octave-band levels.

OctaveLevelsFromSignal.process()

Compute the octave-band levels.

Attributes

OctaveLevelsFromSignal.frequency_weighting

Frequency weighting of the computed levels.

OctaveLevelsFromSignal.reference_value

Reference value for the levels' computation.

OctaveLevelsFromSignal.signal

Input time-domain signal.