IIR Second order cascade design for Spectrum Lab
This design procedure assumes that the IIR 2 filter algorithm in Spectrum Lab will produce an identical response to a cascade of analogue, second-order continuous time bandpass sections with the same resonant frequencies and bandwidths. Experience so far shows that it is close enough. This allows us to use analogue active filter design techniques.
The starting point is the normalised low-pass pole positions from filter tables, in the form of complex conjugate pairs - + j, - j. These are available for many different responses. For an nth order filter there are n/2 sets of values and . Then low-pass to bandpass transformation converts each pole pair into 2 second order bandpass functions, the poles of which have resonant frequencies f0a and f0b, both with the same Q. So there will be n second order bandpass sections in the transformed filter. The values of f0a,b and Q for each pair of 2nd order sections are calculated directly using standard formulas, again from the filter handbooks:
, , = Pole coordinates from tables
fm = centre frequency of filter
BW = -3dB filter bandwidth
Qbp = fm/BW
Then:
The bandwidths are just the resonant frequencies divided by Q; BWa = f0a/Q, BWb = f0b/Q. This procedure is repeated n/2 times, giving n 2nd order bandpass sections in total, which makes you glad you have a spreadsheet! For filters where the order n is odd, there will be a single real pole - + j0; putting this into the formulas above gives two identical bandpass sections resonant at fm. In this case, only one is used and the other discarded. However, I have not used any odd order filters in the spreadsheet.
To make the overall gain of the filter unity, I made the gain of each section equal to 1 at the centre frequency fm of the filter; this requires a mid band gain for each section of K>1, which can be calculated from:
I also included the possibility of adding overall gain to the filter of G dB, in which case all the different values of K are multiplied by a factor that divides the gain equally before each section:
Where n is the order of the filter. Most of the time, unity gain is probably best, but having adjustable gain is useful for the software radio function of SpecLab. It allows you to keep the input signal level reasonably low to avoid overloading the soundcard A/D. In the analogue filter, it is important to adjust the distribution of gain to optimise dynamic range; in a digital filter I am not so sure this applies. I think it depends how the calculations are done, whether floating point or integer representations are used in the DSP algorithms. However, the gain values I have used seem to work quite well with “real world” signals.
All the formulas above are included in the spreadsheet filtercalc.xls. The spreadsheet also includes the pole position data for several types of filter:
Transitional Gaussian to -6dB
Transitional Gaussian to -12dB
Bessel
Linear Phase with 0.05degrees ripple
Linear Phase with 0.5degrees ripple
Butterworth
Chebyshev 0.1dB ripple
Chebyshev 1dB ripple
All the data is for n=10 filters, except the Chebyshev, which is for 8th order. The formulas will work for any combination of centre frequency and bandwidth. Just enter the required centre frequency, bandwidth and gain in dB in the appropriate cells in the top left corner. All the filter designs will then be updated. The columns headed “foa” and “fob” are the resonant frequencies, and “BWa” and “BWb” are the associated bandwidths. The gain K is the same for each pair of bandpass sections. Using the K values gives a filter with overall unity gain, the K' values give overall gain of G dB.
So, for example, putting fm = 650Hz, BW = 50Hz, G = 20dB, and looking at the Transitional Gaussian to -6dB response, the values required for the SpecLab filter are:
Section |
Frequency f0a, f0b |
Bandwidth BWa, BWb |
Gain, K' |
1 |
644.8 |
16.8 |
1.5 |
2 |
655.3 |
17.1 |
1.5 |
3 |
634.7 |
15.4 |
2.8 |
4 |
665.6 |
16.2 |
2.8 |
5 |
625.8 |
12.9 |
4.8 |
6 |
675.1 |
13.9 |
4.8 |
7 |
618.9 |
8.8 |
8.8 |
8 |
682.6 |
9.7 |
8.8 |
9 |
615.0 |
3.2 |
27.1 |
0 |
687.0 |
3.5 |
27.1 |
So far, all the filter bandwidths and characteristics I have tried work OK. There must be some limits on the minimum bandwidth due to the resolution of delays and filter coefficients in the DSP algorithm, but it does not seem to noticeably affect 50Hz BW filters. I noticed that SpecLab will not always allow you to enter non-integer values for resonant frequency and bandwidth, however, editing the .FLC file with a text editor allows you to put in decimals, which seem to be accepted. This might be significant for very narrow filters where the bandwidth of each section is only a few Hz, but again, it seems to work OK with 50Hz filters, which are the narrowest I have tried so far. All filters were tested on a 300MHz PII, I also tried one on my old P133, which was OK. I have not tested all the different characteristics yet, so let me know if you find mistakes or unusual behaviour.
Jim Moritz, M0BMU.
30/11/2001
Corrected, 1/12/2001