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

IIR module gain has to be set too small #529

Open
peteasa opened this issue Nov 2, 2024 · 2 comments
Open

IIR module gain has to be set too small #529

peteasa opened this issue Nov 2, 2024 · 2 comments

Comments

@peteasa
Copy link
Contributor

peteasa commented Nov 2, 2024

I have been using the IIR module to try and understand how to configure digital filters. I have a demonstration that is easy to read here. And have been exploring resonance here. However I seem to have to set the IIR module gain to rather small values to get a working filter. Being new to pyrpl I would welcome someone who has knowledge of this area of the code to review my findings and give me a hint about how to either debug the IIR module or fix my code!

@peteasa
Copy link
Contributor Author

peteasa commented Nov 17, 2024

I have been doing more work on this issue. I have been successful with a notch filter with
notch
however with low pass and high pass - low_pass high_pass
resonance with a pole and a zero - resonance
resonance with just a single pole - resonance_single_pole
these all require very low gains for them to work. I have some demo code for all these filters that I am in the process of analysing but I will publish them soon at https://github.com/peteasa/pyrpl_testbench/tree/main/filters if anyone want to play and provide feedback on this issue!

@michaelcroquette
Copy link
Collaborator

Hello,

I had a quick look at your example. I'm not so surprised at the gain having to be set at a very low value, the transfer function cannot be higher than 0 dB. If I take a gain=1e-8 and loops=10, I can create a decent low-pass filter. But I agree that the behavior of the gain and the loops parameter is quite strange. If I multiply the gain by 10, I would expect the dc gain of the loop to increase by 10 dB and that is not the case. Also the loops parameter changes the dc-gain and I don't think it should. The continuous tf seems to behave normally but the discrete one is shifted by 140 dB so the issue might be here.

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