Thursday, 10 July 2014

Once more unto the Averager (and IIR responses in Excel)

Having teased that I'd get round to explaining the Averager frequency response in my last blog, we're actually going to get to it now. There was a little more groundwork to cover than I expected and it was better to put into two posts.

We now have the tools in the Filter class to be able to do the phaseDelay and magnitude response for a filter. Just to make things a little easier, rather than putting a lot of additional code into our libraries I've taken the same algorithms and dropped them into Excel. It's a nice way of sharing the calculation algorithms again and actually is a neat little reference tool that can be used without running up a compiler.

When I have a spare evening I'll make a little app and put the graphs online in Silverlight so that this analysis can be used in some later things we're going to look at. For now, Excel it is, which can be downloaded here.

The spreadsheet allows the a and b variables for an IIR to be set in the green coloured columns.

Here you can see that b0 and b1 have been set to 0.5, which is our two-point averager and the number of coefficients in the filter can be set in the pink boxes, in this case just two delay terms. The number of feedback terms has been set to zero.











Finally, to drum-roll, the magnitude, phase and delay curves look like this:










So, you can see that the magnitude (amplitude) response does indeed show a low-pass characteristic, although not with much of a roll-off. The phase response is linear and the phase delay is constant at 0.5 (as we had stated).

A note on the frequency values. The scale is shown from 0-22.1kHz which is the Nyquist limit for a 44100 samples per second digital system used in audio. The phase response shows in this case just negative, with the scale from +pi to -pi in radians.

Now we have the code and a spreadsheet to go forth and start playing with filters.

No comments:

Post a Comment