Description Usage Arguments Value Author(s) References Examples
uses algorithms from wikipedia and my rudimentary understanding of cepstra to convert a spectrogram into a cepstrum
1 | cepstrum(spg)
|
spg |
a spectrogram object |
a cepstrum object, which can be plotted like a spectrogram
Benjamin N. Taft ben.taft@landmarkacoustics.com
http://en.wikipedia.org/wiki/Cepstrum
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (spg)
{
if (is(spg) == "spg") {
sample.rate <- sample.rate.spg(spg)
NR <- nrow(spg)
ix <- (ncol(spg)/2):1
cpg <- matrix(NA, NR, length(ix))
H <- hamming(ncol(spg))
for (i in 1:NR) {
cpg[i, ] <- spk(scale(spg[i, ], scale = F) * H)
}
attributes(cpg) <- c(attributes(cpg), list(time = attr(spg,
"time"), quefrency = sample.rate/ix))
class(cpg) <- c("cepstrum", class(cpg))
invisible(cpg)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.