All these filters and no maths...

Started by frank_p, October 17, 2008, 01:10:56 AM

Previous topic - Next topic

frank_p

I was surfing on the filters subject and found quite a lot of links on the subject.  Some gives explanation for one filter, some are staying on the surface of the subject, etc.

I know I could buy the Active Filter Cookbook for 40$,  but I must restrict my spending habits, and passives filter theory are also in consideration for me.

I found a link that brought more desire to find more info: because there is so much filters configurations on the site.  It's for a commercial software, but their little "tables of circuits" is still interesting, at least for brain-mapping all these configurations.

This is the passive page, but you can click at the left pane to see all the other configurations:

http://www.superfilter.net/features/networks/passrc.htm

Do anybody know some sources for maths on the net on these filters, or I should perhaps consider an other book than the Active Filter Cookbook by Lancaster ?

Anyway, take a look at the link (maybe for ideas).

asfastasdark

Believe it or not, but this time one of their article actually helps. Wikipedia.
Example: http://en.wikipedia.org/wiki/Low-pass_filter
Math: F=1/2(pi)(R)(C)

Some wikipedia helps, but most of it doesn't. For me, I just search Google for the specific RC network I need a formula for, and look through the first three pages or so.

frank_p

#2
Well there is more "stuff" in the National Application notes:
http://www.national.com/an/AN/AN-779.pdf
http://www.national.com/an/OA/OA-27.pdf
http://www.national.com/an/OA/OA-28.pdf
http://www.national.com/an/OA/OA-29.pdf
http://www.national.com/an/OA/OA-21.pdf

But this is more maths heavy.

Quote from: asfastasdark on October 17, 2008, 01:46:25 AM
Example: http://en.wikipedia.org/wiki/Low-pass_filter
Math: F=1/2(pi)(R)(C)

Yes, this one I know it since 91 ( 17 years... ).  But still usefull.

This one from TI look good also (well at first look, I am sleeping on my keyboard...)

http://focus.ti.com/lit/ml/sloa088/sloa088.pdf




alanlan

To understand the maths of filters you would probably be best getting a book or looking for links on general circuit analysis theory including AC analysis  (google "AC circuit analysis").  Obviously I don't know where your level of understanding is but knowledge of Laplace or "s" transforms which turn complex differential equations into simple algebra is a must.  Without this you cannot easily and fully explain, in mathematical terms, the operation of any filter i.e. in terms of phase and magnitude response.




DougH

This is probably not a bad place to spend some time: http://www.tpub.com/content/neets/14181/

For passive filters, for much complexity beyond what we deal with here you are getting into the subject of network analysis. More of a generic subject than just filtering and the math can get quite complex. There are college textbooks available for that subject, but you will need your differential equation chops sharpened up. For active filters, The Art of Electronics has a nice overview of some of the different general types, but I don't remember how much detail they go into the math for determining Q and etc. (Book's at the office so I don't remember.) I think you are on the right track looking for something like "the active filter cookbook" only for passive filters. IME, internet information on filters and filter theory has been pretty sketchy. It's either real basic (f=1/(2piRC)) or it's just circuits with no explanation of how they were derived.

"I can explain it to you, but I can't understand it for you."

R.G.

Quote from: frank_p on October 17, 2008, 01:10:56 AM
I know I could buy the Active Filter Cookbook for 40$,  but I must restrict my spending habits
Lancaster's Active Filter Cookbook is the reference book, used even by practicing professionals. I highly recommend it if you can possibly get it. It discusses passive filters as well to some depth.

I look hard for used books of all kinds, as my book expenses are nearly as big my food expenses, and just about as necessary to me at least. I find that at
abebooks.com there is one used copy in the USA for $7.42, one in Australian for $10.00, and one in France for $26.33. I was shocked to see the prices on amazon.com. The new ones are $38.xx, in line with your $40.00, but many places wanted more than the new price for used copies, including one which wanted $96+ for a used copy when a new one was less than half that. Apparently some bookstore owners are greedy as well.

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

frank_p

Quote from: alanlan on October 17, 2008, 08:36:00 AM
To understand the maths of filters you would probably be best getting a book or looking for links on general circuit analysis theory including AC analysis  (google "AC circuit analysis").  Obviously I don't know where your level of understanding is but knowledge of Laplace or "s" transforms which turn complex differential equations into simple algebra is a must.  Without this you cannot easily and fully explain, in mathematical terms, the operation of any filter i.e. in terms of phase and magnitude response.

I have done that laplace transforms about eight years ago: but it was more for mechanical vibration (and viscoelastic behavior of molten polymers) thing.  The theory looks quite the same only the mental representation of the physics concepts is not the same.  So having a couple of "solved problems" and do some more will be imperative if I want to understand more in the "electrical field". I've done that also for mechanical control, but I looked at my university notes last week and it was like a real surprise that I've learned that in University for electrics also: it seemed so far away and in the back of my mind...

Quote from: DougH on October 17, 2008, 10:15:14 AM
This is probably not a bad place to spend some time: http://www.tpub.com/content/neets/14181/
For passive filters, for much complexity beyond what we deal with here you are getting into the subject of network analysis. More of a generic subject than just filtering and the math can get quite complex. There are college textbooks available for that subject, but you will need your differential equation chops sharpened up. For active filters, The Art of Electronics has a nice overview of some of the different general types, but I don't remember how much detail they go into the math for determining Q and etc. (Book's at the office so I don't remember.) I think you are on the right track looking for something like "the active filter cookbook" only for passive filters. IME, internet information on filters and filter theory has been pretty sketchy. It's either real basic (f=1/(2piRC)) or it's just circuits with no explanation of how they were derived.

I bought a brand new Art of Electronics this summer.  I am going to look into it this week for sure.  I have a few other books and polycopies of my university classes I have kept (they are quite good in facts).  So I have no excuses to begin to work on it.  I was really wondering what was on the net tough.
I must admit that I have less trouble with Laplace transforms than with normal differential equations.  And I am better with iterative computer solutions of differential equations than hand solving.

Thanks for the link Doug.  It seems to have a lot of stock there.

Quote from: R.G. on October 17, 2008, 10:36:56 AM
Quote from: frank_p on October 17, 2008, 01:10:56 AM
I know I could buy the Active Filter Cookbook for 40$,  but I must restrict my spending habits
Lancaster's Active Filter Cookbook is the reference book, used even by practicing professionals. I highly recommend it if you can possibly get it. It discusses passive filters as well to some depth.

I look hard for used books of all kinds, as my book expenses are nearly as big my food expenses, and just about as necessary to me at least. I find that at
abebooks.com there is one used copy in the USA for $7.42, one in Australian for $10.00, and one in France for $26.33. I was shocked to see the prices on amazon.com. The new ones are $38.xx, in line with your $40.00, but many places wanted more than the new price for used copies, including one which wanted $96+ for a used copy when a new one was less than half that. Apparently some bookstore owners are greedy as well.

Yes indeed, I was really surprised to see it for over 100$ in used condition at Amazon.  I have to go see on the other site that you propose RG.

I've been also at the university's library to see what was on the shelves.  My feeling is that a lot of the book are very "academic", I mean they are not real practical applied science references for work but more for graduated folks that are looking to go heavy on theory.  Like: OK, inductances are great on paper, but for hell, where are you going to buy all of them, where are you going to put them (on your stompbox chassis ?), and all that noise that they generate if you don't isolate them...  Looks stupid to use an op amp and have nearby an self inductor as big as a tomatoes can...


George Giblet

> This one from TI look good also (well at first look, I am sleeping on my keyboard...)
> http://focus.ti.com/lit/ml/sloa088/sloa088.pdf

I think the TI note is one of the better summaries of filters around.

This is another good one:
http://focus.ti.com/lit/an/sloa049b/sloa049b.pdf

I'm generally not fond of the filter cookbooks, especially those with *only*show things like Sallen and key low pass filter with equal RC values and where you adjust the gain to set the filter Q.

The site Doug posted has got some good stuff on it:

http://www.tpub.com/content/neets/14181/

> It's either real basic (f=1/(2piRC)) or it's just circuits with no explanation of how they were derived.

Unfortunately filters involve pages of maths which is beyond most people.  I've done 100's of pages of calculations myself.   To design filters all you need is the filter circuit and the design equations.   You usually start with an analysis of the circuit which gives you a transfer function in terms of the part values, this is laborious but fairly mechanical.  Then you have to manipulate the transfer function equations to give you the part values in terms of the desired filter parameters eg. w0's and Q's.  This can take some time and in some instances the equations cannot be solved easily and one uses numeric solutions using a computer.  If you can find programs on the web to do it you should use them.  Coming up with the filter circuit itself is another world again, I wouldn't feel left out here, just accept the fact that some smart person did it for the good of all and you no longer have to worry!

I wouldn't get caught-up with all that pre-distortion stuff which is mentioned in the National Semiconductor notes.  It has it's place but not for hobbyists.





frank_p

Quote from: George Giblet on October 17, 2008, 11:52:33 AM
Unfortunately filters involve pages of maths which is beyond most people.  I've done 100's of pages of calculations myself.   To design filters all you need is the filter circuit and the design equations.   You usually start with an analysis of the circuit which gives you a transfer function in terms of the part values, this is laborious but fairly mechanical.  Then you have to manipulate the transfer function equations to give you the part values in terms of the desired filter parameters eg. w0's and Q's.  This can take some time and in some instances the equations cannot be solved easily and one uses numeric solutions using a computer.  If you can find programs on the web to do it you should use them.  Coming up with the filter circuit itself is another world again, I wouldn't feel left out here, just accept the fact that some smart person did it for the good of all and you no longer have to worry!

Well, for now it's my point of view too.  For me it's going to be Matlab and theory. I think this software is my second brain.  One good thing about programs that have already been done, is that you can study it, modify it at your taste and run them as many time as you want to adjust it and adjust what you are working on.  Spice is more a "magic box": it can give you cues, pre-test your things, but much less educative since you don't see any equations (I am only talking about filters here).

Time to eat.


alanlan

QuoteAnd I am better with iterative computer solutions of differential equations?
I don't think you need to get into iterative solutions for the most part - most circuits can be boiled down to a few poles and zeros which then makes it fairly easy to draw the bode plot either mentally or quickly on paper and then, if you can't analyze a very complex circuit or as I do as a confidence check, spice simulation probably is the answer.

DougH

Matlab's not a bad idea- I didn't think about that...

FWIW, Diff EQ got easy for me when we started LaPlace transforms. But up that point it was excruciating... Network analysis was a pretty tough class in school. IIRC it used all the "pre-Laplace" Diff EQ techniques. It was one of those classes used to "weed out" people who weren't ready to go the next level.
"I can explain it to you, but I can't understand it for you."

George Giblet

> For me it's going to be Matlab and theory.

I didn't realize you could use those tools.   You don't need anymore!

>I have done that laplace transforms about eight years ago: but it was more for mechanical vibration (and viscoelastic behavior of molten polymers) thing.  The theory looks quite the same only the mental representation of the physics concepts is not the same.

That is true.

MATLAB deals with equations and there is no need for a circuit.  A circuit is just an electronic form that implements the equations.  To understand filters there's no need to think about circuits.   Most electronics filter design is done in terms of cascaded first or second order (and sometimes third order) stages.  MATLAB tends to work with the expanded form of the polynomial.  They are the same thing but you need to translate between the two if you want to put a circuit (in equation form) into MATLAB.

PSpice can be used like MATLAB to some degree.  You can enter s-domain Laplace equations.  You can also set-up variable and design equation so it generates the part values.   I use the two interchangeably.

alanlan

Quote from: frank_p on October 17, 2008, 12:11:34 PM
Quote from: George Giblet on October 17, 2008, 11:52:33 AM
Unfortunately filters involve pages of maths which is beyond most people.  I've done 100's of pages of calculations myself.   To design filters all you need is the filter circuit and the design equations.   You usually start with an analysis of the circuit which gives you a transfer function in terms of the part values, this is laborious but fairly mechanical.  Then you have to manipulate the transfer function equations to give you the part values in terms of the desired filter parameters eg. w0's and Q's.  This can take some time and in some instances the equations cannot be solved easily and one uses numeric solutions using a computer.  If you can find programs on the web to do it you should use them.  Coming up with the filter circuit itself is another world again, I wouldn't feel left out here, just accept the fact that some smart person did it for the good of all and you no longer have to worry!

Well, for now it's my point of view too.  For me it's going to be Matlab and theory. I think this software is my second brain.  One good thing about programs that have already been done, is that you can study it, modify it at your taste and run them as many time as you want to adjust it and adjust what you are working on.  Spice is more a "magic box": it can give you cues, pre-test your things, but much less educative since you don't see any equations (I am only talking about filters here).

Time to eat.


One really neat feature of PSpice is the ABM feature/part which allows one to type in an equation in a box something like:

(s^2+56s+98)/(s^2+23s+76) (i.e. like you would in MATLAB) and plot the response as well as interfacing directly with "conventional" circuitry.  I found this to be very useful as it happens for modelling PLLs.  If you haven't got access to MATLAB (or can't afford it like me) then PSpice does offer this similar approach i.e. mathematically based.

Also, I sometimes use an ABM model in parallel with the "real" circuit just to confirm my "mathematical model".

George Giblet

>  If you haven't got access to MATLAB (or can't afford it like me) t

Checkout Scilab,  very MATLAB like and free!

frank_p


I am comming back this a bit latter, but there are folks on the net that have a huge collection of filters programs for Matlab (perhaps more for digital filtering...).  Anyway, check this teacher's site:

http://www.csupomona.edu/~jskang/files.htm


StephenGiles

"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

frank_p

Quote from: George Giblet on October 17, 2008, 12:56:53 PM
>  If you haven't got access to MATLAB (or can't afford it like me) t

Checkout Scilab,  very MATLAB like and free!


I've tryied it a a few years ago but it was still too full of bugs. 
There is also GNU Octave:

http://www.gnu.org/software/octave/

I still run on my 15 floppies educational version...
I is still on my P1 !  It's my heavy calculator.

Quote from: StephenGiles on October 17, 2008, 01:39:35 PM
You say math and we say maths :icon_lol: :icon_lol: :icon_lol:

Mathématiques  ;D

Quote from: alanlan on October 17, 2008, 12:32:31 PM
One really neat feature of PSpice is the ABM feature/part which allows one to type in an equation in a box something like:

(s^2+56s+98)/(s^2+23s+76) (i.e. like you would in MATLAB) and plot the response as well as interfacing directly with "conventional" circuitry.  I found this to be very useful as it happens for modelling PLLs.  If you haven't got access to MATLAB (or can't afford it like me) then PSpice does offer this similar approach i.e. mathematically based.

Also, I sometimes use an ABM model in parallel with the "real" circuit just to confirm my "mathematical model".

Not really familiar with the Pspice.  I use the free version of Multisim That came with the Floyd Electronic Fundamentals.  Easy to use, but not as versatile as PSpice I think.
I really don't know what are the different versions of PSpice...  Well I saw one free version that came with the Schaum books collection...

Quote from: George Giblet on October 17, 2008, 12:29:45 PM
> For me it's going to be Matlab and theory.

I didn't realize you could use those tools.   You don't need anymore!

>I have done that laplace transforms about eight years ago: but it was more for mechanical vibration (and viscoelastic behavior of molten polymers) thing.  The theory looks quite the same only the mental representation of the physics concepts is not the same.

That is true.

MATLAB deals with equations and there is no need for a circuit.  A circuit is just an electronic form that implements the equations.  To understand filters there's no need to think about circuits.   Most electronics filter design is done in terms of cascaded first or second order (and sometimes third order) stages.  MATLAB tends to work with the expanded form of the polynomial.  They are the same thing but you need to translate between the two if you want to put a circuit (in equation form) into MATLAB.

PSpice can be used like MATLAB to some degree.  You can enter s-domain Laplace equations.  You can also set-up variable and design equation so it generates the part values.   I use the two interchangeably.


I have really no idea how to use that in PSpice because I don't know it.  I went to their site at Orcad I saw you can have a free version but I've not aked for it.  Should I try this free version ?  Or LtSpice ?

Quote from: DougH on October 17, 2008, 12:25:54 PM
FWIW, Diff EQ got easy for me when we started LaPlace transforms. But up that point it was excruciating... Network analysis was a pretty tough class in school. IIRC it used all the "pre-Laplace" Diff EQ techniques. It was one of those classes used to "weed out" people who weren't ready to go the next level.

For us, it was the themo-fluid class. I remember again that question about a vortex-tornado, NOBODY had an idea how to solve the problem.  It was the only class I failed.  Half of the normal class was in the exam room for the "last strike".
I was so nervous...


mac

Frank, what kind of filters do you have in mind?

Some ago I solved the big muff tone stack, input sine wave and a low output constant load. I solved the set of diff eqs using a classical mechanic technique: if you solved vibrating systems you know what I'm talking about, no need to go Laplace. After all, either way, the difficulty is the same.  ;)
The beauty of solving a filter the old fashion (or vintage) way is that you see exactly what's going on.

mac

mac@mac-pc:~$ sudo apt install ECC83 EL84

calpolyengineer

This thread got me thinking about analog computers. They don't teach this anymore but in my opinion it is an invaluable tool for these kinds of situations. It operates on the principles that resistance, capacitance and inductance are analogous to concepts in other completely unrelated fields. Like in mechanics with springs, dashpots, and masses, they can be modeled using a circuit. And it spits out answers to Diff EQs immediately. But its quickly becoming a lost art.

-Joe

George Giblet

> http://www.csupomona.edu/~jskang/files.htm

Thanks for the link.  The amount of matlab scripts on the web is overwhelming!

> Should I try this free version ?  Or LtSpice ?

I use PSPICE 9.1 only because I'm familiar with it and the fact is has the feature I mentioned before.:  Laplace entry, parameters and equations for circuit values, and also an optimizer.   It's sometime since I've looked at others and when I did they didn't support those features, although most were more modern and were to use.  I'm was intending on looking a LTSpice again.

> I've tryied it a a few years ago but it was still too full of bugs.   There is also GNU Octave:

Agreed they had there issues, but have improved significantly in the last two years.   I can't comment on what is better at this point as it's some years since I've looked at Octave.  The general consensus is Scilab faster and more user friendly and Octave is more code compatible with MATLAB.