Package-level declarations

Types

Link copied to clipboard
abstract class AveragingFilter

Base class for an averaging filter that can be used to filter sensor data in estimators, such as accelerometer samples to obtain gravity by low-pass filtering.

Link copied to clipboard
class LowPassAveragingFilter(timeConstant: Double = DEFAULT_TIME_CONSTANT) : AveragingFilter

First order IIR averaging filter. IIR (Infinite Impulse Response) filters of first order follow expressions like the one below: output = a * input + b * prevOutput, where a = 1.0-b, where: b = e^-2πfc -> ln(b) = -2πfc -> fc = -ln(b) / (2π) and fc is the cutoff frequency. For typical default values: dt = 0.02 (50 Hz) s, and timeConstant = 0.1, dt is the time interval between samples, b = timeConstant / (timeConstant + dt) = 0.1 / (0.1 + 0.02) b = 0.8333 Consequently fc = -ln(0.8333) / (2π) = 0.02 Hz

Link copied to clipboard
class MeanAveragingFilter(timeConstant: Double = DEFAULT_TIME_CONSTANT) : AveragingFilter

FIR mean averaging filter. Computes average values using a FIR (Finite Impulse Response) filter with a length equal to: ceil(1.0 / dt * timeConstant), where dt is the time interval between samples. For typical default values: dt = 0.02 (%0Hz) and timeConstant = 0.1. Consequently FIR length is 5 samples.

Link copied to clipboard
class MedianAveragingFilter(timeConstant: Double = DEFAULT_TIME_CONSTANT) : AveragingFilter

Median averaging filter. Computes median values using a filter with a length equal to: ceil(1.0 / dt * timeConstant), where dt is the time interval between samples. For typical default values: dt = 0.02 (%0Hz) and timeConstant = 0.1. Consequently FIR length is 5 samples.