fiddled filter design

We were just talking about the classic lowpass filter forms (Chebyshev and such) and their history, being used to optimize the creation of log tables and such.

The classic functions map beautifully into electronics, but there's no reason that an electronic filter has to follow any of those forms; it only needs to work. Hence fiddled filters, parts values just diddled until the filter is good enough.

This filter below is to lowpass a DDS output to make a sine wave in the range 250 Hz to 5 KHz. The DDS is actually software in a small ARM that has an onboard DAC. The DDS runs off a 50 KHz interrupt. That was interesting too.

The filter was fiddled to use quad rpacks and cap values that were needed on the board anyhow.

The s/h in the sim sort of approximates the waveform from the DDS dac.

Version 4 SHEET 1 2660 884 WIRE 1024 -96 928 -96 WIRE 1168 -96 1104 -96 WIRE 928 -32 928 -96 WIRE 928 80 928 48 WIRE 288 96 224 96 WIRE 544 96 288 96 WIRE 2208 96 2176 96 WIRE 544 128 384 128 WIRE 2208 128 2208 96 WIRE 224 144 224 96 WIRE 784 144 720 144 WIRE 816 144 784 144 WIRE 1024 144 928 144 WIRE 1168 144 1168 -96 WIRE 1168 144 1104 144 WIRE 1200 144 1168 144 WIRE 1248 144 1200 144 WIRE 1392 144 1328 144 WIRE 1456 144 1392 144 WIRE 1600 144 1536 144 WIRE 1696 144 1600 144 WIRE 1840 144 1776 144 WIRE 1904 144 1840 144 WIRE 2048 144 1984 144 WIRE 2176 144 2048 144 WIRE 544 160 448 160 WIRE 2272 160 2240 160 WIRE 2336 160 2272 160 WIRE 2368 160 2336 160 WIRE 2176 176 2128 176 WIRE 928 192 928 144 WIRE 384 208 384 128 WIRE 816 208 816 144 WIRE 880 208 816 208 WIRE 1392 208 1392 144 WIRE 1600 208 1600 144 WIRE 1840 208 1840 144 WIRE 2048 208 2048 144 WIRE 2208 224 2208 192 WIRE 2208 224 2176 224 WIRE 224 256 224 224 WIRE 880 256 816 256 WIRE 448 288 448 160 WIRE 1392 304 1392 272 WIRE 1600 304 1600 272 WIRE 2048 304 2048 272 WIRE 816 336 816 256 WIRE 928 336 928 272 WIRE 1104 352 1040 352 WIRE 1136 352 1104 352 WIRE 1280 352 1232 352 WIRE 1312 352 1280 352 WIRE 1840 368 1840 272 WIRE 2128 368 2128 176 WIRE 2128 368 1840 368 WIRE 2272 368 2272 160 WIRE 2272 368 2128 368 WIRE 1040 400 1040 352 WIRE 1232 400 1232 352 WIRE 448 416 448 368 WIRE 1040 512 1040 480 WIRE 1232 512 1232 480 FLAG 1600 304 0 FLAG 1040 512 0 FLAG 1232 512 0 FLAG 1104 352 P FLAG 1280 352 N FLAG 224 256 0 FLAG 288 96 GEN FLAG 448 416 0 FLAG 384 208 0 FLAG 928 336 0 FLAG 816 336 0 FLAG 928 80 0 FLAG 2048 304 0 FLAG 2176 224 P FLAG 2176 96 N FLAG 2336 160 OUT FLAG 1392 304 0 FLAG 784 144 DDS FLAG 1200 144 IN SYMBOL res 1120 128 R90 WINDOW 0 -50 55 VBottom 2 WINDOW 3 -42 58 VTop 2 SYMATTR InstName R1 SYMATTR Value 1 SYMBOL res 1344 128 R90 WINDOW 0 -54 57 VBottom 2 WINDOW 3 -42 58 VTop 2 SYMATTR InstName R3 SYMATTR Value 1K SYMBOL res 1552 128 R90 WINDOW 0 -52 63 VBottom 2 WINDOW 3 -42 61 VTop 2 SYMATTR InstName R4 SYMATTR Value 1K SYMBOL cap 1376 208 R0 WINDOW 0 -67 31 Left 2 WINDOW 3 -72 64 Left 2 SYMATTR InstName C3 SYMATTR Value 10n SYMBOL cap 1584 208 R0 WINDOW 0 -68 26 Left 2 WINDOW 3 -70 60 Left 2 SYMATTR InstName C4 SYMATTR Value 10n SYMBOL voltage 1040 384 R0 WINDOW 0 58 46 Left 2 WINDOW 3 62 86 Left 2 SYMATTR InstName V2 SYMATTR Value 5 SYMBOL voltage 1232 384 R0 WINDOW 0 58 46 Left 2 WINDOW 3 62 86 Left 2 SYMATTR InstName V3 SYMATTR Value -5 SYMBOL voltage 224 128 R0 WINDOW 0 48 128 Left 2 WINDOW 3 -13 176 Left 2 WINDOW 123 27 173 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V4 SYMATTR Value SINE(0 1 5.15K) SYMBOL SpecialFunctions\\sample 624 128 R0 WINDOW 0 -12 -40 Left 2 SYMATTR InstName A1 SYMBOL voltage 448 272 R0 WINDOW 0 70 77 Left 2 WINDOW 3 29 121 Left 2 WINDOW 123 27 173 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V5 SYMATTR Value PULSE(0 2 0 1u 1u 5u 20u) SYMBOL e 928 176 R0 WINDOW 0 51 60 Left 2 WINDOW 3 58 96 Left 2 SYMATTR InstName E1 SYMATTR Value 1 SYMBOL voltage 928 -48 R0 WINDOW 0 -123 19 Left 2 WINDOW 3 -187 55 Left 2 WINDOW 123 -133 95 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value SINE(0 1 1K) SYMATTR Value2 AC 1 SYMBOL res 1120 -112 R90 WINDOW 0 75 57 VBottom 2 WINDOW 3 85 57 VTop 2 SYMATTR InstName R2 SYMATTR Value 1g SYMBOL res 1792 128 R90 WINDOW 0 -51 58 VBottom 2 WINDOW 3 -42 58 VTop 2 SYMATTR InstName R5 SYMATTR Value 10K SYMBOL res 2000 128 R90 WINDOW 0 -52 63 VBottom 2 WINDOW 3 -42 61 VTop 2 SYMATTR InstName R6 SYMATTR Value 5K SYMBOL cap 1824 208 R0 WINDOW 0 -67 31 Left 2 WINDOW 3 -72 64 Left 2 SYMATTR InstName C2 SYMATTR Value 10n SYMBOL cap 2032 208 R0 WINDOW 0 -71 32 Left 2 WINDOW 3 -67 68 Left 2 SYMATTR InstName C5 SYMATTR Value 1n SYMBOL Opamps\\UniversalOpamp2 2208 160 M180 WINDOW 0 65 95 Left 2 SYMATTR InstName U1 TEXT 1464 400 Left 2 !.tran 5m\n \n; .ac dec 20 1K 100K TEXT 1288 -72 Left 2 ;10KHz 5P DDS LPF per Rev B PCB TEXT 1392 -24 Left 2 ;JL Nov 6, 2018 TEXT 584 24 Left 2 ;DDS SIM TEXT 496 304 Left 2 ;50 KHz IRQ TEXT 2248 96 Left 2 ;OPA197

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin
Loading thread data ...

