On Mon, Feb 09, 2009 at 01:43:41PM +0100, Martin Braun wrote:
[code]
Here's what I don't understand: the state for the MA (as for all
filters) is saved implicitly in the history. However, in this special
case, the state is simply one scalar value (saved in 'sum'). The way
this is
Whoops,
forget about skipping the history(), of course it couldn't work.
However, by adding a state buffer to the class, the first for() loop
can be skipped. For long MAs, this would save some multiplications and
only increase memory usage by one item_size.
The reason we don't do that is that
Hi,
I was about to write a block which calculates the moving average over a
whole vector, when I stumbled upon the way the current moving average
blocks handle the history.
Here's the code for the float version:
int
gr_moving_average_ff::work (int noutput_items,