Description Usage Arguments Value Note References Examples
Use bark()
to convert Hz into Barks. Use hz()
to convert Barks
back into Hz. Both of these functions are based on the formula provided
Traunmüller (1990).
1 2 3 |
x |
A number. |
The number transformed into Barks or Hz.
Because the Traunmüller's formula is not especially precise (especially because Zwicker's original scale was biased toward nice round numbers), there will inevitably be some rounding error. However, it is small enough that it should be of little consequence.
Traunmüller, Hartmut. "Auditory scales of frequency representation." The Journal of the Acoustical Society of America 88, no. 97 (1990). https://doi.org/10.1121/1.399849.
Zwicker, Eberhard. "Subdivision of the Audible Frequency Range into Critical Bands (Frequenzgruppen)." The Journal of the Acoustical Society of America 33, no. 2 (1961): 248–248. https://doi.org/10.1121/1.1908630.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # The simplest case is by converting one number.
bark(500)
hz(3)
# You can also convert a whole vector of numbers.
data(vowels)
head(bark(vowels$F1))
#' This is probably easier within a tidyverse pipeline
## Not run:
library(dplyr)
vowels %>%
select(vowel, F1:F4) %>%
mutate(F1_bark = bark(F1),
F2_bark = bark(F2),
F3_bark = bark(F3),
F4_bark = bark(F4))
# Or, more elegantly, using dplyr::across()
vowels %>%
select(vowel, F1:F4) %>%
mutate(across(F1:F4, bark, .names = "{col}_bark"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.