mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Fixed Doxygen comments for LinearDigitalFilter (#198)
This commit is contained in:
committed by
Peter Johnson
parent
6ef4745d86
commit
fd4719cb87
@@ -18,17 +18,17 @@
|
||||
* filters are supported. Static factory methods are provided to create commonly
|
||||
* used types of filters.
|
||||
*
|
||||
* Filters are of the form:
|
||||
* y[n] = (b0*x[n] + b1*x[n-1] + ... + bP*x[n-P]) - (a0*y[n-1] + a2*y[n-2] +
|
||||
* ... + aQ*y[n-Q])
|
||||
* Filters are of the form:<br>
|
||||
* y[n] = (b0 * x[n] + b1 * x[n-1] + … + bP * x[n-P]) -
|
||||
* (a0 * y[n-1] + a2 * y[n-2] + … + aQ * y[n-Q])
|
||||
*
|
||||
* Where:
|
||||
* y[n] is the output at time "n"
|
||||
* x[n] is the input at time "n"
|
||||
* y[n-1] is the output from the LAST time step ("n-1")
|
||||
* x[n-1] is the input from the LAST time step ("n-1")
|
||||
* b0...bP are the "feedforward" (FIR) gains
|
||||
* a0...aQ are the "feedback" (IIR) gains
|
||||
* Where:<br>
|
||||
* y[n] is the output at time "n"<br>
|
||||
* x[n] is the input at time "n"<br>
|
||||
* y[n-1] is the output from the LAST time step ("n-1")<br>
|
||||
* x[n-1] is the input from the LAST time step ("n-1")<br>
|
||||
* b0 … bP are the "feedforward" (FIR) gains<br>
|
||||
* a0 … aQ are the "feedback" (IIR) gains<br>
|
||||
* IMPORTANT! Note the "-" sign in front of the feedback term! This is a common
|
||||
* convention in signal processing.
|
||||
*
|
||||
@@ -48,10 +48,10 @@
|
||||
* electrical or mechanical components
|
||||
* - If you use clever gains, you can make a PID controller out of this class!
|
||||
*
|
||||
* For more on filters, I highly recommend the following articles:
|
||||
* http://en.wikipedia.org/wiki/Linear_filter
|
||||
* http://en.wikipedia.org/wiki/Iir_filter
|
||||
* http://en.wikipedia.org/wiki/Fir_filter
|
||||
* For more on filters, I highly recommend the following articles:<br>
|
||||
* http://en.wikipedia.org/wiki/Linear_filter<br>
|
||||
* http://en.wikipedia.org/wiki/Iir_filter<br>
|
||||
* http://en.wikipedia.org/wiki/Fir_filter<br>
|
||||
*
|
||||
* Note 1: PIDGet() should be called by the user on a known, regular period.
|
||||
* You can set up a Notifier to do this (look at the WPILib PIDController
|
||||
|
||||
@@ -75,11 +75,11 @@ LinearDigitalFilter::LinearDigitalFilter(std::shared_ptr<PIDSource> source,
|
||||
m_outputGains(fbGains) {}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Creates a one-pole IIR low-pass filter of the form:<br>
|
||||
* y[n] = (1 - gain) * x[n] + gain * y[n-1]<br>
|
||||
* where gain = e<sup>-dt / T</sup>, T is the time constant in seconds
|
||||
*
|
||||
* This filter is stable for time constants greater than zero
|
||||
* This filter is stable for time constants greater than zero.
|
||||
*
|
||||
* @param source The PIDSource object that is used to get values
|
||||
* @param timeConstant The discrete-time time constant in seconds
|
||||
@@ -92,11 +92,11 @@ LinearDigitalFilter LinearDigitalFilter::SinglePoleIIR(
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Creates a first-order high-pass filter of the form:<br>
|
||||
* y[n] = gain * x[n] + (-gain) * x[n-1] + gain * y[n-1]<br>
|
||||
* where gain = e<sup>-dt / T</sup>, T is the time constant in seconds
|
||||
*
|
||||
* This filter is stable for time constants greater than zero
|
||||
* This filter is stable for time constants greater than zero.
|
||||
*
|
||||
* @param source The PIDSource object that is used to get values
|
||||
* @param timeConstant The discrete-time time constant in seconds
|
||||
@@ -109,8 +109,8 @@ LinearDigitalFilter LinearDigitalFilter::HighPass(
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a K-tap FIR moving average filter of the form:
|
||||
* y[n] = 1/k * (x[k] + x[k-1] + ... + x[0])
|
||||
* Creates a K-tap FIR moving average filter of the form:<br>
|
||||
* y[n] = 1/k * (x[k] + x[k-1] + … + x[0])
|
||||
*
|
||||
* This filter is always stable.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user