0

I'm trying to create my own equalizer. I want to implement 10 IIR bandpass filters. I know the equations to calculate those but I read that for higher center frequencies (above 6000Hz) they should be calculated differently. Of course I have no idea how (and why). Or maybe it's all lies and I don't need other coefficients?

Source: http://cache.freescale.com/files/dsp/doc/app_note/AN2110.pdf

1 Answers1

0

You didn't read closely enough; the application note says "f_s/8 (or 6000Hz)", because for the purpose of where that's written, the sampling rate is 48000Hz.

However, that is a very narrowing look at filters; drawing the angles involved in equations 4,5,6 from that applications notes into an s-plane diagram this looks like it'd make sense, but these aren't the only filter options there are. The point the AN makes is that these are simple formulas, that approximate a "good" filter (because designing an IIR is usually a bit more complex), and they can only be used below f_2/8. I haven't tried to figure out what happens mathematically at higher frequencies, but I just guess the filters aren't as nicely uniform afterwards.

So, my approach would simply be using any filter design tool to calculate coefficients for you. You could, for example, use Matlab's filter design tool, or you could use GNU Radio's gr_filter_design, to give you IIRs. However, automatically found IIRs will usually be longer than 3 taps, unless you know very well how you mathematically define your design requirements so that the algorithm does what you want.

As much as I like the approach of using IIRs for audio equalization, where phase doesn't matter, I'd say the approach in the Application node is not easy to understand unless one has very solid background in filter/system theory. I guess you'd either study some signal theory with an electrical engineering textbook, or you just accept the coefficients as they are given on p. 28ff.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • fwiw, at 16kHz the "approximated" beta is 0.01870868 whereas the one from the table is 0.1800994. I think the net result would be the center frequency landing in the wrong spot - among other things. – jaket Sep 02 '15 at 18:31
  • Thanks for your reply! Truth is I'm building my own boombox and wanted to add equalizer. I don't really need some awesome filters, just something that works quite okay. The problem is that input audio will probably have different sampling rate than 48kHz, so I wanted to generate coefficients every time audio input is changed. It's just a summer project and I would like to avoid heavy reading. Maybe I should generate coefficients for most possible sampling rates? What do you think about that? – Michał Cłapiński Sep 02 '15 at 18:41
  • @clapik: definitely pre-compute the taps for the possible rates, yes. Well, for audio applications of this sort: take the taps from the reference, and try them with different sampling rates (python/w,h=scipy.signal.freqz(tapsden,tapsnom)/matplotlib.pyplot.plot(w,h) is your friend), and just so ever slightly adjust them till they fit^^ – Marcus Müller Sep 02 '15 at 18:46
  • @clapik: by the way, for your purposes, doing e.g. a 128-FFT and assigning scalar factors to groups of bins would probably be sufficient. Use small groups for low frequencies, and large groups at high frequencies. – Marcus Müller Sep 02 '15 at 22:25