Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters - output #2

Open
johnrod956 opened this issue Aug 25, 2017 · 1 comment
Open

Filters - output #2

johnrod956 opened this issue Aug 25, 2017 · 1 comment

Comments

@johnrod956
Copy link

I'm not sure if I am setting it up correctly but if I set a low pass filter frequency at 100 (Hz). The 100 Hz should be the cutoff frequency correct? Now if I use the output function of my filter and print the value... should I be seeing a value of zero if my input frequency is over 100 Hz?

@JonHub
Copy link
Owner

JonHub commented Aug 25, 2017

The filters are designed to behave identically to their electronic counter parts (single-pole RC, and two pole Bessel/Butterworth filters). Essentially "Filters" simulates these circuits in real-time digital embedded. You can lean more about the filter behavior (in terms of frequency response) by checking into standard single- and two-pole filters.

Since the filters are single-pole and two-pole, they are not infinitely sharp in terms of frequency cutoff. So, you will still see some output at an input frequency 100 Hz, or even 1000 Hz (though dramatically attenuated).

From the user perspective, the frequency you supply is the “corner frequency,” which is the standard number used to define a filter. The signal is attenuated by 3 decibels at the corner frequency, which is half the power (or 1/sqrt(2) of the magnitude).

So, in your case, if you enter a corner frequency of 100, then your filter will output about 71% the maximum value at that frequency. Keep in mind that you need to updated the filter FREQUENTLY - many more times than your corner frequency, per second, probably closer to 1000x (or more)- for it to work

Since the filters are recursive (they “time-step” to calculate the next value, so the updates need to happen at a scale that is faster than big the signal, or filter). This is typically easy to achieve, but can eat up some resources for the DSP.

If you are stepping too infrequently, the single-pole filters will remain stable, and the two-pole filters have a “check,” so they remain numerically stable, but the output will not be correct.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants