recon: Convert Cepstral Coefficients into Log-Spectra.

Description Usage Arguments Value Author(s) Examples

Description

Returns a log-spectrum at a given set of frequencies from a cepstrum.

Usage

1
recon(wts,fqs)

Arguments

wts

Cepstral coefficients.

fqs

Frequencies to evaluate the log-spectrum.

Value

dsc

The log-spectrum.

Author(s)

Robert Krafty <rkrafty@pitt.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Simulate dataset
nj = 50  #number of series in training data
N = 500  #length of time series
data1 <- r.cond.ar2(N=N,nj=nj,r.phi1=c(.01,.7),r.phi2=c(-.12,-.06),r.sig2=c(.3,3))
data2 <- r.cond.ar2(N=N,nj=nj,r.phi1=c(.5,1.2),r.phi2=c(-.36,-.25),r.sig2=c(.3,3))
data3 <- r.cond.ar2(N=N,nj=nj,r.phi1=c(.9,1.5),r.phi2=c(-.56,-.75),r.sig2=c(.3,3))
dat <- cbind(data1$X,data2$X,data3$X)
y <- c(rep(1,nj),rep(2,nj),rep(3,nj))
data.cep <- cep.get(y,dat,4,7)

## Convert cepstral coefficients into log-spectra
frqs <- seq(from=0, to=.5, by=1/(dim(data.cep)[2]-1))
lspec <- matrix(0,dim(data.cep)[1], length(frqs))
## rows of lspec matrix contains log-spectra
for(i in 1:dim(data.cep)[1]){
  lspec[i,] <- recon(data.cep[,i],frqs)
}

CepLDA documentation built on May 1, 2019, 6:50 p.m.

Related to recon in CepLDA...