scamp_extensions.pitch.utilities.freq_to_bark

scamp_extensions.pitch.utilities.freq_to_bark(f: Real) Real[source]

Converts a frequency in hertz to a (floating point) Bark number according to the psychoacoustic Bark scale (https://en.wikipedia.org/wiki/Bark_scale). This is a scale that compensates for the unevenness in human pitch acuity across our range of hearing. Here we use the function approximation proposed by Terhardt, which was chosen in part for its ease of inverse calculation. The first argument can optionally be a list, tuple, or iterator, in which case this is performed on each element.

Parameters:

f – the input frequency