A "hybrid" filter topology I like a lot for active-filtering PWM, particularly when you only wanna use two or four poles, is a cross between a Bessel and a Butterworth; steeper cutoff than the strict Bessel but better group delay properties than the strict Butterworth. I call it the "Bustleworth" though some...will likely object to that nomenclature

Reply to
bitrex

Williams and Taylor

formatting link

include "equiripple error" approximations to the classic filters, and discussion of making real filters for actual circuits.

"Diddling" parts values can be part of the design process - it doesn't oblige you to stop comprehending what you are doing.

--
Bill Sloman, Sydney
Reply to
bill.sloman

Butterball?

It would be cool to have a program that accepts a topology and futzes values to meet some target frequency response. It should allow parts to be constrained to standard values, or work from a list of locally available, in-stock, values.

I have a simpler program RUGRAT that picks resistors for voltage dividers, based on the parts that we have in stock. It works brute-force. That's a huge time saver.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Mmmm.....turkey....almost thanksgiving...omnomonom

"as you know" the reason the Chebyshev, Butterworth, Bessel, et. al. filters are popular is because each one has certain elegant relationships between passband gain, stopband gain, steepness around the cutoff point, and phase response which are relatively easy to prove mathematically are in some sense optimum for a given, say, all-pole lowpass filter order; like for example a fourth-order Bessel has minimum group delay for a fourth-order structure which reaches -24 dB per octave as quickly as it does you can't minimize the former any further without compromising the latter.

Other optimums for a particular task surely exist but it would be a lot more difficult to prove mathematically that they are so.

Reply to
bitrex

