# Comparison between two Digital Filters

Suppose you have two designs of IIR filters with different specifications which are meant to be implemented on a DSP. On what parameters will one compare the two filters so that we can choose which filter is better (like Speed, Memory or Efficiency)? And how do these parameters vary filter to filter?

For example- I have 2 filters, A and B: Filter A is a 4th order Low Pass Elliptic filter and filter B is a 70th order Butterworth Low Pass Filter and both can do the required job satisfactorily. Which filter should be implmented on the DSP and why? (Not taking into account the difficulties one might face in implementing a different algorithm)

• Isn't the general solution to picking the better of two solutions is to figure out what and why something is better? And wouldn't that depend on the specific if not unique circumstances. One could be in a situation where an experiment or initial demonstration is one' s goal and just getting something working is needed or optimizing a design that will go into millions of units. Your question is too broad – Stanley Pawlukiewicz Jul 13 '17 at 19:51
• I feel like I'm repeating this basically every time I write a comment under a question, but: It's always most important what purpose something serves. All metrics always are chosen to optimize utility for that purpose. So, if your IIRs are meant to suppress very strong narrowband out-of-band interference running at low rates with arbitrary latency on a device plugged into wall power, these metrics would be drastically different than if these were IIRs to optimize SNR in a hearing aid with a coin cell that needs to last very long, and where the job is to suppress overall energy in bands – Marcus Müller Jul 13 '17 at 19:51

The comments actually clearly put forward the complexity of a serious answer. But I'ld like to go simple and put mine for your example filters.

As you've stated, if two IIR filters of $70$th order and $4$th order (of whatever type) can satisfactorily do the job for you, then you should select the $4$th order filter because it will take much less processing power and processing time to compute its output.

That being said, those two filters (the elliptic and the Butterworth) have different frequency domain characteristics. They both have their own magnitude and nonlinear phase responses.

The Butterworth filter will have a monotonic frequency response in both of its pass and stop bands therefore in the design process it will be an overkill to specify a maximum allowed error ripple (from the ideal response) which will be satisfied at the cutoff freqencies but otherwise will be oversatisfied on the rest of the band due to monotonicity of the magnitude curve. That's why the Butterworth filter requires a much larger order for the same given filter specs.

The elliptic filter is known to have equiripple oscillatory characteristics on both the pass and stop bands which distributes the error energy accross all of the bands, therefore reducing the maximum (peak) of the allowed error ripple for a given filter order or minimizes the order of the filter for a given allowed peak ripple and transition width.

Since you don't want to consider the effects such as coefficient quantization or implementation architectures for high order recursive filters, then there isn't much remains to be considered for those two specific filters.

• Thank you for your time but my question was how much better in terms of Processing power and speed will one filter be in comparison to other? Is there a way to quantify these metrics? – Ritik Madan Jul 14 '17 at 7:21
• Yes the order of the IIR filters is a direct linear measure of processing power and speed. The shorter one will be $M$ times faster if it's $M$ times shorter. HOWEVER hardware architecture (especially memory accessing) affects this considerably. – Fat32 Jul 14 '17 at 10:17
• Thank you for mentioning the linear relation. Is the relation independent of the filter type i.e Butterworth or Elliptic? – Ritik Madan Jul 15 '17 at 15:08
• yes it's independent of the type (as long as they are both IIR filters with $a$ and $b$ set of coefficients.. – Fat32 Jul 15 '17 at 15:19