[sdiy] Digital Bandpass Filters
Magnus Danielson
cfmd at bredband.net
Wed May 26 21:27:49 CEST 2004
From: "M.A. Koot" <makoot at gmx.net>
Subject: [sdiy] Digital Bandpass Filters
Date: Wed, 26 May 2004 16:30:08 +0200 (MEST)
Message-ID: <9217.1085581808 at www52.gmx.net>
> Hello all,
Hi Michiel,
> It might not be the right place to ask, but currently I really wouldn't know
> where else I could better. If anyone could point me to a better newsgroup on
> this matter that'd be great!
This is the right place! ;O)
> I'm currently doing my degreeproject on designing a RTA (Real Time Analyser)
> in software code.
Ah!
I still miss the 30-band 1/3-octave Klark Technics DN-60 RTA! Analog analysis
with a 6502 running the LED-stuff. Mechanically it was a little bit whimpy
inside.
> Now if there's anybody who doesn't know what an RTA is, in a nuttshell: it's
> like a spectrum analyser, displaying the current frequency components in a
> sound-signal by showing moving bars for every frequencyband.
> I have to design a filterset to simulate this thing, so I'm working my way
> with Digital third-Octave IIR Band-Filters.
> I try to do this with Matlab, or using National Instruments tools, and
> programming the rest in Visual Basic. Though since I have very little
> experience with digital filters, I have some problems designing these.
Right.
> For the lowest bands in the analyser, I will need bandpassfilters with a
> very small passband.
> For example the utter lowest one needs a low Cutoff of 0,712 Hz and High
> cutoff of 0,898 Hz.
> That means a Passband of only 0,186 Hz! And I still have to maintain only a
> low attenuation in the passband following the IEC Norm.
Actually, that's not very narrow. The centerfrequency of 0,8 Hz and
0,8/0,712 = 0,898/0,8 = 2^(1/6). The static relationship between the center
frequency and corner frequency makes them about as easy or difficult to do.
> While checking out some filters from National Instruments, I found that they
> are quite nice, but when I try to design these lowest bandfilters, I have to
> make them small and I have to crank up the Order to keep the curve steep.
> The problem is only, that even if I increase the order, it's still not
> enough, and the curve doesn't make it to the top of the band before it's
> going down again (the high cutoff).
> Not only that, if I increase the filter order to over 50, the filter seems
> to go crazy, and that's no option either ;)
> I'm using elliptical filters at the moment, as they seem to have the highest
> possible steepnes of all, but obviously not enough.
Hmm... that is not what is supposed to be happening!
> It's probably not very suprising with this kind of a small passband, but it
> just can't be wider. And since a hardware RTA can do it by using it's own
> digital filters, it must be able for me to do it too in software.
It should, it should.
You don't need to do passband filters, you can do it with band-splitting
filters instead. Look at a standard state-variable filter, it allows you to
splitt the signal between a upper and lower band, that comming out of the
highpass and lowpass outputs respectively. An ideal band-splittning filter
has the property that when the two output signals are added to each other is
the total response that of an allpass filter. This can be acheived by setting
up the zeros of the high and low pass outputs such that their zero-polynomial
together form the allpass response zero-polynomial:
Zl(z) Zh(z) Za(z) Zl(z) + Zh(z)
Hl(z) = ----- Hh(z) = ----- Ha(z) = ----- = Hl(z) + Hh(z) = -------------
P(z) P(z) P(z) P(z)
One brute force way to generate Zl(z) and Zh(z) from Za(z) is simply to let
Zh(z) has the higher order part and Zl(z) the lower order part of the
polynomial. Za(z) is generated from P(z) according to traditional methods.
The P(z) is chosen for the band-splitting frequency and rank needed. You most
probably want a maximum-flat response, but that doesn't really work well here,
but I'd say Butterworth-like is probably a good idea.
Now, you are going to design a number of these band-splitting filters, where
each has two outputs, being basically two different output summations from the
same feedback core (i.e. the same P(z) implementation). See it as an IIR filter
with double feed-forward summing. Anyway, these band-splitters you use to
create a band-splittning tree where the first band-splitting filter divides
the input signal into two bands, each having an equal amount of target bands
in them. You need 31 band-splitting filters to create a 32-band structure.
Each band-splitting filter should be easy enought to design and if only care is
spent on ensuring sufficient resolution and correction for frequency skewing I
don't think it should be a hard job to do.
> Does anybody maby have experiency with this? Experiences with digital
> bandfilter design, or could anyone maby point me out a newsgroup which is
> related to this subject? I would be very very thankfull.
I did neither, I pointed in a different direction, I hope you enjoyed that
instead! ;O)
Cheers,
Magnus - who almost feels like testing it out... ;O)
More information about the Synth-diy
mailing list