I came up with a way of synthesizing a given input port parameter of generalized passive two-port impedance/admittance ladder networks a while back on paper which if i'm not wrong doesn't require futzing with that kinda ugly inelegant continued-fraction/polynomial expansion network synthesis method given in the textbooks, and seems more amenable to using divide-and-conquer/dynamic programming approach to synthesizing a response.

If there's demand for a proggie like that I will look into the method further didn't really have time to think it over more; I have no idea if the method is novel or not I couldn't find anything about it in what literature I looked at but there is a lot of EE literature and papers out there.

Reply to
bitrex

The other reason that are popular is because there is an approved procedure for synthesizing them. Random parts selection is an alternate procedure, people-light and compute-heavy. There just aren't, as far as I know, software tools to do it.

That's way too intellectual. We don't need to prove anything mathematically, or that anything is optimum. We need to make a good-enough filter from parts that we have in stock, ideally parts that are already on the board's BOM.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

it is as you say a task more ideally suited to a computer program doing the fiddling systematically. Other than that it requires a good educated guess on what direction to fiddle the values; fiddle the prototype filter components too much the wrong way and IIRC they rapidly become kinda junk

Reply to
bitrex

The filter response that is, not the components I'm sure they'll survive

Reply to
bitrex

On 09/11/2018 15:35, John Larkin wrote:

One place I worked had a very good genetic optimiser that could be wrapped around their in-house SPICE. You basically give it a netlist, tell it which components it is allowed to fiddle with, which simulations to run (which could be anything that SPICE can simulate), and give it some expressions for things you want it to minimise or maximise (which could be quite complicated functions to evaluate what you really care about), and tell it to go for it. So on a chip you might give it an expression for total capacitance value, and tell it to minimise that since that will affect chip size and so the die cost, and give it expressions for group delay, noise, time-domain behaviour or whatever you care about. I no longer recall the exact details of how the goals had to be expressed. It starts with a random population of circuits, and evaluates how "good" each one is, then picks some of the best ones from that generation and "breeds" them somehow, to make the next generation. The first time I tried it, I gave it a filtering problem that I had been struggling with, and after a few thousand generations (iirc a few minutes of runtime) it totally kicked my butt and came up with a much better filter than I had been able to design in the previous several weeks. I recall other people had used it to design high-speed logic cells (letting it tweak the transistor sizes, adding estimated parasitics and simulating the maximum clock frequency) and it came up with some non-intuitive things that were faster than what we had found by usual methods. If I had ever suffered from any lingering doubt about whether evolution really could be responsible for all the plants and animals in a feasible number of generations, the experience of using that software totally cured it. Just a few CPUs in a small compute farm, in a few minutes, could easily out-design what I could do, so billions of lifeforms running in parallel, for a few billion years, ought to come up with some impressive things.

Reply to
Chris Jones

ev

no

t

RM

as

I

There have been computer programs that have "evolved" circuits.

formatting link
ep1&type=pdf

Nobody seems to sell them.

Lots of stuff is way too intellectual for John Larkin.

um. We need to make a good-enough filter from parts that we have in stock, ideally parts that are already on the board's BOM.

The need being to have stuff to sell that more or less works.

John Larkin has said that his average product development time is two weeks , which doesn't leave a lot of time for exploring alternatives, finding an optimal solution, or even defining the problem to be solved clearly enough that you could demonstrate that a particular solution was optimal.

--
Bill Sloman, Sydney
Reply to
bill.sloman

That process will become standard/universal one day. I was wondering the other day what sort of new topologies & improvements it might bring.

NT

Reply to
tabbypurr

10kHz 5P filter. I only see four poles. How good is the 5kHz sine wave? What's the filter's attenuation at say 15kHz?
--
 Thanks, 
    - Win
Reply to
Winfield Hill

Manual fiddling can easily get lost in space, get confusing and divergent. It's the manual version of the generalized n-dimensional maximum finder, which can easily miss a global optimum somewhere off in the distance.

A filter has an n-dimensional goodness target, a frequency rolloff curve and maybe phase/transient response, which is an even harder target for optimization than one simple number. Sometimes you can't even quantify a goodness factor... you synthesize filters until you see something that you like.

LC filters are harder than active filters to fiddle; you get lost in space fast. 3rd order isn't too bad, and I got lucky once at 5, but it's nasty. We have the Filter Solutions/Nuhertz LC filter software, which is astonishing; it makes beautiful filters from standard part values, which much require some level of fiddling. It did one filter in milliseconds that we had been struggling with for a week.

Absorptive filters are tricky, because there's not much theory available. They are usually sorta fiddled. The new Mini-Circuits bilateral-absorptive filters seem to have some serious academic horsepower behind them.

