ProminenceRatio#
- class ansys.sound.core.psychoacoustics.ProminenceRatio(psd=None, frequency_list=None)#
Computes the ECMA 418-1/ISO 7779 prominence ratio (PR).
This class computes the PR on a power spectral density (PSD) following the ECMA 418-1 and ISO 7779 standards.
Class instantiation takes the following parameters.
- Parameters:
- psd
Field
PSD of the signal to compute PR on as a DPF field. The PSD field has the following characteristics:
num_entities
= 1location
= “TimeFreq_sets”data
: Vector of amplitude values in unit^2/Hztime_freq_support
: Vector of regularly spaced frequencies in Hz associated withamplitude values (from 0 Hz to the maximum frequency)
unit
= “<unit>^2/Hz” (where <unit> is Pa for example).
You can use the
ansys.dpf.core.fields_factory.create_scalar_field()
function to create the field.- frequency_list
list
, default:None
List of the frequencies in Hz of the tones (peaks in the spectrum) to calculate the PR on. The default is
None
, in which case a peak detection method is applied to automatically find the tones in the input spectrum. Then, the PR is calculated for each detected tone.
- psd
Methods
Convert a DPF fields container to a NumPy array.
Get the vector of the peaks' PR values.
Get the maximum PR value.
Get the number of tones.
Get PR data in a tuple as a generic data container.
Get PR data in a tuple as a NumPy array.
Get the vector of the peaks' frequencies.
Get the vector of the peaks' higher-frequency limits.
Get the vector of the peaks' level values.
Get the vector of the peaks' lower-frequency limits.
Get a reference curve to compare the PR with.
ProminenceRatio.get_single_tone_info
(tone_index)Get the PR information for a tone.
Plot the PR for all identified peaks, along with the reference curve.
Compute the PR.
Attributes
Tone frequency list in Hz.
Input power spectral density (PSD) as a DPF field.