Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re[2]: [AVR-Chat] Moving average filter

2009-07-17 by Антощенков Роман Викторович

Hello, Andreas.


>   
> Hallo Roman,

> there are two things you could do to speed up the calculation
> significantly. First of all, it's not necessary to shift the data
> through the array with each update cycle. Instead, keep the data in
> its position and just use an index to the oldest element (like a ring buffer).

> It's also not necessary to calculate the sum which each update.
> Instead, save the old sum and just remove the oldest element and add the new element with each update.

Thanks for fast reply. It is a good solution

-- 
Best regards,
Roman Antoshchenkov
mailto:djantoxa@rambler.ru

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.