cepstrum: Cepstrum of univariate real timeseries

Description Usage Arguments Value Examples

View source: R/cepstrum.R

Description

Compute cepstrum of a univariate, real-valued timeseries

Usage

1
cepstrum(s, taper = c("hamming", "akaike", "gausswin"), poly = 5)

Arguments

s

real-valued, univariate timeseries

taper

taper applied to s prior to fft; one of "hamming" (default), "akaike" or "gausswin"

poly

polynomial order of trend removed from the log of power spectral density; defaults to 5

Value

data.frame with quefrency and cepstrum

Examples

1
2
3
4
5
6
7
8
t <- 1:500
f <- seq( 0.05, 0.25, 0.05 )
s <- sapply( t, function( x, y ) sum( sin( 2 * pi * x * y ) ), y = f )
s <- s + rnorm( length( t ), sd = 0.5 )
c <- cepstrum( s, taper = "akaike" )
ggplot( c, aes( x = quefrency, y = cepstrum ) ) + geom_line() +
labs( x = "Quefrency", y = "Cepstrum" )
# harmonics spaced at 0.05 produce peak at quefrency of 20 (1 / 20 = 0.05 )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.