Jon Elson wrote: >Lorenzo Marcantonio wrote: > > >>On Tue, 6 Nov 2007, Mario. wrote: >> >> >>>not want do only do 'some' filtering, ideally we want exact >>>counterfilter for our aches. And we need someone with good math skills >>>to show us precisely how. >>> >>> >It is already there, called biquad.comp in the HAL components, >provided by Peter Vavaroutsos. I have to figure out the best >filter parameters to use, but the code is already part of EMC2. > > And if that wasn't easy enough, here's more or less all you need to do a two-tap FIR (or IIR - I don't remember) filter using comp (untested):
component filter2 "2-tap filter"; pin in float in; pin out float out "The sum of two samples * their respective coefficients"; param rw float coeff1 = 1.0 "Coefficient of the most recent sample. The other coefficient is 1-coeff1" variable float old; function _; license "GPL"; ;; FUNCTION(_) { float temp = in; out = temp * coeff1 + old * (1-coeff1); old = temp; } Add taps as necessary, plus things like limits on the coefficient(s), etc. :) - Steve ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers