[wpimath] Document conversion from filter cutoff frequency to time constant (#3299)

This commit is contained in:
Tyler Veness
2021-04-12 11:12:52 -07:00
committed by GitHub
parent 3848eb8b16
commit 948625de9d
2 changed files with 12 additions and 0 deletions

View File

@@ -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.
*
* <p>Note: T = 1 / (2 pi f) where f is the cutoff frequency in Hz, the frequency above which the
* input starts to attenuate.
*
* <p>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.
*
* <p>Note: T = 1 / (2 pi f) where f is the cutoff frequency in Hz, the frequency below which the
* input starts to attenuate.
*
* <p>This filter is stable for time constants greater than zero.
*
* @param timeConstant The discrete-time time constant in seconds.