-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Filter State variable access with Python Wrapper #1129
Comments
Thanks for the feedback. I had never thought that it may be useful except for being able to call the filter several time. And, this is possible since the state is preserved and contained in the state variable arm_biquad_cascade_df2T_instance_f32. But it is not readable from the Python. So I need to add a Python API to enable this. I'll look at it. I cannot share any timeline because before looking at it I don't know how much time it will require. |
@LukeGary462 I have pushed a new commit (d08d049) which should solve the issue. Now you can do goertzel.state() to get the state array. Note it is returning a copy of the internal state. You can't change the internal state array. It is implemented only for arm_biquad_cascade_df2T_instance_f32. Other filters are not (yet) supported. Tell me if it works. |
Thanks @christophe0606 ! I will give this a shot today |
@christophe0606 This seems to have done the trick, than you! |
Don't hesitate to reopen the issue if there are problems with the solution. |
I am in the process of prototyping some algorithms using the python wrapper for the biquad direct form two transposed filters, and notice that the state variables for a filter instance are not accessible via the wrapper.
I found this to be surprising since a list of state variables is used when initializing the filter, but according to Christophe, they are only used for initialization.
It would be useful to have access to these for things like system identification, goertzel or sliding DFT, or real-time filtering using the cmsis dsp library.
This would be a great feature to see!
below is the code I am using to test a float32 biquad for goertzel filtering, which requires state variable access for phase, and magnitude calculation. Please excuse the code, its more of a stream of consciousness 😄
The text was updated successfully, but these errors were encountered: