fiddled filter design

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View


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  

We've slightly trimmed the long signature. Click to see the full one.
Re: fiddled filter design
On 11/08/2018 03:54 PM, John Larkin wrote:
Quoted text here. Click to load it


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

Quoted text here. Click to load it


Re: fiddled filter design

Quoted text here. Click to load it

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  

We've slightly trimmed the long signature. Click to see the full one.
Re: fiddled filter design
On 11/08/2018 05:42 PM, John Larkin wrote:
Quoted text here. Click to load it

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.




Re: fiddled filter design

Quoted text here. Click to load it

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.

Quoted text here. Click to load 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  


Re: fiddled filter design
On 11/08/2018 11:35 PM, John Larkin wrote:
Quoted text here. Click to load it

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


Re: fiddled filter design
On 11/09/2018 01:18 AM, bitrex wrote:
Quoted text here. Click to load it

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

Re: fiddled filter design

Quoted text here. Click to load it

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  


Re: fiddled filter design
On 11/09/2018 11:35 PM, John Larkin wrote:

Quoted text here. Click to load it

Back in the early 80's when FT's were slow and expensive I spent some time  
trying out different digital filters for targeted analysis on FT infrared  
and FT mass spectrometers coupled to gas chromatography so the data sets  
were pretty large for the time 2D arrays to see if I could get anything  
useful.  There is a book, Programs for Digital Signal Processing, put out by  
the IEEE in the late 70's that had some programs for filter design that I  
tried.  These are all in Fortran, or course, but I think there was a later  
version in C or you could use f2c.  Anyway, one program used something  
called the Remez exchange algorithm that let you specify arbitrary pass and  
stop bands with arbitrary gain in each band, and then it would do a trial  
and error search to find the optimum FIR coefficients to best match the  
target.  It sounds an awful lot like John's "fiddling", so maybe take a look  
at it and see if it could be the foundation for a program to do your  
constrained fiddling.

--  
Regards,
Carl Ijames  


Re: fiddled filter design
Quoted text here. Click to load it

There is Remez for Linux in C, I have it, thse source, it says:
   /*  TAB P   VER 068  $Id: remez.c,v 1.3 1998/06/15 09:04:37 egil Exp $
     *
     *  Remez exchange algorithm
     *
     *  the core of this program is converted from
     *  an original Fortran source. see below for details.
     *
     *  adaption for the PC and addition of FFT by:
     *      egil kvaleberg
     *      husebybakken 14a
     *      0379 oslo, norway
     *  Email:
     *       snipped-for-privacy@kvaleberg.no
     *  Web:
     *      http://www.kvaleberg.com/
     *
     *  Bugs:
     *  converted from Fortran, and no attempt has been made of hiding the fact
     *  the user interface is pretty dismal, the error handling horrible, but
     *  at least you should get your moneys worth
     */
        
Should be on the web somewhere,


OTOH you could use 'sox' it has some nice filtering and many other audio options.
Example of a whole lot of very narrow band-stop filters in the audio range in series to remove specific tones from the audio spectrum,
and record the result as mp3:

rtl_fm -d $device_nr -F 9 -M fm -f 430125000 -p $correction -s 44.1k -r 44.1k -l $squelch | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc 250-4k  | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 40  1020-980  | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  1290-1220 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  1500-1400 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  1680-1620 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  1880-1820 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  2080-2020 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  2280-2220 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  2480-2420 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  2680-2620 | \
sox  -t raw  -r 44.1k  -e signed-integer  -b 16  -c 1  -  -t raw  -  sinc -t 60  2880-2820 | \
/root/compile/pantel/xpequ/xpequ -i - -z 44100 -c 1 -b 16 -o - -s  | \
lame -r -s 44.1 --bitwidth 16 -m m - - | \
tee -a /mnt/sda1/test.mp3 | \
mpg123 -

Audio processing is so simple in Linux.
The first sox line is a bandpass 250 Hz to 4000 Hz,
the second sox line is a band-reject 980 to 1020 Hz,
etc, those all have 60 dB rejection, sync filters.

man sox

Re: fiddled filter design
Am 09.11.18 um 19:07 schrieb Jan Panteltje:
Quoted text here. Click to load it

IIRC, the original published Fortran version had a bug in the dimensions
of an array. (too small)

I corrected that when I compiled it on our VAX. Sources are long lost,
but others should have found that also.

I used the coefficients for my first FIR filter.
<  
http://www.hoffmann-hochfrequenz.de/project_gallery/project_gallery.html
    >

