Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fftfreqconvmx

Internal: Convert FFT frequency bins to Bark/Mel bins


Description

Generate a matrix of weights to combine FFT bins into Bark/Mel bins.

Usage

fft2barkmx(nfft, sr = 8000, nfilts = NULL, width = 1, minfreq = 0, 
    maxfreq = sr/2)
    
fft2melmx(nfft, sr = 8000, nfilts = 40, width = 1, minfreq = 0, 
    maxfreq = sr/2, htkmel = FALSE, constamp = FALSE)

Arguments

nfft

Source FFT size.

sr

Sampling rate of the signal.

nfilts

Number of desired output frequency bands. If NULL then one per Bark/Mel between minfreq and maxfreq.

width

Width of each output frequency band in Bark/Mel.

minfreq

Minimum frequency.

maxfreq

Maximum frequency.

htkmel

Use HTK- or Slaney's curve of the Melscale.

constamp

Make integration windows peak at 1 (constamp=TRUE) or sum to 1 (constamp=FALSE)

Value

wts

The weight matrix with 'nfft' columns and 'nfilts' rows.

binfreqs

Edge frequencies of the bins.

Note

While wts has nfft columns, the second half are all zero. Hence, Bark spectrum is fft2barkmx(nfft, sr) %*% abs(fft(xincols, nfft)).

Author(s)

References

See Also

Examples

#Mel matrix in Slaney's mfcc.m:
  #tuneR:::fft2melmx(512, 8000, 40, 1, 133.33, 6855.5, FALSE, FALSE)

tuneR

Analysis of Music and Speech

v1.3.3
GPL-2 | GPL-3
Authors
Uwe Ligges <ligges@statistik.tu-dortmund.de> with contributions from Sebastian Krey, Olaf Mersmann, Sarah Schnackenberg, Guillaume Guenard, Andrea Preusser, Anita Thieler, Johanna Mielke and Claus Weihs, as well as code fragments and ideas from the former package 'sound' by Matthias Heymann and functions from 'rastamat' by Daniel P. W. Ellis. The included parts of the libmad MPEG audio decoder library are authored by Underbit Technologies.
Initial release
2018-07-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.