Electronics-Related.com
Forums

a couple of LC filter progs

Started by John Larkin April 5, 2019
On Friday, April 5, 2019 at 7:55:47 PM UTC-7, John Larkin wrote:
> BESSIE designs LC Bessel filters up to 5th order. > > LCNORM normalizes or scales filters for new frequencies or impedances. > That's always a nuisance to do by hand. > > https://www.dropbox.com/s/syvu0wsx7s9rllk/Filter_Progs_1.zip?dl=0 > > I hope I got them right.
Filsyn is the most powerful LC filter program ever designed, and it is free (now). (It does more than LC filters.) It will do Bessel up to n=20. It is authored by George Szentirmai. http://alkeng.com/sf_wbc.html http://alkeng.com/sfilsyn.html Al K also has made his PCFILT program available for free. http://alkeng.com/sf_wbc.html http://alkeng.com/pcfilt.html Do not be fooled by the funky alk web page design. These are very powerful programs. The only downside I can think of is the Filsyn interface has some quirks (I often run it in a VM), and its extraordinary capabilities may put it beyond reach of people with only a light understanding of filters.
On 7 Apr 2019 09:49:03 -0700, Winfield Hill <hill@rowland.harvard.edu>
wrote:

>John Larkin wrote... >> >> On 7 Apr 2019, Winfield Hill wrote: >>> John Larkin wrote... >>>> >>>> Here's my units conversion program: >>>>https://www.dropbox.com/s/64rg7ko4rc7hhw7/U.zip?dl=0 >>> >>> John, you should provide the code. >> >> It's PowerBasic, which hardly anyone uses, and it's >> pretty hacked looking. It just sort of happened. >> OK, added to the zip file. > > Hey, John, that's not so bad, thanks!
People are down on Basic and especially GOTO, but they suit the way I think. U.EXE is 24 kilobytes. I once challenged a c program in a signal averaging application. c used pointers, I used subscripts. PowerBasic beat it on run speed by over 3:1. -- John Larkin Highland Technology, Inc lunatic fringe electronics
On Saturday, April 6, 2019 at 8:07:08 PM UTC-7, John Miles, KE5FX wrote:
> On Friday, April 5, 2019 at 7:55:47 PM UTC-7, John Larkin wrote: > > BESSIE designs LC Bessel filters up to 5th order. > > > > LCNORM normalizes or scales filters for new frequencies or impedances. > > That's always a nuisance to do by hand. > > > > https://www.dropbox.com/s/syvu0wsx7s9rllk/Filter_Progs_1.zip?dl=0 > > > > I hope I got them right. > > > > I'll also put in a plug for this site, which I've been using quite a bit > lately to build elliptic BPFs at VHF: > > https://rf-tools.com/lc-filter/ > > Results match those from the AADE program but this web-based program has the > ability to specify standard part values, which the AADE program doesn't.
That's a very nice tool. It is very easy to use. I bookmarked it. I've never seen an online tool that nice. If you're interested, I can say Filsyn will do general parametric filters. It will do arbitrary stop bands for parametric and conventional filters. (Elliptic filters have the constraint of equal rejection throughout the stopband, which is almost always unnecessary.) Put the zeros where they count most. Filsyn's LC manipulation capability post-synthesis is unmatched. It even does trap exchanges. With post-synthesis manipulation you can almost always coerce L values to COTS in BPF. Caps can be doubled up. The transforms/manipulations are exact---no response distortion results. (AADE had a bit of this ability---for example, implementation of the Norton transformer.)
On Apr 7, 2019, John Larkin wrote
(in article<pnbkaehon75kiil4lngfot8t7i6ugcfajn@4ax.com>):

