lpfilt: Low pass filter.

Description Usage Arguments Value Examples

View source: R/filter.R

Description

Uses link{mvfft} to compute a low pass filter to the data.

Usage

1
lpfilt(x, freq, dt = NULL)

Arguments

x

Vector or matrix containing data to be filtered. If matrix, each column corresponds to a time series.

freq

Frequency below which data will be filtered.

dt

Time steps betweend samples. If not specified, x is assumed to be a time series ts object.

Value

The filtered signal

Examples

1
2
3
4
5
6
7
8
 tt <- seq(0, 4, len=513)[1:512]
 dt <- tt[2]
 x = ts(cos(4*pi*tt) + 1.5*sin(2*pi*tt) + 3 + cos(6*2*pi*tt),start=0,
 deltat=dt)
 xlp <- lpfilt(x, 1.5)
 plot(x, ylim=range(x, xlp))
 lines(xlp, lty=2)
legend(0, max(x, xlp), c("Signal", "Filtered Signal"), lty=c(1,2))

tunelipt/wutils documentation built on Nov. 5, 2019, 11:01 a.m.