pytimbre.utilities.acoustic_weights.AcousticWeights

class pytimbre.utilities.acoustic_weights.AcousticWeights

Bases: object

This class contains a number of calculations for various community noise metrics that are useful for a variety of calculations across the study of acoustics.

FSM - the math module was replaced with references to the numpy module to facilitate use with numpy arrays and the pandas DataFrame objects

__init__()

Methods

__init__()

a_weighting_weights(frequency)

Given a frequency, determine the A-weighted correction for the acoustic level

c_weighting_weights(frequency)

Given a frequency, determine the C-weighted correction for the acoustic level

calculate_boominess(loudness_spectrum)

Calculates the Booming Index as described by Hatano, S., and Hashimoto, T.

inverse_log_base_10(x)

Determine the inverse log10, or 10**x

la(spl, frequency)

Compute the A-weighted acoustic level across the level array

lc(spl, frequency)

Compute the A-weighted acoustic level across the level array

lf(spl)

Compute the equal weighted acoustic level across the level array

perceived_noise_level(sound_pressure_level)

Determine the single number perceived noise level (PNL) based on the conversion from dB to Noys

tone_correction(sound_pressure_levels)

static a_weighting_weights(frequency)

Given a frequency, determine the A-weighted correction for the acoustic level

frequencydouble, possible array-like

the number of cycles per second to calculate the weight at

static c_weighting_weights(frequency)

Given a frequency, determine the C-weighted correction for the acoustic level

frequencydouble, possible array-like

the number of cycles per second to calculate the weight at

static calculate_boominess(loudness_spectrum)

Calculates the Booming Index as described by Hatano, S., and Hashimoto, T. “Booming index as a measure for evaluating booming sensation”, The 29th International congress and Exhibition on Noise Control Engineering, 2000.

Parameters:

loudness_spectrum – The spectrum that is converted to the loudness spectrum rather than the one-third-octave band

Returns:

Single value for the waveform that was processed to represent the boominess of the signal.

static inverse_log_base_10(x)

Determine the inverse log10, or 10**x

static la(spl, frequency)

Compute the A-weighted acoustic level across the level array

spldouble, array-like

the sound pressure levels across a specific frequency array

frequencydouble, array-like

the array of frequencies to calculate the weighting

returndouble

the overall acoustic level with equal weighting

static lc(spl, frequency)

Compute the A-weighted acoustic level across the level array

spldouble, array-like

the sound pressure levels across a specific frequency array

frequencydouble, array-like

the array of frequencies to calculate the weighting

returndouble

the overall acoustic level with equal weighting

static lf(spl)

Compute the equal weighted acoustic level across the level array

spldouble, array-like

the sound pressure levels across a specific frequency array. The frequencies are not provided for this function because there is an equal weighting across all frequencies.

returndouble

the overall acoustic level with equal weighting

static perceived_noise_level(sound_pressure_level)

Determine the single number perceived noise level (PNL) based on the conversion from dB to Noys

dSPLdouble, array-like

the sound pressure levels from 10 Hz to 10 kHz

returnsdouble

returns the perceived noise level in NOYS

Remarks: 2022-12-13 - FSM - Changed the end of the code to ensure that there is a non-infinite results when the sume of

the levels is zero because the level is too quiet.