Module lib.filters

Filters

some filters that could be useful for musical event processing

Functions

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
filters.smoother.mean TODO: what else would be useful?


Functions

clear ()
clear a filter's history

Class filters.mean

moving, windowed mean-average filter
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

moving, windowed median average filter
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

simple one-pole lowpass smoothing filter
smoother.new (time, sr)
constructor

Parameters:

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

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

generated by LDoc 1.5.0 Last updated 2024-10-13 17:45:04