Robert McGwier wrote:
Dawei:
You have understood it. Can you suggest a less expensive way than a
single pole iir filter (integrator) to compute the running average of
the data so we can subtract that mean?
You could use a decimating fir with no window (use all samples)
and taps (1.0/ntaps,1.0/ntaps,1.0/ntaps,1.0/ntaps, .....)
and decimation==ntaps
followed by a single pole IIR (running at a much lower rate)
What you win by this is the more efficiant SIMD implementation of FIR versus
IIR.
You could also make a block which just adds up a whole block of samples
Then divide the result by the number of samples, followed by a single pole IIR
This way you avoid the tap multiplication.
(I used this once for DC-removal in a test gnuradio ADC frontend)
Note however that this is mathematically not exactly the same as only a IIR,
because you work in blocks and only do the feedback after every block.
Greetings,
Martin