Module filters

Functions

f:clear () clear a filter's history

Class filters.mean

mean.new (bufsize:) constructor
mean:next (x:) process a new input value and update the average

Class filters.median

median.new (bufsize:) constructor
median:next (x:) process a new input value and update the average

Class filters.smoother

smoother.new (time:, sr:) constructor
f.mean TODO: what else would be useful?


Functions

f:clear ()
clear a filter's history

Class filters.mean

mean.new (bufsize:)
constructor

Parameters:

  • bufsize: window size, cannot change after creation
mean:next (x:)
process a new input value and update the average

Parameters:

  • x: new input

Returns:

    scaled sum of stored history

Class filters.median

median.new (bufsize:)
constructor

Parameters:

  • bufsize: window size, cannot change after creation
median:next (x:)
process a new input value and update the average

Parameters:

  • x: new input

Returns:

    median of last N values

Class filters.smoother

smoother.new (time:, sr:)
constructor

Parameters:

  • time: -60db convergence time
  • sr: expected sample rate
f.mean
TODO: what else would be useful?

quantile estimator? constant time ramp? some kind of hysteresis / latching?

generated by LDoc 1.4.6 Last updated 2020-03-28 23:45:19