Learn R Programming

CepLDA (version 1.0.0)

cep.mtm: Multitaper Estimation of Cepstral Coefficients and the Log-Spectrum

Description

Returns multitaper estimated cepstra coefficients and log-spectrum for univariate time series.

Usage

cep.mtm(x,nw,k)

Arguments

x
Univariate time series of length N.
nw
Width of tapers. Default is set to 4
k
Number of tapers. Default is set to 7

Value

a list with 4 elements
quef
Quefencies.
cep
Raw cepstra coefficients from 0:(N-1)
freq
Frequencies between 0 and 1
lspec
Log-spectrum.

Examples

Run this code
## simulate a time series
N = 500 #length of each series
dat <- r.cond.ar2(N=N,nj=1,r.phi1=c(.01,.7),r.phi2=c(-.12,-.06),r.sig2=c(.3,3))$X

## Fit multiaper
cep <- cep.mtm(dat)

## Plot the cepstral coefficients
plot(cep$quef, cep$cep)

## Plot the log spectrum
plot(cep$freq, cep$lspec, type="l")

Run the code above in your browser using DataLab