mutwo.converters.symmetrical.loudness module

Calculate loudness from amplitude.

Classes:

LoudnessToAmplitudeConverter(...[, ...])

Make an approximation of the needed amplitude for a perceived Loudness.

class LoudnessToAmplitudeConverter(perceived_loudness_in_sone, loudspeaker_frequency_response=Envelope((80, 80), (2000,), (0,), 0), interpolation_order=4)[source]

Bases: mutwo.converters.abc.Converter

Make an approximation of the needed amplitude for a perceived Loudness.

Parameters
  • perceived_loudness_in_sone (Union[float, fractions.Fraction]) – The subjectively perceived loudness that the resulting signal shall have (in the unit Sone).

  • loudspeaker_frequency_response (expenvelope.envelope.Envelope) – Optionally the frequency response of the used loudspeaker can be added for balancing out uneven curves in the loudspeakers frequency response. The frequency response is defined with an expenvelope.Envelope object.

  • interpolation_order (int) – The interpolation order of the equal loudness contour interpolation.

The converter works best with pure sine waves.

Methods:

convert(frequency)

Calculates the needed amplitude to reach a particular loudness for the entered frequency.

convert(frequency)[source]

Calculates the needed amplitude to reach a particular loudness for the entered frequency.

Parameters

frequency (Union[float, fractions.Fraction]) – A frequency in Hertz for which the necessary amplitude shall be calculated.

Returns

Return the amplitude for a sine tone to reach the converters loudness when played with the entered frequency.

Return type

Union[float, fractions.Fraction]

Example:

>>> from mutwo.converters import symmetrical
>>> loudness_converter = symmetrical.loudness.LoudnessToAmplitudeConverter(1)
>>> loudness_converter.convert(200)
0.009364120303317933
>>> loudness_converter.convert(50)
0.15497924558613232