LOWPASS Forumla

More
8 years 3 months ago #113762 by BigJohnT
Replied by BigJohnT on topic LOWPASS Forumla
Actually after reading your question in the other thread I was trying to improve the documents so a non math major could recreate the formula. I figured if I could understand it then most could.

JT

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #113763 by BigJohnT
Replied by BigJohnT on topic LOWPASS Forumla

rodw wrote: Funny, we were both struggling with this at the same time. On another thread, Peter said for a 70 Hz filter the gain was:

PCW wrote: Rod:

0.355849556024592

( 1-e^(-2*pi*70*.001) )

(assuming 1 KHz sampling)


In my case, I had correctly assumed e = 2.718 but was let down by a crappy calculator on my Chromebook. Once I moved to Google Sheets, it was perfect! Thanks for the tip on spreadsheets John!

It would be good if the docs were updated to state:
where:
e = the mathematical constant 2.71828
and the more normal ^ symbol was used for yn instead of ** (which I've never seen in use)


That is my plan when I return from holiday.

JT

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #113764 by rodw
Replied by rodw on topic LOWPASS Forumla
Andy, most users are not C programmers but most would be familiar with spreadsheet syntax. I've used a lot of programming languages over the years and I never came up against that one. The two languages this project use are C and Python. Neither use **. Both use pow() instead. So maybe that is an option for the programmers immersed in bitwise operations on a daily basis..

Either way, in my day it was normal to add a definition clause for maths equations as follows:

Where:
a ** b means "a to the power of b eg. same as the pow() function in C or Python";
e = the mathematical constant 2.71828 See


And yes I know these natural ratios often have an infinite number of decimal places.

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago - 8 years 3 months ago #113767 by PCW
Replied by PCW on topic LOWPASS Forumla
e^n is often represented with exp(n)

For example, SpeedCrunch likes this:

1 - exp(-2*pi*70*.001)

I guess its arguable that the lowpass filter should have done this internally so you just specify the corner frequency

(as long as it doesn't waste time recalculating the 'gain' unless the corner frequency changes)
Last edit: 8 years 3 months ago by PCW.

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #113793 by rodw
Replied by rodw on topic LOWPASS Forumla
but unless you know what e is or what exp does, a user still can't replicate the formula. It still needs more detail in the docs.

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #113886 by BigJohnT
Replied by BigJohnT on topic LOWPASS Forumla

rodw wrote: but unless you know what e is or what exp does, a user still can't replicate the formula. It still needs more detail in the docs.


I'll take care of this when I'm done with the holiday. Seb has cherry picked the addition to 2.7 so it should show up in the on line documents in a while and I'll expand the example with more information so a non math person can calculate it in the morning. Then the addition will get pushed to master.

JT
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

Moderators: HansU
Time to create page: 0.479 seconds
Powered by Kunena Forum