ComplementaryFilter: ComplementaryFilter

ComplementaryFilterR Documentation

ComplementaryFilter

Description

Calculates a result from combining a fast-response and slow-response signal

Usage

ComplementaryFilter(FastSignal, SlowSignal, tau = 200)

Arguments

FastSignal

A numeric vector with a fast-response signal.

SlowSignal

A numeric vector that is slower but has less absolute error than the fast-response signal.

tau

The time constant for the low-pass filter, in units of the spacing of measurements in the input arrays. (Default: 200)

Details

Applies a Butterworth filter to calculate the low-pass-filtered result of the difference between the two signals, and adds this filtered result to the signal with fast response.

The use for this function is two combine two measurements of the same quantity, one that has fast response but perhaps drifts and the other that maintains absolute accuracy. The technique has been applied, for example, to the measurement of wind through the combination of GPS measurements and IRS measurements because GPS measurements have long-term accuracy while faster-responding IRS measurements suffer from drift and oscillation. Caveat: The filter function will fail if there are NA values in the sequence, so these should be handled before calling this function, e.g., by replacing the NA values by interpolation.

Value

The vector of measurements that combines the two input signals.

Author(s)

William Cooper

Examples

## Not run: ComplementaryFilter(RAFdata$VNS, RAFdata$GGVNS, 150)

NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.