Skip to content

Commit 183a5e3

Browse files
authored
Change coefficient parameters to use Sequence type
Updated set_coefficients method to accept Sequence types for coefficients.
1 parent 574d100 commit 183a5e3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎audio_filters/iir_filter.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
4+
35

46
class IIRFilter:
57
r"""
@@ -36,8 +38,7 @@ def __init__(self, order: int) -> None:
3638
# y[n-1] ... y[n-k]
3739
self.output_history = [0.0] * self.order
3840

39-
def set_coefficients(self, a_coeffs: list[float], b_coeffs: list[float]) -> None:
40-
"""
41+
def set_coefficients(self, a_coeffs: Sequence[float], b_coeffs: Sequence[float]) -> None:
4142
Set the coefficients for the IIR filter.
4243
These should both be of size `order` + 1.
4344
:math:`a_0` may be left out, and it will use 1.0 as default value.

0 commit comments

Comments
 (0)