Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #538329 > unrolled thread

a couple of LC filter progs

Started byJohn Larkin <jjlarkin@highlandtechnology.com>
First post2019-04-05 19:55 -0700
Last post2019-04-07 10:03 -0700
Articles 12 on this page of 32 — 11 participants

Back to article view | Back to sci.electronics.design


Contents

  a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-05 19:55 -0700
    Re: a couple of LC filter progs "John Miles, KE5FX" <jmiles@gmail.com> - 2019-04-06 20:07 -0700
      Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 07:47 -0700
        Re: a couple of LC filter progs Winfield Hill <hill@rowland.harvard.edu> - 2019-04-07 08:46 -0700
          Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 09:40 -0700
            Re: a couple of LC filter progs Winfield Hill <hill@rowland.harvard.edu> - 2019-04-07 09:49 -0700
              Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 10:17 -0700
                Re: a couple of LC filter progs Joseph Gwinn <joegwinn@comcast.net> - 2019-04-07 15:07 -0400
                  Re: a couple of LC filter progs Winfield Hill <hill@rowland.harvard.edu> - 2019-04-07 12:21 -0700
                    Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 13:24 -0700
                      Re: a couple of LC filter progs Joseph Gwinn <joegwinn@comcast.net> - 2019-04-07 17:08 -0400
                        Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 14:53 -0700
                          Re: a couple of LC filter progs Joseph Gwinn <joegwinn@comcast.net> - 2019-04-08 22:37 -0400
                            Re: a couple of LC filter progs "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-04-09 00:57 -0500
                              Re: a couple of LC filter progs Joseph Gwinn <joegwinn@comcast.net> - 2019-04-09 10:44 -0400
                            Re: a couple of LC filter progs "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-04-09 14:50 -0500
                              Re: a couple of LC filter progs Gerhard Hoffmann <dk4xp@arcor.de> - 2019-04-09 23:02 +0200
                                Re: a couple of LC filter progs "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-04-09 19:30 -0500
                                  Re: a couple of LC filter progs Gerhard Hoffmann <dk4xp@arcor.de> - 2019-04-10 02:55 +0200
                                  Re: a couple of LC filter progs upsidedown@downunder.com - 2019-04-10 07:40 +0300
                                    Re: a couple of LC filter progs Gerhard Hoffmann <dk4xp@arcor.de> - 2019-04-10 11:26 +0200
                                      Re: a couple of LC filter progs upsidedown@downunder.com - 2019-04-10 21:20 +0300
                                  Re: a couple of LC filter progs Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2019-04-10 11:50 +0300
                              Re: a couple of LC filter progs Joseph Gwinn <joegwinn@comcast.net> - 2019-04-11 09:15 -0400
      Re: a couple of LC filter progs Simon S Aysdie <gwhite@ti.com> - 2019-04-07 10:22 -0700
    Re: a couple of LC filter progs "Tim Williams" <tiwill@seventransistorlabs.com> - 2019-04-07 00:41 -0500
      Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 07:54 -0700
    Re: a couple of LC filter progs Clifford Heath <no.spam@please.net> - 2019-04-07 17:56 +1000
      Re: a couple of LC filter progs John Larkin <jjlarkin@highlandtechnology.com> - 2019-04-07 07:55 -0700
        Re: a couple of LC filter progs Clifford Heath <no.spam@please.net> - 2019-04-08 07:59 +1000
          Re: a couple of LC filter progs John Larkin <jjlarkin@highland_snip_technology.com> - 2019-04-08 10:58 -0700
    Re: a couple of LC filter progs Simon S Aysdie <gwhite@ti.com> - 2019-04-07 10:03 -0700

Page 2 of 2 — ← Prev page 1 [2]


#538901

FromGerhard Hoffmann <dk4xp@arcor.de>
Date2019-04-10 11:26 +0200
Message-ID<q8kcso$hec$1@solani.org>
In reply to#538873
Am 10.04.19 um 06:40 schrieb upsidedown@downunder.com:

> Yes, TMS 9900 was interesting, but with  main memory cycle times in
> the order of one microsecond  it was s_l_o_w. However, these days with
> modern caches and cache management it would make sense.
> 

