diff --git a/wpimath/src/main/java/edu/wpi/first/wpilibj/LinearFilter.java b/wpimath/src/main/java/edu/wpi/first/wpilibj/LinearFilter.java index 5d0e649e59..1f782d5281 100644 --- a/wpimath/src/main/java/edu/wpi/first/wpilibj/LinearFilter.java +++ b/wpimath/src/main/java/edu/wpi/first/wpilibj/LinearFilter.java @@ -74,6 +74,9 @@ public class LinearFilter { * Creates a one-pole IIR low-pass filter of the form: y[n] = (1-gain)*x[n] + gain*y[n-1] where * gain = e^(-dt / T), T is the time constant in seconds. * + *

Note: T = 1 / (2 pi f) where f is the cutoff frequency in Hz, the frequency above which the + * input starts to attenuate. + * *

This filter is stable for time constants greater than zero. * * @param timeConstant The discrete-time time constant in seconds. @@ -91,6 +94,9 @@ public class LinearFilter { * Creates a first-order high-pass filter of the form: y[n] = gain*x[n] + (-gain)*x[n-1] + * gain*y[n-1] where gain = e^(-dt / T), T is the time constant in seconds. * + *

Note: T = 1 / (2 pi f) where f is the cutoff frequency in Hz, the frequency below which the + * input starts to attenuate. + * *

This filter is stable for time constants greater than zero. * * @param timeConstant The discrete-time time constant in seconds. diff --git a/wpimath/src/main/native/include/frc/LinearFilter.h b/wpimath/src/main/native/include/frc/LinearFilter.h index 3faec05f8f..449fadf196 100644 --- a/wpimath/src/main/native/include/frc/LinearFilter.h +++ b/wpimath/src/main/native/include/frc/LinearFilter.h @@ -104,6 +104,9 @@ class LinearFilter { * y[n] = (1 - gain) * x[n] + gain * y[n-1]
* where gain = e-dt / T, T is the time constant in seconds * + * Note: T = 1 / (2 pi f) where f is the cutoff frequency in Hz, the frequency + * above which the input starts to attenuate. + * * This filter is stable for time constants greater than zero. * * @param timeConstant The discrete-time time constant in seconds. @@ -121,6 +124,9 @@ class LinearFilter { * y[n] = gain * x[n] + (-gain) * x[n-1] + gain * y[n-1]
* where gain = e-dt / T, T is the time constant in seconds * + * Note: T = 1 / (2 pi f) where f is the cutoff frequency in Hz, the frequency + * below which the input starts to attenuate. + * * This filter is stable for time constants greater than zero. * * @param timeConstant The discrete-time time constant in seconds.