
Last chance! 50% off unlimited learning
Sale ends in
Calculate Mel-frequency cepstral coefficients.
melfcc(samples, sr = samples@samp.rate, wintime = 0.025,
hoptime = 0.01, numcep = 12, lifterexp = 0.6, htklifter = FALSE,
sumpower = TRUE, preemph = 0.97, dither = FALSE,
minfreq = 0, maxfreq = sr/2, nbands = 40, bwidth = 1,
dcttype = c("t2", "t1", "t3", "t4"),
fbtype = c("mel", "htkmel", "fcmel", "bark"), usecmp = FALSE,
modelorder = NULL, spec_out = FALSE, frames_in_rows = TRUE)
Object of Wave-class or WaveMC-class. Only the first channel will be used.
Sampling rate of the signal.
Window length in sec.
Step between successive windows in sec.
Number of cepstra to return.
Exponent for liftering; 0 = none.
Use HTK sin lifter.
If sumpower = TRUE
the frequency scale transformation is based on the
powerspectrum, if sumpower = FALSE
it is based on its squareroot (absolute value of the spectrum) and
squared afterwards.
Apply pre-emphasis filter [1 -preemph] (0 = none).
Add offset to spectrum as if dither noise.
Lowest band edge of mel filters (Hz).
Highest band edge of mel filters (Hz).
Number of warped spectral bands to use.
Width of spectral bands in Bark/Mel.
Type of DCT used - 1 or 2 (or 3 for HTK or 4 for feacalc).
Auditory frequency scale to use: "mel"
,
"bark"
, "htkmel"
, "fcmel"
.
Apply equal-loudness weighting and cube-root compression (PLP instead of LPC).
If modelorder > 0
, fit a linear prediction (autoregressive-) model of this order and
calculation of cepstra out of lpcas
.
Should matrices of the power- and the auditory-spectrum be returned.
Return time frames in rows instead of columns (original Matlab code).
Cepstral coefficients of the input signal (one time frame per row/column)
Auditory spectrum (spectrum after transformation to Mel/Bark scale) of the signal
Power spectrum of the input signal.
If modelorder > 0
, the linear prediction coefficients (LPC/PLP).
Calculation of the MFCCs imlcudes the following steps:
Preemphasis filtering
Take the absolute value of the STFT (usage of Hamming window)
Warp to auditory frequency scale (Mel/Bark)
Take the DCT of the log-auditory-spectrum
Return the first ‘ncep’ components
Daniel P. W. Ellis: http://www.ee.columbia.edu/~dpwe/resources/matlab/rastamat/
# NOT RUN {
testsound <- normalize(sine(400) + sine(1000) + square(250), "16")
m1 <- melfcc(testsound)
#Use PLP features to calculate cepstra and output the matrices like the
#original Matlab code (note: modelorder limits the number of cepstra)
m2 <- melfcc(testsound, numcep=9, usecmp=TRUE, modelorder=8,
spec_out=TRUE, frames_in_rows=FALSE)
# }
Run the code above in your browser using DataLab