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

Function to compute initial state for newly-created filter #18

Open
jdpigeon opened this issue Feb 26, 2018 · 4 comments
Open

Function to compute initial state for newly-created filter #18

jdpigeon opened this issue Feb 26, 2018 · 4 comments

Comments

@jdpigeon
Copy link

One thing that's nice about working with scipy's linear filters is that you can compute the initial state of a filter with lfilter_zi before you pass any signal through. This eliminates ringing in many cases.

However, this functionality doesn't appear to be available in fili. I am curious what the feasibility of adding this would be?

@jdpigeon
Copy link
Author

I'm working on this right now here: jdpigeon@6ff33ed

@nikolabrdaroski
Copy link

Any explanation for this functionality? How to use function? Thanks.

@jdpigeon
Copy link
Author

Unfortunately, its been a while since Ive worked on this project, so I'm not entirely sure how the code I wrote integrated with fili. However, I do remember that computing the initial filter state wasn't as effective as I'd hope at reducing ringing at the beginning of the data stream in the app I was building.

I wouldn't recommend bothering going further with this idea unless you know what you're doing when ti comes to linear filter designs, but if you're interested, the computeInitialState function I wrote is functionally equivalent to this function from scipy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter_zi.html

@markert
Copy link
Owner

markert commented Oct 30, 2018

At the moment there is no way to set the initial state of the filter other than 0. I could however integrate an interface that lets you do that. You can then use whatever calculation method you like to set the initial state.

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

3 participants