tomwalters@0: .TH FILT1 1 "1 September 1993" tomwalters@0: tomwalters@0: .SH NAME tomwalters@0: filt1 \- 1st order LP filter using an exponential smoother. tomwalters@0: tomwalters@0: .SH SYNTAX tomwalters@0: filt1 [options] [file] tomwalters@0: tomwalters@0: .SH DESCRIPTION tomwalters@0: A recursive "leaky integrator" 1st order low-pass filter which is a shifting tomwalters@0: exponential window which decays into the past values. tomwalters@0: tomwalters@0: .SH OPTIONS tomwalters@0: tomwalters@0: 1. tc tomwalters@0: tomwalters@0: The time-constant parameter which controls the rate of decay and so the tomwalters@0: size of the exponential window. For a given time constant of T seconds: tomwalters@0: tomwalters@0: .nf tomwalters@0: 0.7T secs is the window half--life. tomwalters@0: 4.6T secs is 99% of the window's life. tomwalters@0: .fi tomwalters@0: tomwalters@0: When the time-constant parameter is given with time units (s or ms) then tomwalters@0: it is converted to a decay constant using a = exp(-Ts/T), tomwalters@0: where Ts is the sample interval in seconds from the given `samplerate' option, tomwalters@0: and T is decay time-constant in seconds. tomwalters@0: Otherwise the time-constant parameter is taken to be the decay constant directly. tomwalters@0: tomwalters@0: With decay constant a=1 there is infinite memory because it does not decay. tomwalters@0: With 0 < a < 1 there is a finite decaying memory. tomwalters@0: The smaller `a', the smaller the memory (it decays faster). tomwalters@0: With a = 0 the filter output is identical with its input. tomwalters@0: tomwalters@0: 2. de tomwalters@0: tomwalters@0: Two optional difference equations are provided which repsectively compute tomwalters@0: a recursive sum (when "de=sum") and mean (when "de=mean"). tomwalters@0: The n'th recursive update is respectively: tomwalters@0: tomwalters@0: .nf tomwalters@0: y[n] = a.y[n-1] + x[n] recursive sum tomwalters@0: y[n] = a.y[n-1] + (1-a).x[n] recursive mean tomwalters@0: .fi tomwalters@0: tomwalters@0: where decay constant a = exp(-Ts/T), tomwalters@0: Ts is the sample interval in seconds, and T is decay time-constant in seconds. tomwalters@0: tomwalters@0: .SH "SEE ALSO" tomwalters@0: options smooth tomwalters@0: tomwalters@0: .SH COPYRIGHT tomwalters@0: .LP tomwalters@0: Copyright (c) Applied Psychology Unit, Medical Research Council, 1995 tomwalters@0: .LP tomwalters@0: Permission to use, copy, modify, and distribute this software without fee tomwalters@0: is hereby granted for research purposes, provided that this copyright tomwalters@0: notice appears in all copies and in all supporting documentation, and that tomwalters@0: the software is not redistributed for any fee (except for a nominal tomwalters@0: shipping charge). Anyone wanting to incorporate all or part of this tomwalters@0: software in a commercial product must obtain a license from the Medical tomwalters@0: Research Council. tomwalters@0: .LP tomwalters@0: The MRC makes no representations about the suitability of this tomwalters@0: software for any purpose. It is provided "as is" without express or tomwalters@0: implied warranty. tomwalters@0: .LP tomwalters@0: THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING tomwalters@0: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL tomwalters@0: THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES tomwalters@0: OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, tomwalters@0: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, tomwalters@0: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS tomwalters@0: SOFTWARE. tomwalters@0: