Filter
======
An IIR filter: Butterworth, Chebyshev I/II or Bessel; lowpass, highpass, bandpass or bandstop. Tustin with prewarped edges by default, so the cutoff is exact at any step.
``filter`` · control · element by element: vectors in, vectors out
.. raw:: html
Filterfn
familybutterworth
kindlowpass
order2
cutoff Hz10
cutoff2 Hz20
ripple dB1
attenuation dB40
realizetustin
sample_time s0
startzero
solverauto
.. container:: pb-prose
``family`` (``butterworth``, ``chebyshev1``, ``chebyshev2``, ``bessel``), ``kind`` (``lowpass``,
``highpass``, ``bandpass``, ``bandstop``), ``order`` 1–10, ``cutoff`` and ``cutoff2`` in Hz, ``ripple``
and ``attenuation``. It matches SciPy's ``butter``, ``cheby1``, ``cheby2`` and ``bessel(norm="mag")``.
Inputs
------
.. list-table::
:header-rows: 1
* - Port
- Type
- Unit
- Components
* - ``u``
- signal
- —
- —
Outputs
-------
.. list-table::
:header-rows: 1
* - Port
- Type
- Unit
- Components
* - ``y``
- signal
- —
- —
Parameters
----------
.. list-table::
:header-rows: 1
* - Param
- Type
- Default
- Options or unit
* - ``family``
- enum
- ``"butterworth"``
- ``butterworth``, ``chebyshev1``, ``chebyshev2``, ``bessel``
* - ``kind``
- enum
- ``"lowpass"``
- ``lowpass``, ``highpass``, ``bandpass``, ``bandstop``
* - ``order``
- number
- ``2.0``
- —
* - ``cutoff``
- number
- ``10.0``
- Hz
* - ``cutoff2``
- number
- ``20.0``
- Hz
* - ``ripple``
- number
- ``1.0``
- dB
* - ``attenuation``
- number
- ``40.0``
- dB
* - ``realize``
- enum
- ``"tustin"``
- ``solver``, ``tustin``
* - ``sample_time``
- number
- ``0.0``
- s
* - ``start``
- enum
- ``"zero"``
- ``zero``, ``steady``
* - ``solver``
- enum
- ``"auto"``
- ``auto``, ``rk4``, ``rk45``, ``rk2``, ``euler``, ``discrete``