Package voltage.processors

# Class WaveSmoother

java.lang.Object
voltage.processors.WaveSmoother

public class WaveSmoother extends Object
Use averaging of a buffer to smooth a waveform

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WaveSmoother()`
  Creates a WaveSmoother object with a buffersize of 13
  `WaveSmoother(int sampleBufferSize)`
  Creates a WaveSmoother object with a specified buffersize.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `Smooth(double value)`
  Adds a value and returns the smooth value.
  `void`
  `Smooth(double[] buffer, int numSamples)`
  Adds a buffer of values

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WaveSmoother

    public WaveSmoother()
    Creates a WaveSmoother object with a buffersize of 13

  - ### WaveSmoother

    public WaveSmoother(int sampleBufferSize)
    Creates a WaveSmoother object with a specified buffersize.
    Parameters:
      `sampleBufferSize` - the size of the buffer.

- ## Method Details

  - ### Smooth

    public double Smooth(double value)
    Adds a value and returns the smooth value.
    Parameters:
      `value` - the input value.
    Returns:
      the smoothed value.

  - ### Smooth

    public void Smooth(double[] buffer, int numSamples)
    Adds a buffer of values
    Parameters:
      `buffer` - an array of values.
      `numSamples` - the number of samples in the array.