> On 7 Apr 2019 09:49:03 -0700, Winfield Hill<hill@rowland.harvard.edu> > wrote: > > > John Larkin wrote... > > > > > > On 7 Apr 2019, Winfield Hill wrote: > > > > John Larkin wrote... > > > > > > > > > > Here's my units conversion program: > > > > > https://www.dropbox.com/s/64rg7ko4rc7hhw7/U.zip?dl=0 > > > > > > > > John, you should provide the code. > > > > > > It's PowerBasic, which hardly anyone uses, and it's > > > pretty hacked looking. It just sort of happened. > > > OK, added to the zip file. > > > > Hey, John, that's not so bad, thanks! > > People are down on Basic and especially GOTO, but they suit the way I > think. > > U.EXE is 24 kilobytes. I once challenged a c program in a signal > averaging application. c used pointers, I used subscripts. PowerBasic > beat it on run speed by over 3:1.
How&#4294967295;d you do that? Basic is an interpreted language, and for something like signal averaging, any reasonable C program should be a factor faster. Something is wrong. Joe Gwinn
Joseph Gwinn wrote...
> > How did you do that? Basic is an interpreted language...
Microsoft introduced QuickBasic, an excellent compiler version, with proper compiled-langauge features, in the mid 80s. In the late 80s they brought out BC, a Basic Compiler, which was very advanced. Not especially cheap, but well worth the money. No line numbers and one would rarely use GOTOs, which went to labeled statementa if you did use them. The Windows version became VisualBasic, which then combined with the other Microsoft compilers. John can tell you about PowerBasic, which took things a few steps further. -- Thanks, - Win
On 7 Apr 2019 12:21:20 -0700, Winfield Hill <hill@rowland.harvard.edu>
wrote:

>Joseph Gwinn wrote... >> >> How did you do that? Basic is an interpreted language... > > Microsoft introduced QuickBasic, an excellent compiler > version, with proper compiled-langauge features, in > the mid 80s. In the late 80s they brought out BC, a > Basic Compiler, which was very advanced. Not especially > cheap, but well worth the money. No line numbers and > one would rarely use GOTOs, which went to labeled > statementa if you did use them. > > The Windows version became VisualBasic, which then > combined with the other Microsoft compilers. > > John can tell you about PowerBasic, which took things > a few steps further.
It's a serious super-optimized compiler, with many data types and "modern" constructs, like CASE and WHILE and TRY...CATCH. The compiler is written in PowerBasic. I can run non-trivial FOR loops at 100 MHz. The guru was Bob Zale, who authored Turbo Basic but died in 2012. I doubt it will last a lot longer. Python is good (and looks a lot like Basic!) but most versions are still interpreters. I think 1 MHz loops are possible. There are now some Python compilers. Python would be great for embedded systems. We use it in all our automated test stands. -- John Larkin Highland Technology, Inc lunatic fringe electronics
On Apr 7, 2019, John Larkin wrote
(in article<qhmkae1mkr8pfknv186ganulorjdbtti12@4ax.com>):

> On 7 Apr 2019 12:21:20 -0700, Winfield Hill<hill@rowland.harvard.edu> > wrote: > > > Joseph Gwinn wrote... > > > > > > How did you do that? Basic is an interpreted language... > > > > Microsoft introduced QuickBasic, an excellent compiler > > version, with proper compiled-langauge features, in > > the mid 80s. In the late 80s they brought out BC, a > > Basic Compiler, which was very advanced. Not especially > > cheap, but well worth the money. No line numbers and > > one would rarely use GOTOs, which went to labeled > > statementa if you did use them. > > > > The Windows version became VisualBasic, which then > > combined with the other Microsoft compilers. > > > > John can tell you about PowerBasic, which took things > > a few steps further. > > It's a serious super-optimized compiler, with many data types and > "modern" constructs, like CASE and WHILE and TRY...CATCH. The compiler > is written in PowerBasic. I can run non-trivial FOR loops at 100 MHz. > > The guru was Bob Zale, who authored Turbo Basic but died in 2012. I > doubt it will last a lot longer. > > Python is good (and looks a lot like Basic!) but most versions are > still interpreters. I think 1 MHz loops are possible. There are now > some Python compilers. > > Python would be great for embedded systems. We use it in all our > automated test stands.
Ahh. Thanks. The Basic of my youth could not be compiled (because it had some dynamic syntax that required access to the executing runtime), but those awkward constructs seem to have withered away, and we now have compiled Basic. This Basic seems to be evolving towards Fortran. Hmm. One must be careful of that word "compiled". In this case, does it mean compiled down to machine code, or to some kind of bytecode that is executed by a runtime engine (like Java)?
> PowerBasic beat it on run speed by over 3:1.
3:1? Something is still amiss. For something as simple as averaging, the same algorithm programmed in a pair of compiled language, ought to yield roughly equal speeds. Unless the algorithm is biased toward one or the other language. In particular, algorithms developed on one language often prove awkward if transliterated into a different language. For many algorithms, C is faster than Basic (and Fortran) because one can pass objects in by address, even if the C compiler has no knowledge of that object. An inspection of the generated assembly code may prove surprising. Joe Gwinn
On Sun, 07 Apr 2019 17:08:36 -0400, Joseph Gwinn
<joegwinn@comcast.net> wrote:

