Learn R Programming

seewave (version 2.1.6)

melfilterbank: Mel-filter bank for MFCC computation

Description

This functions returns graphically and numerically the Mel-filters used to compute MFCC.

Usage

melfilterbank(f = 44100, wl = 1024,
minfreq = 0, maxfreq = f/2, m = 20,
palette, alpha = 0.5, plot = FALSE)

Arguments

f

sammpling frequency (in Hz).

wl

the Fourier window length (in number of samples).

minfreq

the minimum (or lower) frequency of the filter bank (in Hz).

maxfreq

the maximum (or upper) frequency of the filter bank (in Hz).

m

the total number of filters.

palette

an optional colour palette if plot is TRUE.

alpha

alpha-transparency when a colour palette is used.

plot

if TRUE all filters are displayed in a single plot.

Value

A list of 3 items:

central.freq

the kHz central frequencies of the filters,

freq

the kHz frequency scale,

amp

the amplitude of the filters, scaled between 0 and 1.

References

Sharan RV & Moir TJ (2016) Applications and advancements in automatic sound recognition. Neurocomputing.

See Also

mel, gammatone

Examples

Run this code
# NOT RUN {
## default values
melfilterbank(plot=TRUE)
## with color surfaces
melfilterbank(palette=cm.colors, plot=TRUE)
## values changed
res <- melfilterbank(f=16000, wl=512, minfreq=300, plot=TRUE)
## plot the 1st filter only
plot(res$freq, res$amp[,1], type="l", xlab="Frequency (kHz)", ylab="Amplitude")
## plot the last filter only
plot(res$freq, res$amp[,ncol(res$amp)], type="l", xlab="Frequency (kHz)", ylab="Amplitude")
## get the kHz central frequencies of the succesive filters
res$central.freq
# }

Run the code above in your browser using DataLab