Programmer Guide/Command Reference/EVAL/hz2bark: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE: | {{DISPLAYTITLE:hz2bark, bark2hz}} | ||
Convert all elements of ''x'' from Hertz to Bark and vice versa. | |||
;Usage: '''<code>hz2bark(<var>x</var>)</code> | |||
:'''<code>bark2hz(<var>x</var>)</code> | |||
:;<var>x</var>: a scalar, vector or matrix | |||
;Result: The result ''r'' has the same type as ''x'' and contains the converted elements of ''x''. | |||
:;'''hz2bark''': Uses the algorithm published by Zwicker and Fastl (1990) to convert frequencies from Hz to Bark: | |||
::''r''<sub>i,j</sub> = 13 * atan(0.76*''x''<sub>i,j</sub>/1000) + 3.5 * atan((''x''<sub>i,j</sub>/7500)^2) | |||
:;'''bark2hz''': Because the above formula is not directly invertable, an iteration algorithm is used to convert the ''x''<sub>i,j</sub> from Bark to the result ''r''<sub>i,j</sub> in Hz. | |||
''fac'' * log<sub>10</sub>(''x''<sub>i,j</sub> / ''ref'') | |||
::*'''log2lin''': ''r''<sub>i,j</sub> = ''ref'' * 10 ^ (''x''<sub>i,j</sub> / ''fac'') | |||
:Note: Both functions are also available in the expressions used in the [[Programmer_Guide/Command_Reference/NUM|NUM]] and [[Programmer_Guide/Command_Reference/INT|INT]] command. | |||
;See also: [[Programmer_Guide/Command_Reference/EVAL/hz2mel|hz2mel, mel2hz]], [[Programmer_Guide/Command_Reference/EVAL/hz2erb|hz2erb, erb2hz]], [[Programmer_Guide/Command_Reference/EVAL/hth|hth]], [[Programmer_Guide/Command_Reference/EVAL/lin2log|lin2log, log2lin]] | |||
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] |
Revision as of 15:05, 6 April 2011
Convert all elements of x from Hertz to Bark and vice versa.
- Usage
hz2bark(x)
bark2hz(x)
- x
- a scalar, vector or matrix
- Result
- The result r has the same type as x and contains the converted elements of x.
- hz2bark
- Uses the algorithm published by Zwicker and Fastl (1990) to convert frequencies from Hz to Bark:
- ri,j = 13 * atan(0.76*xi,j/1000) + 3.5 * atan((xi,j/7500)^2)
- bark2hz
- Because the above formula is not directly invertable, an iteration algorithm is used to convert the xi,j from Bark to the result ri,j in Hz.
fac * log10(xi,j / ref)
- log2lin: ri,j = ref * 10 ^ (xi,j / fac)
- Note: Both functions are also available in the expressions used in the NUM and INT command.
- See also
- hz2mel, mel2hz, hz2erb, erb2hz, hth, lin2log, log2lin