On Thu, Jan 22, 2009 at 1:45 PM, Geoff geoffspuredata@googlemail.com wrote:
The DSP book I have read gives a simple lowpass filter function as g(n) = (f(n-1) + f(n) + f(n+1))/3
Have a look at fexpr~. You can write FIR and IIR filters using fexpr~. It should be a good learning tool.
Difference equations like these are nearly trivial--I say nearly becuase you have to note the part that is non-causal above, f(n+1). Make this into a causal filter with 1 additional sample latency. e.g. g(n) = (f(n-2) + f(n-1) + f(n))/3
Chuck