Learn R Programming

tswge (version 2.1.0)

butterworth.wge: Perform Butterworth Filter

Description

The user can specify the order of the filter, and whether it is low pass ("low"), high pass ("high"), band stop ("stop"), or band pass ("pass") filter. Requires the CRAN package 'signal'.

Usage

butterworth.wge(x, order, type, cutoff,plot=TRUE)

Value

The filtered data

Arguments

x

Realization to be filtered

order

Order of the Butterworth filter

type

Either "low", "high", "stop", or "pass" as dicsussed in Descriptions

cutoff

For "low" and "high": cutoff is a real number. For "stop" and "band": cutoff is a 2-component vector

plot

If plot=TRUE then plots of the original and filtered data are produced.

Author

Wayne Woodward

References

"Applied Time Series Analysis with R, 2nd edition" by Woodward, Gray, and Elliott

Examples

Run this code
data(wages)
    butterworth.wge(wages,order=4,type="low",cutoff=.05)

Run the code above in your browser using DataLab