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
Message
Re[2]: [AVR-Chat] Moving average filter
2009-07-17 by Антощенков Роман Викторович