[sdiy] Shift-based IIR filters

Tom Wiltshire tom at electricdruid.net
Wed Mar 9 21:50:34 CET 2016


This topic has been discussed here before, but I wanted to draw people's attention to the following discussion on StackExchange:

	http://electronics.stackexchange.com/questions/30370/fast-and-memory-efficient-moving-average-calculation

There's a very good explanation of how to do a single pole RC-style IIR filter on a basic processor using downshifts for the multiplication (one shift right is "x0.5", so you can get any coefficient like 1/2^n without doing hard sums).

Realising that a byte-shift is even more efficient than a bit shift, I did a 8-bit input, 16-bit filter variable IIR filter which provides a slow filter (since the coefficient is 1/256) and only requires five instructions and two bytes of memory to calculate. Cascade it if you need more rolloff.

Enjoy,
Tom





More information about the Synth-diy mailing list