Package xal.tools.dsp
Class DigitalAverager
java.lang.Object
xal.tools.dsp.AbstractDigitalFilter
xal.tools.dsp.DigitalAverager
Performs a running average on an input signal. This object is a linear
digital filter which is not time-invariant.
- Author:
- Christopher K. Allen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getInputCoefficient
(int iTime, int iDelay) Returns the input coefficient for the given time index.double
getOutputCoefficient
(int iTime, int iDelay) Returns the output coefficient for the given time index.Methods inherited from class xal.tools.dsp.AbstractDigitalFilter
getCoefficientCount, getOrder, getTimeIndex, reset, response, response, toString
-
Constructor Details
-
DigitalAverager
public DigitalAverager()Create a newDigitalAverager
object.
-
-
Method Details
-
getInputCoefficient
public double getInputCoefficient(int iTime, int iDelay) Returns the input coefficient for the given time index. The only non-zero input coefficient is a0 for no delay. Its value is given by
a0(n) = 1/(n + 1)
- Specified by:
getInputCoefficient
in classAbstractDigitalFilter
- Parameters:
iTime
- current time indexiDelay
- delay index of coefficient- Returns:
- input coefficient for given delay index and current time
- See Also:
-
getOutputCoefficient
public double getOutputCoefficient(int iTime, int iDelay) Returns the output coefficient for the given time index. The values of the coefficients b0 and b1 are given by
b0(n) = 1
b-1(n) = n/(n + 1)
- Specified by:
getOutputCoefficient
in classAbstractDigitalFilter
- Parameters:
iTime
- current time indexiDelay
- delay index of coefficient- Returns:
- output coefficient for given delay index and current time
- See Also:
-