>On Apr 7, 2019, John Larkin wrote >(in article<qhmkae1mkr8pfknv186ganulorjdbtti12@4ax.com>): > >> On 7 Apr 2019 12:21:20 -0700, Winfield Hill<hill@rowland.harvard.edu> >> wrote: >> >> > Joseph Gwinn wrote... >> > > >> > > How did you do that? Basic is an interpreted language... >> > >> > Microsoft introduced QuickBasic, an excellent compiler >> > version, with proper compiled-langauge features, in >> > the mid 80s. In the late 80s they brought out BC, a >> > Basic Compiler, which was very advanced. Not especially >> > cheap, but well worth the money. No line numbers and >> > one would rarely use GOTOs, which went to labeled >> > statementa if you did use them. >> > >> > The Windows version became VisualBasic, which then >> > combined with the other Microsoft compilers. >> > >> > John can tell you about PowerBasic, which took things >> > a few steps further. >> >> It's a serious super-optimized compiler, with many data types and >> "modern" constructs, like CASE and WHILE and TRY...CATCH. The compiler >> is written in PowerBasic. I can run non-trivial FOR loops at 100 MHz. >> >> The guru was Bob Zale, who authored Turbo Basic but died in 2012. I >> doubt it will last a lot longer. >> >> Python is good (and looks a lot like Basic!) but most versions are >> still interpreters. I think 1 MHz loops are possible. There are now >> some Python compilers. >> >> Python would be great for embedded systems. We use it in all our >> automated test stands. > >Ahh. Thanks. The Basic of my youth could not be compiled (because it had some >dynamic syntax that required access to the executing runtime), but those >awkward constructs seem to have withered away, and we now have compiled >Basic. > >This Basic seems to be evolving towards Fortran. > >Hmm. One must be careful of that word "compiled". In this case, does it >mean compiled down to machine code, or to some kind of bytecode that is >executed by a runtime engine (like Java)?
x86 machine code. You can also insert inline ASM statements, which is occasionally useful. In asm, you can refer to Basic variables or labels by name.
> >> PowerBasic beat it on run speed by over 3:1. > >3:1? Something is still amiss. For something as simple as averaging, the same >algorithm programmed in a pair of compiled language, ought to yield roughly >equal speeds. Unless the algorithm is biased toward one or the other >language. In particular, algorithms developed on one language often prove >awkward if transliterated into a different language.
The c guy played with code and compiler switches for a day and got close. -- John Larkin Highland Technology, Inc lunatic fringe electronics
On 8/4/19 12:55 am, John Larkin wrote:
> On Sun, 7 Apr 2019 17:56:20 +1000, Clifford Heath <no.spam@please.net> > wrote: > >> On 6/4/19 1:55 pm, John Larkin wrote: >>> BESSIE designs LC Bessel filters up to 5th order. >>> >>> LCNORM normalizes or scales filters for new frequencies or impedances. >>> That's always a nuisance to do by hand. >>> >>> https://www.dropbox.com/s/syvu0wsx7s9rllk/Filter_Progs_1.zip?dl=0 >>> >>> I hope I got them right. >> >> Why not publish the source code, so they can be scrutinised, and maybe >> rewritten in a modern language or for another operating system? >> >> Open Source rules for this kind of thing. >> >> Clifford Heath > > Well, I didn't write it to be pretty.
That's ok, we don't pay attention to you because you're pretty, either. Even if you are :)
On Mon, 8 Apr 2019 07:59:31 +1000, Clifford Heath <no.spam@please.net>
wrote:

>On 8/4/19 12:55 am, John Larkin wrote: >> On Sun, 7 Apr 2019 17:56:20 +1000, Clifford Heath <no.spam@please.net> >> wrote: >> >>> On 6/4/19 1:55 pm, John Larkin wrote: >>>> BESSIE designs LC Bessel filters up to 5th order. >>>> >>>> LCNORM normalizes or scales filters for new frequencies or impedances. >>>> That's always a nuisance to do by hand. >>>> >>>> https://www.dropbox.com/s/syvu0wsx7s9rllk/Filter_Progs_1.zip?dl=0 >>>> >>>> I hope I got them right. >>> >>> Why not publish the source code, so they can be scrutinised, and maybe >>> rewritten in a modern language or for another operating system? >>> >>> Open Source rules for this kind of thing. >>> >>> Clifford Heath >> >> Well, I didn't write it to be pretty. > >That's ok, we don't pay attention to you because you're pretty, either. >Even if you are :)
I have been rarely called "sorta cute." My preferred public appearance is "invisible." -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com