No, never ever. That design is bad to the bone.

There is a direct and unbreakable link between the computer's fastest
and slowest operations.


In the time one can do   sub  (Rdest,flags),  Rsrc1, Rsrc2

one has to decide in addition:
- It is in L1 cache
    if not: is it in L2 cache
      if not: is it in L3 cache
         if not: is it at least in L1 page tables...L2 page tables
           if not: is swapped out -> trap, needs software to handle
           if not: does it exist at all -> trap

All that 3 times for a simple instruction. In addition to the normal
complications for pipelining, multi issue, speculative execution.

Even large register files or a huge number of renaming registers or
too large caches at a certain level are bad. Not having constant
replacement pressure means that the resource is too fat and therefore
to slow.

Some registers are badly needed to keep the complexity out of EVERY
instruction.

cheers,
Gerhard

[toc] | [prev] | [next] | [standalone]


#538948

Fromupsidedown@downunder.com
Date2019-04-10 21:20 +0300
Message-ID<9nbsaeptm2j4nkpbbf4f55aobc2ccjf754@4ax.com>
In reply to#538901
On Wed, 10 Apr 2019 11:26:48 +0200, Gerhard Hoffmann <dk4xp@arcor.de>
wrote:

>Am 10.04.19 um 06:40 schrieb upsidedown@downunder.com:
>
>> Yes, TMS 9900 was interesting, but with  main memory cycle times in
>> the order of one microsecond  it was s_l_o_w. However, these days with
>> modern caches and cache management it would make sense.
>> 
>
>No, never ever. That design is bad to the bone.
>
>There is a direct and unbreakable link between the computer's fastest
>and slowest operations.
>
>
>In the time one can do   sub  (Rdest,flags),  Rsrc1, Rsrc2
>
>one has to decide in addition:
>- It is in L1 cache
>    if not: is it in L2 cache
>      if not: is it in L3 cache
>         if not: is it at least in L1 page tables...L2 page tables
>           if not: is swapped out -> trap, needs software to handle
>           if not: does it exist at all -> trap
>
>All that 3 times for a simple instruction. In addition to the normal
>complications for pipelining, multi issue, speculative execution.

While this is true to any register in the register set after switching
workspace pointer, a read into cache usually reads more than a single
register but instead loads a full cache line, containing multiple or
even all registers. After this initial load, all active registers are
already in the cache and no more loads from main memory is needed. 

Better yet, the loading a new value into the workspace pointer should
automatically load the full register set in one or more cache lines.
This would be better for cache consistency.

An other issue about cache consistency is how to restore the modified
values into main memory. Either use "write through" to immediately
save individual modified cached register values or "write back" the
whole register set into main memory just prior to workspace pointer
reload.

>Even large register files or a huge number of renaming registers or
>too large caches at a certain level are bad. Not having constant
>replacement pressure means that the resource is too fat and therefore
>to slow.

Register renaming is just reloading register blocks, often with two or
more workspace pointers.

>Some registers are badly needed to keep the complexity out of EVERY
>instruction.

Using bulk load of the whole register set does just that.

>
>cheers,
>Gerhard

[toc] | [prev] | [next] | [standalone]


#538892

FromTauno Voipio <tauno.voipio@notused.fi.invalid>
Date2019-04-10 11:50 +0300
Message-ID<q8kao5$ajq$1@dont-email.me>
In reply to#538833
On 10.4.19 03:30, Tim Williams wrote:
> "Gerhard Hoffmann" <dk4xp@arcor.de> wrote in message 
> news:q8j19j$nld$1@solani.org...
>> National tried to implement indexing over registers in their 16032 /
>> 32032 processors. They didn't get it to work. Also, it was a bad idea.
>> When the array is small, then there is no real advantage. When it is
>> large, it will not fit into the registers.
> 
> Cool.  In that, it was something to try, that didn't work out, but now 
> we know.
> 
> There's been a number of architectures with memory mapped registers (not 
> including memory-as-register architectures, which are worse :^) ), but 
> they never really seem to stick around.  IIRC, AVR for example was 
> introduced with it, but most examples today have dropped it.
> 
> In some cases, you can still hack it (self modifying code), but that's 
> almost always worse (due to instruction pipelines and caches).  Other 
> times, it's specifically forbidden (physical ROM, Harvard architecture, 
> execute-only memory spaces, etc.).
> 
> Perhaps ironically, the feature still lives on, but in a more limited 
> way, as register renaming is a well established feature in more advanced 
> hardware.
> 
> Tim


One moderately successful was Sun / Oracle Sparc, with 24 of the 32
registers windowed into the stack.

A different story is that it needs the branch delay slots in the
traditional RISC way, and it makes the assembly code pretty difficult
to read (and still more to write).

-- 

-TV

[toc] | [prev] | [next] | [standalone]


#539011

FromJoseph Gwinn <joegwinn@comcast.net>
Date2019-04-11 09:15 -0400
Message-ID<0001HW.225F75880163929770000E6E32EF@news.giganews.com>
In reply to#538809
On Apr 9, 2019, Tim Williams wrote
(in article <q8it1k$3qi$1@dont-email.me>):

> "Joseph Gwinn" <joegwinn@comcast.net> wrote in message
> news:0001HW.225C3CD800A246FA70000E6E32EF@news.giganews.com...
> > They coded in plain C, inspected the generated assembly code, and
> tweaked the C code until the assembly code was clean and fast. It turned out
>
> that the resulting code was largely portable in that all C compilers
> generated clean, fast code from the same tweaked C source code, after the
> source code was tweaked to the first two compilers.
>
> Expanding on this some more --
>
> Just in my humble experience alone, your writing style can massively affect
> code generation.
>
> The optimizer is terribly, terribly far from exhaustive. (It /could/ be
> exhaustive -- but then users would complain of hours or years of compilation
> time for almost no benefit, and that's no good!) If it doesn't figure out
> any simple tricks, it's just going to pick the best, mediocre solution and
> let that be that.
>
> And mind this affects execution time about as much as it does code size.
> Often, compact code runs faster, especially on simpler embedded platforms.
> (Yeah, when pipelines and caches get involved, unrolled and inlined
> operations get more attractive, and the discrepancy between compact and fast
> code can grow.)
>
> Things the optimizer is likely to check, can range from modestly unrolling
> or reordering loops, to factoring numerical expressions, to inlining
> functions and operating on the resulting mega-function, and more. All of
> these grow quickly in complexity, however, and the pursuit can become
> self-defeating.
>
> A recent example was a bit-packing function, on an 8-bit platform with
> hardware multiply. I wrote this a few different ways. By far, the worst
> was a mega-expression: between macros and carefully indented and inspected
> sub-expressions, the whole operation can be expressed entirely numerically.
> That's technically fine, but the compiler really throws up its proverbial
> hands and basically ends up writing out the expression long-form without any
> reuse of sub-expressions, or registers even(!).
>
> The next best was using a bunch of variables (which are allocated on the
> stack normally, but these are optimized out quickly when there are enough
> free registers to put them there instead, which was the case here) to hold
> intermediate steps, and repeating common steps in a short loop. But keep in
> mind that, if the variables are allocated in registers... you can't loop
> over them. Doing it with a loop, forces it to allocate stack, get the
> pointer, and index the variables. Plus the memory accesses themselves,
> which are slower. It is not without overhead! (This is a much better deal
> on, say, classic 16-bit machines (x86, 68k), and most everything since.) It
> might even try it with the loop and array, then try it unrolled with
> registers, and keep the unrolled version because it's simply better!
>
> I forget what I ended up with; I think I sliced the bit pattern differently,
> still using a loop but getting better reuse. It's still ugly, like hundreds
> of bytes for something nearly trivial if the data were byte aligned.
>
> All of this optimizing is subject to the constrains of the functions
> executed within each expression or statement. C functions can do literally
> anything. Side effects are the bane of optimization. If the optimizer
> can't reason about being able to move a function up or down the expression
> tree, it's simply forced to treat that as a sequence point. (Sure, it could
> reason about the function's contents as if inlining it, but that would be
> extremely costly.)
>
> As far as I know, the optimizer is bad at guessing what functions do, in
> terms of side effects, so it can help greatly (and this is why they put the
> features in there) to add hints about the nature of the function (e.g.,
> using const with parameters, writing pure functions when possible, etc.).
>
> (FYI, most of my experience centers around GCC. Most of this is motivated
> by my own observations, illuminated by some of the official documentation
> about the optimizing step.)

Yes, this matches my experience as well. Assembly code rules!

Joe Gwinn

[toc] | [prev] | [next] | [standalone]


#538522

FromSimon S Aysdie <gwhite@ti.com>
Date2019-04-07 10:22 -0700
Message-ID<0526413e-e864-4ba0-bc59-5e00fc657d66@googlegroups.com>
In reply to#538430
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.) 

[toc] | [prev] | [next] | [standalone]


#538438

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2019-04-07 00:41 -0500
Message-ID<q8c2gl$meg$1@dont-email.me>
In reply to#538329
Here's a fully online one.  Not a designer, but a simulator:
https://www.seventransistorlabs.com/Calc/Filter1~.html

Still rather clunky, and some features have already broken in newer Chrome. 
Haven't had any reason to update it though...

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Design
Website: https://www.seventransistorlabs.com/

"John Larkin" <jjlarkin@highlandtechnology.com> wrote in message 
news:j05gaeh4rgqtsm8leoorc84nna492o7j2j@4ax.com...
> 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.
>
>
>
> -- 
>
> John Larkin         Highland Technology, Inc
>
> lunatic fringe electronics
> 

[toc] | [prev] | [next] | [standalone]


#538489

FromJohn Larkin <jjlarkin@highlandtechnology.com>
Date2019-04-07 07:54 -0700
Message-ID<sc3kae1nmhjveckv3vq04rr3e6ojvtvcoa@4ax.com>
In reply to#538438
On Sun, 7 Apr 2019 00:41:25 -0500, "Tim Williams"
<tiwill@seventransistorlabs.com> wrote:

>Here's a fully online one.  Not a designer, but a simulator:
>https://www.seventransistorlabs.com/Calc/Filter1~.html
>
>Still rather clunky, and some features have already broken in newer Chrome. 
>Haven't had any reason to update it though...
>
>Tim

Spice does that too!

I am simulating some pulse generator output circuits that are
screaming fast but ring at GHz time scales. So I'm simulating the
circuit and a cleanup filter together, using a filter form that looks
broadband ohmic on its output port to absorb cable reflections, ideas
cribbed from Jeroen. Of course, the physical circuits don't behave
like the sims.

This is a sim/test loop that ideally converges.


-- 

John Larkin         Highland Technology, Inc

lunatic fringe electronics 

[toc] | [prev] | [next] | [standalone]


#538441

FromClifford Heath <no.spam@please.net>
Date2019-04-07 17:56 +1000
Message-ID<H2iqE.25623$lJ7.8523@fx12.iad>
In reply to#538329
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

[toc] | [prev] | [next] | [standalone]


#538490

FromJohn Larkin <jjlarkin@highlandtechnology.com>
Date2019-04-07 07:55 -0700
Message-ID<up3kaehpkase7edkt80lm6k8j80l65vnif@4ax.com>
In reply to#538441
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. 


-- 

John Larkin         Highland Technology, Inc

lunatic fringe electronics 

[toc] | [prev] | [next] | [standalone]


#538554

FromClifford Heath <no.spam@please.net>
Date2019-04-08 07:59 +1000
Message-ID<apuqE.155569$I31.66719@fx37.iad>
In reply to#538490
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 :)

[toc] | [prev] | [next] | [standalone]


#538679

FromJohn Larkin <jjlarkin@highland_snip_technology.com>
Date2019-04-08 10:58 -0700
Message-ID<cq2nae1qd33jnt94rdu8odht5f71o73fhm@4ax.com>
In reply to#538554
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

[toc] | [prev] | [next] | [standalone]


#538515

FromSimon S Aysdie <gwhite@ti.com>
Date2019-04-07 10:03 -0700
Message-ID<73609d16-074d-4977-a8af-8261ab974f7b@googlegroups.com>
In reply to#538329
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.




[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | sci.electronics.design


csiph-web