File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,12 @@ class IIRFilter:
14
14
this generalized N-order function was made.
15
15
16
16
Using the following transfer function
17
- .. math:: H(z)=\frac{b_{0}+b_{1}z^{-1}+b_{2}z^{-2}+...+b_{k}z^{-k}}{a_{0}+a_{1}z^{-1}+a_{2}z^{-2}+...+a_{k}z^{-k}}
17
+ .. math:: H(z)=\frac{b_{0}+b_{1}z^{-1}+b_{2}z^{-2}+...+b_{k}z^{-k}}
18
+ {a_{0}+a_{1}z^{-1}+a_{2}z^{-2}+...+a_{k}z^{-k}}
18
19
19
20
we can rewrite this to
20
- .. math:: y[n]={\frac{1}{a_{0}}}\left(\left(b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]+...+b_{k}x[n-k]\right)-\left(a_{1}y[n-1]+a_{2}y[n-2]+...+a_{k}y[n-k]\right)\right)
21
+ .. math:: y[n]={\frac{1}{a_{0}}}\left(\left(b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]+...+b_{k}x[n-k]\right)-
22
+ \left(a_{1}y[n-1]+a_{2}y[n-2]+...+a_{k}y[n-k]\right)\right)
21
23
"""
22
24
23
25
def __init__ (self , order : int ) -> None :
@@ -35,7 +37,8 @@ def __init__(self, order: int) -> None:
35
37
36
38
def set_coefficients (self , a_coeffs : list [float ], b_coeffs : list [float ]) -> None :
37
39
"""
38
- Set the coefficients for the IIR filter. These should both be of size `order` + 1.
40
+ Set the coefficients for the IIR filter.
41
+ These should both be of size `order` + 1.
39
42
:math:`a_0` may be left out, and it will use 1.0 as default value.
40
43
41
44
This method works well with scipy's filter design functions
You can’t perform that action at this time.
0 commit comments