Learn R Programming

magclass (version 3.74)

lowpass: Lowpass Filter

Description

Filters high frequencies out of a time series. The filter has the structure x'(n) = (x(n-1)+2*x(n)+x(n+1))/4

Usage

lowpass(x, i=1, fix=NULL)

Arguments

x
Vector of data points, that should be filtered or MAgPIE object
i
number of iterations the filter should be applied to the data
fix
Fixes the starting and/or ending data point. Default value is NULL which doesn't fix any point. Available options are: "start" for fixing the starting point, "end" for fixing the ending point and "both" for fixing both ends of the data.

Value

The filtered data vector or MAgPIE object

Examples

Run this code
lowpass(c(1,2,11,3,4))
# to fix the starting point
lowpass(c(0,9,1,5,14,20,6,11,0), i=2, fix="start")

Run the code above in your browser using DataLab