Package xal.tools.dsp

Class DigitalAverager


public class DigitalAverager extends AbstractDigitalFilter
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 Details

    • DigitalAverager

      public DigitalAverager()
      Create a new DigitalAverager 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 class AbstractDigitalFilter
      Parameters:
      iTime - current time index
      iDelay - 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 class AbstractDigitalFilter
      Parameters:
      iTime - current time index
      iDelay - delay index of coefficient
      Returns:
      output coefficient for given delay index and current time
      See Also: