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:
psdField

PSD of the signal to compute PR on as a DPF field. The PSD field has the following characteristics:

  • num_entities = 1

  • location = “TimeFreq_sets”

  • data: Vector of amplitude values in unit^2/Hz

  • time_freq_support: Vector of regularly spaced frequencies in Hz associated with

    amplitude 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_listlist, 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.

Methods

ProminenceRatio.convert_fields_container_to_np_array(fc)

Convert a DPF fields container to a NumPy array.

ProminenceRatio.get_PR_values()

Get the vector of the peaks' PR values.

ProminenceRatio.get_max_PR_value()

Get the maximum PR value.

ProminenceRatio.get_nb_tones()

Get the number of tones.

ProminenceRatio.get_output()

Get PR data in a tuple as a generic data container.

ProminenceRatio.get_output_as_nparray()

Get PR data in a tuple as a NumPy array.

ProminenceRatio.get_peaks_frequencies()

Get the vector of the peaks' frequencies.

ProminenceRatio.get_peaks_high_frequencies()

Get the vector of the peaks' higher-frequency limits.

ProminenceRatio.get_peaks_levels()

Get the vector of the peaks' level values.

ProminenceRatio.get_peaks_low_frequencies()

Get the vector of the peaks' lower-frequency limits.

ProminenceRatio.get_reference_curve()

Get a reference curve to compare the PR with.

ProminenceRatio.get_single_tone_info(tone_index)

Get the PR information for a tone.

ProminenceRatio.plot()

Plot the PR for all identified peaks, along with the reference curve.

ProminenceRatio.process()

Compute the PR.

Attributes

ProminenceRatio.frequency_list

Tone frequency list in Hz.

ProminenceRatio.psd

Input power spectral density (PSD) as a DPF field.