psychoacoustics.erb_scale
La referencia de la API se publica en inglés en los dos idiomas: se genera a partir de los docstrings del código, que son su texto original.
The ERB_N scale: auditory-filter bandwidth and the Cam frequency scale.
The cochlea behaves as a bank of overlapping band-pass auditory filters.
The width of the filter centred on a given frequency is summarised by its
equivalent rectangular bandwidth ERB_N: the bandwidth of the
rectangular filter that passes the same power and has the same peak response.
Glasberg and Moore (1990), fitting notched-noise data for young listeners at
moderate levels, give it as a straight line in frequency (Moore, An
Introduction to the Psychology of Hearing 6th ed., p. 76):
Integrating turns that into a frequency scale whose unit is one auditory-filter width, the ERB_N number, whose unit is called the Cam (after Cambridge, following a suggestion by Hartmann):
The Cam scale plays the same role as the Bark scale of Zwicker and Terhardt or
the mel scale of pitch: it is the axis on which masking patterns, excitation
patterns and specific loudness are naturally expressed. It differs from Bark
numerically, mostly below 500 Hz where the “old” critical-band function
flattens out but direct measurements show ERB_N continuing to shrink.
This module states the constants to the precision used by the ISO 532-2
implementation of the Moore-Glasberg loudness model
(phonometry.psychoacoustics.loudness.moore_glasberg), which shares
them:
They are the same fit written with one more digit: the two forms agree to
better than 0.2 % over the whole audible range. The extra digits matter for
the round trip through frequency_from_cam, and they are what reproduce
the check value Moore prints on p. 77, that 1000 Hz corresponds to 15.59 Cam
(the two-significant-digit constants give 15.62).
Reference: Glasberg, B. R. and Moore, B. C. J. (1990), “Derivation of auditory filter shapes from notched-noise data”, Hearing Research 47, 103-138.
Auto-generated from the source docstrings by
scripts/generate_api_docs.py(make api-docs). Do not edit by hand.
Constant (float).
CAM_C = 21.366cam_from_frequency
Section titled “cam_from_frequency”cam_from_frequency( frequency: float | np.floating[Any] | np.integer[Any],) -> float
cam_from_frequency( frequency: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],) -> NDArray[np.float64]
cam_from_frequency( frequency: NumericArrayLike,) -> float | NDArray[np.float64]ERB_N number (Cam) of a frequency.
(Glasberg and Moore 1990;
Moore 6th ed., p. 76, printed there as
for F in kHz).
One Cam is one auditory-filter width.
Parameters
| Name | Description |
|---|---|
frequency |
Frequency f, Hz (scalar or array, non-negative). |
Returns: The ERB_N number, Cam; a float for a number; an array for a sequence or an array, a zero-dimensional one included.
Raises
| Exception | When |
|---|---|
| TypeError | if frequency holds a text or a value that is not a real number. |
erb_bandwidth
Section titled “erb_bandwidth”erb_bandwidth( frequency: float | np.floating[Any] | np.integer[Any],) -> float
erb_bandwidth( frequency: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],) -> NDArray[np.float64]
erb_bandwidth(frequency: NumericArrayLike) -> float | NDArray[np.float64]Equivalent rectangular bandwidth of the auditory filter, Hz.
(Glasberg and Moore
1990; Moore 6th ed., p. 76, printed there with the rounded constants
for F in kHz).
Parameters
| Name | Description |
|---|---|
frequency |
Filter centre frequency f, Hz (scalar or array, non-negative). |
Returns: The bandwidth ERB_N, Hz; a float for a number; an array for a sequence or an array, a zero-dimensional one included.
Raises
| Exception | When |
|---|---|
| TypeError | if frequency holds a text or a value that is not a real number. |
ERB_C1_HZ
Section titled “ERB_C1_HZ”Constant (float).
ERB_C1_HZ = 24.673ERB_C2_PER_HZ
Section titled “ERB_C2_PER_HZ”Constant (float).
ERB_C2_PER_HZ = 0.004368frequency_from_cam
Section titled “frequency_from_cam”frequency_from_cam(cam: float | np.floating[Any] | np.integer[Any]) -> float
frequency_from_cam( cam: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],) -> NDArray[np.float64]
frequency_from_cam(cam: NumericArrayLike) -> float | NDArray[np.float64]Frequency of an ERB_N number, the inverse of cam_from_frequency.
.
Parameters
| Name | Description |
|---|---|
cam |
ERB_N number i, Cam (scalar or array, non-negative). |
Returns: The frequency f, Hz; a float for a number; an array for a sequence or an array, a zero-dimensional one included.
Raises
| Exception | When |
|---|---|
| TypeError | if cam holds a text or a value that is not a real number. |