Originally posted by Davor
View Post
So a high pass filter of 4 seconds would give you a gb signal that is updated every 4 seconds? With the Nucleo it should be quite easy.
As Tinkerer says, it is impressive, but you have to run it at 96 mhz if you want to use the USB channel for comms.
And as for a high pass FIR there are two ways to do this. keep a lot of memory readings, remove the oldest add in the newest. I do that with a 32 entry buffer in the medical device. BUT
There is also a way to do it with only having to store one value.
I don't have the basic algorithm handy, but my memory serves to tell me it involved taking a single stored value, and a sample value, and modifying the stored value by a multiply and divide involving the input.
Would have to do some webbing.
http://iowahills.com/5FIRFiltersPage.html seems to be a good general link.
With a filter designer.
http://stackoverflow.com/questions/1...and-data-total
4down vote |
New average = old average * (n-1)/n + new value /n This is assuming the count only changed by one (in case it changed by m then: new average =old average * (n-m)/n + sum of new value/n). This is the mathematical formula (I believe the most efficient one), believe you can do further code by yourselves |
Of course you have to replace old average with the new one....
Comment