Skip to content

Commit 31839b8

Browse files
committed
Fix
1 parent 8d32927 commit 31839b8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

audio_filters/iir_filter.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ class IIRFilter:
1414
this generalized N-order function was made.
1515
1616
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}}
1819
1920
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)
2123
"""
2224

2325
def __init__(self, order: int) -> None:
@@ -35,7 +37,8 @@ def __init__(self, order: int) -> None:
3537

3638
def set_coefficients(self, a_coeffs: list[float], b_coeffs: list[float]) -> None:
3739
"""
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.
3942
:math:`a_0` may be left out, and it will use 1.0 as default value.
4043
4144
This method works well with scipy's filter design functions

0 commit comments

Comments
 (0)