Implementation of FIR and IIR Filters using Arduino

sam_andrew: Okay so different coefficients for x and y. Got it. And these get stored into an array.

Doubt, I understand how to find the filter coefficients for an FIR filter since I only need to get the x coefficients. But for an IIR filter, how do I get the coefficients for x and y? Would the x coefficients be the same as they were for an FIR filter of equivalent performance? And how would the y coefficients vary from these?

To implement a circular buffer technique, we could have the nth value of the circle to be spit out to MatLab every cycle?

For example, if the circle was of four values. Every time the next value gets added to the circle, the oldest value needs to be discarded. Instead of discarding, maybe it could be sent back to MatLab?

The coefficients of the two types of filters would be totally different. It is not like converting meters to feet. It is more like converting bridges to skyscrapers. A different design is needed.

Well, kind of. A filter will have one new output for each input you put in. You add one value to the x array, discarding the oldest element in x. Then you calculate the next y and throw out the oldest y.

A circular buffer is a way to keep M values in memory without doing M move operations for each insert. If M is large then this slows down the filter.