LoudnessModel:
Filter:
Classes (extension) | DissonanceLib

LoudnessModel
ExtensionExtension

Not yet written
Location: NOT INSTALLED!

Description

A class made for calculating loudness from Equal Loudness contours (also known as Fletcher/Mundson curves). It also has class methods for calculating masking and audibility.

The best way to use it is with convenience methods from number extras such as phonToSone, soneToPhon, asPhon, asSone and asDynamic. See below.

On its own Usage: LoudnessModel.calc(freq, spl) returns the phon value for a certain frequency in Hz and intensity in dB SPL.

Class Methods

Inherited class methods

Instance Methods

Inherited instance methods

Examples

phonToSone

Convert from phons to sones. http://en.wikipedia.org/wiki/Phon

soneToPhon

Convert sones to phons. http://en.wikipedia.org/wiki/Sone

asPhon(spl, calib = 0)

Return the value in phons for a frequency at a certain db SPL level. Calib should be 0 if loudness is in dB SPL; a positive number if the values are in dBFS (dB's with respect to a full scale sine wave); or negative dB's relative to 0 which is the case when translating from amplitude value to dB with ampdb.

asSone(spl, calib = 0)

Return the value in sons for a frequency at a certain db SPL level. Calib should be 0 if loudness is in dB SPL; a positive number if the values are in dBFS (dB's with respect to a full scale sine wave); or negative dB's relative to 0 which is the case when translating from amplitude value to dB with ampdb.

asDynamic(freq, ref = 100, fff = 3)

Returns a symbol expressing the dynamic value (ppp-fff) of an amplitude and frequency. The number should be an amplitude; it is converted to dBFS, then phon, sone and musical dynamics. The reference value is 100, which assumes that the amplitude value of 1.0 at 1000Hz will translate to 64 sones, equivalent to fff (see also LoudnessModel).

The upper boundary for sones is 64 because equal loudness contours stop at 100 phons. The fff argument is there to adjust how many f's correspond to 64 sones. The default of 3 is subtracted from 6, which is the power of two of 64, yielding 3f's. If it is less than 3, more f's will correspond to that maximum dynamic.

According to one's needs, values can go from, say, ppppp-fffff.

Examples:

For arrays of amps and freqs, you can use an array (of the same size as the amp array) for the freq arg:

Masking

The following methods work with arrays of pairs of frecuencies and intensities [freq, spl]:

asPhon

Return the values in phons of arrays of [freq, spl] pairs.

asSone

Return the values in sones of arrays of [freq, spl] pairs.

compensateMasking(gradient = 12)

Returns the amplitudes of partials after masking.

Values are input as arrays of [spl, freq] pairs.