$VULCAN/src/filtering.scm
and VULCAN/src/window-filters.scm
defines some useful signal processing functions. The class <window-filter>
defines an API for applying a window filter to a set of readings. The public fields of this class are:
(window-size (self <window-filter>)) // size of the window (last-readings (self <window-filter>)) // current values in the windowThe methods associated with this class are:
(mstart (self <window-filter>)) (reset (self <window-filter>)) // throw away readings (add (self <window-filter>) reading) (output (self <window-filter>)) // calcualte output of the filterDifferent filters calculate their output in different ways. One has to create a subclass of
<window-filter>
in order to specify the particular output function of the filter. For example, the subclass <mean-window-filter>
is such that
(define-method output ((self <mean-window-filter>)) (if (not (null? (last-readings self))) (mean (last-readings self)) (next-method self)) )The call
next-method
invokes the method output
associated with the superclass (i.e. <window-filter>
) has to be called.