Learn R Programming

seewave (version 1.4.3)

mel: Hertz / Mel conversion

Description

This function converts Hertz data in Mel data.

Usage

mel(x, inverse = FALSE)

Arguments

x
an R object.
inverse
if TRUE converts the mel data in hertz data.

Value

  • A corresponding R object is returned.

Details

Hertz to mel conversion is computed according to: $$m = 1127.01048 \times {\log{(1+(\frac{f}{700}))}}$$ with m in Mels and f in Hertz. Mel to Hertz conversion (when inverse is TRUE) is therefore computed according to: $$f = 700 \times{(e^{(\frac{m}{1127.01048}}-1})$$ with f in Hertz and m in Mels.

References

Stevens, S. S., Volkman, J. and Newman, E. B. 1937. A scale for the measurement of psychological magnitude pitch. Journal of the Acoustical Society of America, 8: 185-190.

Examples

Run this code
x<-seq(0,10000,by=50)
y<-mel(x)
plot(x,y,type="l",xlab = "f (hertz)", ylab = "f (mel)",
  main = "Mel scale", col="red")

Run the code above in your browser using DataLab