Python / Scipy filter discretization
Asked Answered
T

2

6

I am currently trying to move from Matlab to Python and succeeded in several aspects. However, one function in Matlab's Signal Processing Toolbox that I use quite regularly is the impinvar function to calculate a digital filter from its analogue version.

In Scipy.signal I only found the bilinear function to do something similar. But, in contrast to the Matlab bilinear function, it does not take an optional argument to do some pre-warping of the frequencies. I did not find any impinvar (impulse invariance) function in Scipy.

Before I now start to code it myself I'd like to ask whether there is something that I simply overlooked? Thanks.

Trophozoite answered 14/2, 2013 at 7:45 Comment(3)
Why not implement the pre-warp yourself? Replace fs with pi*fp/fsRiffe
I don't think it exists. I was looking for it, too. If you write it, will you post the code online?Olathe
Doing the pre-warp myself is not a problem, that's true. However, I would prefer the impulse invariance technique, because I experienced much smaller discretization error for my applications.Trophozoite
V
2

There is a Python translation of the Octave impinvar function in the PyDynamic package which should be equivalent to the Matlab version.

Varsity answered 23/12, 2019 at 19:9 Comment(1)
Many thanks for this answer! I should have done this long time ago myself. The implementation you've mentioned was done by myself - the PyDynamic package is maintained by me.Trophozoite
S
-1

Dont have enough rep to comment but new PyDynamic package for new readers is here: https://github.com/PTB-M4D/PyDynamic/blob/main/src/PyDynamic/misc/impinvar.py

Sivas answered 13/4, 2023 at 4:55 Comment(1)
You know about the commenting privilege which you do not have, so well that you can even put it into words. You are aware of the rule meta.stackexchange.com/questions/214173/… . In that situation please do not decide to misuse a different mechanism (an answer) for something it is not meant for and which you are not allowed yet to do.Ordinary

© 2022 - 2024 — McMap. All rights reserved.