OverallLevelFromPSD#

class ansys.sound.core.standard_levels.OverallLevelFromPSD(psd=None, scale='dB', reference_value=1.0, frequency_weighting='')#

Compute the overall level from a power spectral density (PSD) input.

This class computes the overall level from a PSD, on a decibel scale or a linear, root-mean-square (RMS) scale.

Examples

Compute the overall level from a PSD.

>>> from ansys.sound.core.standard_levels import OverallLevelFromPSD
>>> level = OverallLevelFromPSD(psd=my_psd, reference_value=2e-5)
>>> level.process()
>>> level_dB = level.get_level()

Added in DPF Sound plugin version 2027.1.0.

Class instantiation takes the following parameters.

Parameters:
psdField, default: None

The input power spectral density (PSD), in unit^2/Hz.

scalestr, default: “dB”

The scale type of the output level. Available options are “dB” and “RMS”.

reference_valuefloat, default: 1.0

The reference value for the level computation. If the PSD is computed from a signal in Pa, the reference value should be 2e-5 (Pa).

frequency_weightingstr, default: “”

The frequency weighting to apply before computing the level. Available options are “”, “A”, “B”, and “C”, respectively to get level in dB (or dBSPL), dBA, dBB, and dBC. Note that the frequency weighting is only applied if the attribute scale is set to “dB”.

Methods

OverallLevelFromPSD.get_level()

Return the overall level.

OverallLevelFromPSD.get_output()

Return the overall level.

OverallLevelFromPSD.get_output_as_nparray()

Return the overall level as a numpy array.

OverallLevelFromPSD.plot()

Plot the output.

OverallLevelFromPSD.process()

Compute the overall level from the PSD.

Attributes

OverallLevelFromPSD.frequency_weighting

Frequency weighting of the computed level.

OverallLevelFromPSD.psd

Input power spectral density (PSD).

OverallLevelFromPSD.reference_value

Reference value for the level computation.

OverallLevelFromPSD.scale

Scale type of the output level.