R/hz2bark.R

Defines functions hz2bark

Documented in hz2bark

# This code is based on the Matlab implementations of PLP and Rasta
# feature calculations by Daniel P. W. Ellis of Columbia University /
# International Computer Science Institute.  For more details, see:
# http://www.ee.columbia.edu/~dpwe/resources/matlab/rastamat/

hz2bark <- function(f){
    
    if(!is.numeric(f) || any(f < 0))
      stop("frequencies have to be non-negative")

    # Inverse of Hynek's formula (see bark2hz)
    6 * asinh(f/600)
}

Try the tuneR package in your browser

Any scripts or data that you put into this service are public.

tuneR documentation built on Nov. 27, 2023, 5:11 p.m.