Hello,
I'm working on a Python script to obtain the poles and zeros for classical analog filters and ultimately transform them to digital filters using the bilinear transform.
Everything works, except the Band Stop Filter code.
For BSF I used this frequency transformation: S -> Ω
0s/(Q(s
2 + Ω
02))
I transform each normalized pole to two poles and two zeros at ±jΩ
0
This is the result:
, and it's wrong because it looks like a single frequency notch.
For bandpass filter, using the transfomation: S -> (Q(s
2 + Ω
02)) / (Ω
0s), the result is correct:
Both filters were Butterworth, 6th order, with Ω1 = 40, Ω2 = 50, Q=√Ω1Ω2/(Ω2 - Ω1).
Probably it would be easier to group the poles of the normalized low pass filter into 1st or 2nd order sections from the begining, and denormalize those according to the formulas, but I think in software is easier keeping the poles separate and grouping them at the end.
Do you know if a BSF needs a special procedure for frequency transformation?
Thanks for your help