Filter synthesis and network analysis

Hello,

This is about tools for making filters and numerical design optimization. Some details on the Devlist [1]. Please read it first. Here comes some additional info about the example, the screenshots of the optimizer output. Blue line is the target model from SciPy and orange is the synthesized one. Gain is one degree of freedom, so that 1.4 dB is the main difference. LTspice-simulation of the similar example with rounded values and harmonically related notch frequencies. The filter is voice band highpass (300 Hz) with maximum attenuation for 50 Hz and 100 Hz (mains frequency related interference).

Especially interesting would be to find persons who understand a bit more about filters and programming than me and develop this a bit further.

-Vesa

[1] https://groups.google.com/a/kicad.org/g/devlist/c/N_PvAQyWyn0


2 Likes

Hi vesa: Analog filter design is a fascinating topic but the practical circuit limitations can make your design challenging. As the order goes up the tolerances and opamp specs can affect the response quite a bit. After getting a topology you like a good next step is a sensitivity analysis, where you plug in resistor tolerances (eg: 1%) and capacitor tolerances (eg: 5%), opamp GBW (eg: 10MHz), etc. ADI has a tool that lets you do that:
https://tools.analog.com/en/filterwizard/
It will show an envelope for amplitude and phase response.

Yeah, obviously anything needing precision needs tuning or measurement of components. The whole point is that sensitive systems can be trivially optimized to spec. In the example two of the resistors are sensitive and need some extra care. Fortunately two parallel 1% E12 parts will do the job in this particular case. This tool is expected to run at the workbench computer and I usually measure a bunch of capacitors and give that list to the optimizer to pick from. Running Monte-Carlo for sensitivity envelopes is easy and informative, but not much needed. The point is to be able to automate tuning out tolerances from the components.

With a bit of wrangling with code one can also optimize for minimum sensitivity. The evolutionary algorithm also seems to steer to low sensitivity area. The example has only capacitors and the 12k summing node resistor defined with the target so the low gain is about the minimum that can realize the function.

Regarding amplifier the Sallen–Key is pretty forgiving at audio frequencies and moderate Q. All pole systems are the easiest. Zeros/notches are the most sensitive, but somewhat relaxed specs are doable by two transistor amplifiers and three transistor ones are accurate enough for deep >80 dB notches. Active filter performance obviously closely matches the amplifier distortion specs :slight_smile:

I think what you are working on is very intriguing, but what is your application? I have never had a need to measure components to come up with a one-off filter. It has been decades since I had a need to design a high-performance analog filter – digging the desired topology out of zverev’s classic book, scribbling pages of s-domain equations to transform to a fdnr realization… That was incredibly interesting and fun, but with today’s high-performance delta-sigma adcs you can have a super-high modulation freq and get away with a simple first-order filter ahead of the adc. Again I don’t know your application, but for a lot of audio stuff today getting out of the analog domain is a great way to go, and the analog signal chain concerns are more about common-mode and noise floor.

Low power systems for amateur radio. Also simplicity in mind, but as complex as needed for the performance level. 20 mW power budget is still somewhat difficult for a general purpose DSP and that is the system level for the whole receiver. Eventually I had to go full discrete design as e.g. TPA6203A1 turned out to be totally unsuitable for anything more demanding than driving a doorbell speaker. It has so much crossover distortion that I had to ask TI did I get a bad part (was as specified). Way worse than LM386 which consumes the whole power budget as quiescent power.

Hmm. Still no idea what your application is – can you elaborate? I am also a ham. How can you have a 20mW power budget and want to drive a speaker (of any size)?

DC-receiver selectivity… 3.7 V * (3 [osc+mixer] + 0.7 [two stage active filter] + 0.8 [main amplifier]) mA ~17 mW. The remaining mW for average output is actually quite a lot and with headphones almost unbearable. For a speaker, take one of the 10 W horns for 100 V systems and it is too much already. The current design gives about 0,3 W peak to 4 ohms, so peak is above the budget. I think we can continue over PM if there is not much more to filter design and network analysis ;^)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.