p2fc: Convert corner periods to fc specification for cosfilt

Description Usage Arguments Examples

View source: R/p2fc.R

Description

cosfilt assumes a frequency range of 0 (DC) to 0.5 (Nyquist). p2fc converts native unit periods to cosfilt corner frequencies.

Usage

1
p2fc(deltat = 1, pc)

Arguments

deltat

sampling interval

pc

vector of corner periods

Examples

1
2
3
4
5
6
7
8
t <- seq( 0, 500, 2 )
x <- rnorm( length( t ) ) + 100 * sin( 2 * pi * t / 20 )
x.ts <- ts( x, deltat = 2 )
pc <- c( 4, 10, 30, 40 )
fc <- p2fc( 2, pc )
f.ts <- cosfilt( x.ts, fc, fw = c( 0, 1, 1, 0 ) )
plot( x.ts )
lines( f.ts, col = "red" )

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