User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Time to 'charge' a Butterworth IIR Filter

Fri Oct 02, 2015 6:01 am

I use a Butterworth digital low-pass filter to separate gravity from acceleration as the accelerometer readings for gravity drift over temperature and time (i.e. I can't just sample gravity at the start and use that throughout the run).

Sampling rate is 50Hz, cutoff is 0.05Hz (20s), 6th order.

Since the filter is an IIR, then the filter needs to be 'charged' for it to return a close approximation to the 'correct' value.

There must be a way to calculate how many iterations it takes charge the filter to a given % accuracy, but google isn't being as helpful as it usually is.

I currently am using a completely arbitrary 20s; I'd rather do it less empirically.

Suggestions?

TIA
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

User avatar
PeterO
Posts: 5951
Joined: Sun Jul 22, 2012 4:14 pm

Re: Time to 'charge' a Butterworth IIR Filter

Fri Oct 02, 2015 8:42 am

You might get better search results by using the term "settling time" in the search.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: Time to 'charge' a Butterworth IIR Filter

Fri Oct 02, 2015 9:39 am

Thanks PeterO, that at least has turned up some results showing it's hard to do broadly - it's very case specific. I'll keep digging now with the refined search parameters.
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

Return to “Off topic discussion”