cheers,
Gerhard


Re: fiddled filter design
On 11/9/18 12:27 PM, Carl wrote:
Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it

Quoted text here. Click to load it


I have that book, and have used several of the routines.  There's a  
matching one with collected papers.  IIRC the optimal FIR filter program  
is by Parks & McClellan--it's a good one.

Cheers

Phil Hobbs

--  
Dr Philip C D Hobbs
Principal Consultant
We've slightly trimmed the long signature. Click to see the full one.
Re: fiddled filter design
On 11/09/2018 10:09 AM, John Larkin wrote:
Quoted text here. Click to load it

A "nature inspired" algorithm I'd love to try to see if it's suitable  
for that type of filter design problem is the flocking/swarm algorithm:

<http://www.cleveralgorithms.com/nature-inspired/swarm.html

Not sure if that's been done before.

Quoted text here. Click to load it



Re: fiddled filter design
On 11/9/18 10:09 AM, John Larkin wrote:
Quoted text here. Click to load it


Tuning LC ladder filters isn't hard if you know the trick, which is to
get the right number of bumps spread out over the right bandwidth, and
then adjust for flatness and good skirts.  You want to measure the
return loss for passband shape and the insertion loss for the skirts.

The fatal flaw is to tweak it up nicely at a bit too narrow a bandwidth.
  If you do that, start over.  The true solution probably isn't even nearby.

Quoted text here. Click to load it

Cheers

Phil Hobbs


--  
Dr Philip C D Hobbs
Principal Consultant
We've slightly trimmed the long signature. Click to see the full one.
Re: fiddled filter design
Am 09.11.18 um 19:36 schrieb Phil Hobbs:
Quoted text here. Click to load it

Quoted text here. Click to load it

The trick is to tell Eagleware/Agilent/Keysight Genesys what you want
and let it run. You can tune the filters also in real time in the  
computer or ask the optimizer for kinky shapes.

cheers, Gerhard


Re: fiddled filter design
On Friday, 9 November 2018 15:10:04 UTC, John Larkin  wrote:

Quoted text here. Click to load it

I was just going to ask where I might read about them. Google got me nowhere. Any suggestions?


NT

Re: fiddled filter design
On 10/11/18 2:09 am, John Larkin wrote:
Quoted text here. Click to load it

Bear in mind that most standard filter design approaches don't treat the  
impedance of middle nodes as variable. I.e. you can have a stage that  
filters but transforms up or down to a chosen impedance point (other  
than what is normally used for that topology), as long as something  
later transforms back down to the target impedance. It seems that  
creates a few new variables over which to optimise, compared to the  
standard approach, and can be used to match standard part values.

Quoted text here. Click to load it

Isn't an absorptive filter just a diplexer with one port terminated?
That is, two conjugate filters whose paralleled input impedance is flat?

Clifford Heath.

Re: fiddled filter design
On 11/11/18 08:16, Clifford Heath wrote:
Quoted text here. Click to load it


Sort of. A simple conjugate diplexer is exact only for Butterworth
filters. At least for Butterworths dimensioned for zero source
impedance; I'm not sure about the others.

For other filters, conjugate diplexers don't work. For 'tame'
filters, Bessel, Gaussian and such, it's rather easy to get good
input matching with a simple five component matching section.
The match isn't perfect, but it's better than can be achieved
using real components, so it's good enough.

I worked out exact matches for Bessel filters, because I use
those a lot, but it wasn't actually worth the effort, because
the five-component match is plenty good.

Jeroen Belleman


Re: fiddled filter design
On 12/11/18 12:20 am, Jeroen Belleman wrote:
Quoted text here. Click to load it

Well then, use a circulator. Assuming it's feasible in the target  
frequency range :)

Quoted text here. Click to load it

What's the topology of the five components? Sorry, I probably know it,  
but would prefer you were more specific.

Clifford Heath.

Re: fiddled filter design
On 11/11/18 22:11, Clifford Heath wrote:
Quoted text here. Click to load it

The purpose of matching is to obtain flat, constant impedance
over frequency. Circulators are narrow band devices. I count
bandwidth in decades.


Quoted text here. Click to load it

Nothing very impressive, really. It's a series RC in parallel with
a series RLC. For most tame filters, the theoretical S11 never
goes over -50dB. I think this is useful. I wrote it up in
<http://cern.ch/jeroen/crfilter/crfilter.html .

Jeroen Belleman


Site Timeline