Main Content

bark2hz

Convert from Bark scale to hertz

Description

example

hz= bark2hz(bark)converts values on the Bark frequency scale to values in hertz.

Examples

collapse all

Set two bounding frequencies in Hz and then convert them to the Bark scale.

b = hz2bark([20,8000]);

Generate a row vector of 32 values uniformly spaced on the Bark scale.

barkVect = linspace(b(1),b(2),32);

Convert the row vector of values into equivalent frequencies in Hz.

hzVect = bark2hz(barkVect);

Plot the two vectors for comparison. As Bark values increase linearly, Hz values increase exponentially.

plot(barkVect,hzVect,'o') title('Bark vs Hz') xlabel('Bark') ylabel('Hz') gridon

Figure contains an axes object. The axes object with title Bark vs Hz contains an object of type line.

Input Arguments

collapse all

Input frequency on the Bark scale, specified as a scalar, vector, matrix, or multidimensional array.

Data Types:single|double

Output Arguments

collapse all

Output frequency in Hz, returned as a scalar, vector, matrix, or multidimensional array the same size asbark.

Data Types:single|double

Algorithms

The frequency conversion from the Bark scale to Hz uses the following formula:

i f : b a r k < 2 b a r k = ( b a r k 0.3 ) 0.85 i f : b a r k > 20.1 b a r k = ( b a r k + 4.422 ) 1.22 h z = 1960 ( b a r k + 0.53 26.28 b a r k )

The Bark value correction occurs before the conversion from the Bark scale to Hz.

References

[1] Traunmüller, Hartmut. "Analytical Expressions for the Tonotopic Sensory Scale."Journal of the Acoustical Society of America.Vol. 88, Issue 1, 1990, pp. 97–100.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

版本历史

Introduced in R2019a