I fiddled a one-side-absortive filter, along the lines of Jeroen's work. But only three-ish poles.

Bottom line, there is a world of non-standard-form filters out there, but they're hard to find.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

The filter is down 52 dB at 45 KHz, which is the main DDS image. It's actually up a half dB at 5K, our highest operating frequency. -3 at

7.5K.

Because we're running the DDS at 50 KHz, the spur at 45 KHz is already down 20 dB from the 5 KHz fundamantal, which becomes -70 after filtering. So the filter is overkill. The sine wave looks nice. DDS is fun.

At 400 Hz, our main use case, the unfiltered DDS's big spur is already (according to Spice) down 100 dB, not worth filtering. But I didn't simulate the DAC quantization or the crummy DAC linearity, so it's not that good in reality. The LPF won't help the DAC distortion at 400 Hz.

The downstream class-D power amp has some personality too, so we have hooks in the uP code to add an amplitude tweak as a function of frequency to flatten things if needed.

This is a 30 VA sinewave source to excite synchros and resolvers and LVDTs, so it really doesn't have to be very good. Synchros work off

400 Hz aircraft power, which is terrible, and "wild power" is worse.

This project got started two years ago. The amp kept blowing up and the guy who designed it quit, so it fell to the bottom of the queue. I have a new intern, so I figured it would be a good educational project for him, and we'll finally get it done.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

I mean other than the fact that the only real competing theories are variants on "God did all or some of it by magic all at once at some point" which apparently even the current Pope is not in favor of as a sensible concept of how a God, who even in just some existential sense might "care" about how intelligent life perceives the Universe, would operate.

or as a Christian theologian might put it if there are no doubts about anything then there can also be no faith, no grace, no salvation either you kinda got nothin' to work with from a religious perspective - you have to have both sides of the coin it's a package deal.

And I try to keep in mind that while genetic algorithms are impressive in what they can accomplish in engineering problems they are leveraged differently than how life in the real world operates from an evolutionary perspective. The genetic-algorithm-style evolution is highly goal-directed towards a fixed target, an optimal solution to some engineering problem. Biological life style evolution is not goal-directed and there is no fixed target.

The former is more like the notion of "intelligent design" where God has some idea of what an ideal "fern" should be and sets the parameters up such that after a few million generations a nice fern pops into existence, hardly a surprising thing really cuz it was set it up that way, same with a good-performing filter. It's finally an entirely mechanical process where the outcome is pre-ordained, just that you didn't know what the outcome would look like exactly a priori doesn't mean that it's not pre-ordained from your input parameters.

That it works at all surely gives a lot of credence to the scientific concept of _natural selection_ being valid but IMO finally has little to say about how _evolution_ works in the real world or why ferns or people currently exist in the state they do, it's not a proof of anything.

Reply to
bitrex

John Larkin

Why so complicated? Any 5.1 channel audio card would do, you can use 3 of the channels to make 3 phases if you need that. No filtering needed, just a few lines of code to make the shifted sine waves. If it is one phase only use sgen in Linux use sample rate 48kHz, clean sine waves. Use a decent audio amp (analog) or audio amp IC. There are many. I drive my cryocooler at 60 Hz that way, 100 VA, as we only have 50 Hz mains. Step up transformer is ring core main transformer in reverse, For 400 Hz you can use a much smaller transformer.

Basic kids stuff.

Reply to
<698839253X6D445TD

Trouble is, genetic algorithms lead to local maxima, not global. Who's to say that a rejected 'bad' result wouldn't have eventually led to a better outcome?

Not that I have a better idea.

Cheers

--
Clive
Reply to
Clive Arthur

Natural selection is almost surely the mechanism that steers evolution, but I think that variation is not random. There is intelligence in the process. Maybe not some white-bearded guy up in heaven, but far more sophisticated DNA algorithms than waiting for a cosmic ray to smash a chromosone somewhere. A form of quantum computing probably.

Organisms can't, and don't, wait for a survival challenge before they get around to mutating and adapting and hoping that some of their descendents will survive to propagate their mutation. If they did, they'd be extinct.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

It will be a cute little box that complements our synchro/LVDT products. It's not complicated. I'm not going to tell my customers to get a PC and a sound card and a power amp and a transformer and software so they don't have to buy my little box.

There are lots of 400 Hz power sources around, for aircraft electronics testing, but most are in the KVA range and are big and expensive, rackmount or worse. This will be a small benchtop unit.

--

John Larkin         Highland Technology, Inc 

lunatic fringe electronics
Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.