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
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