Skip to content

Commit

Permalink
Update filters.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
777arc authored Aug 10, 2024
1 parent a85a33a commit 41e9ace
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ As an aside, there is one more obscure option for applying the filter to a signa
Stateful Filtering
##################

If you are creating a realtime application and need to call the filtering function on subsequent blocks of samples, you will benefit from your filter being stateful, meaning you provide each call initial conditions that are pulled from the output of the previous call to the filter. This gets rid of transients that occur when a signal starts and stops (after all, the samples you are feeding in during subsequent blocks are contiguous, assuming your application is able to keep up). The state must be saved in between calls, and it also must be initialized at the very start of your code for the sake of the first filter call. Luckily, SciPy includes :code:`lfilter_zi` which construct initial conditions for lfilter. Below shows an example of processing blocks of contiguous samples using stateful filtering:
If you are creating a real-time application and need to call the filtering function on subsequent blocks of samples, you will benefit from your filter being stateful, meaning you provide each call initial conditions that are pulled from the output of the previous call to the filter. This gets rid of transients that occur when a signal starts and stops (after all, the samples you are feeding in during subsequent blocks are contiguous, assuming your application is able to keep up). The state must be saved in between calls, and it also must be initialized at the very start of your code for the sake of the first filter call. Luckily, SciPy includes :code:`lfilter_zi` which construct initial conditions for lfilter. Below shows an example of processing blocks of contiguous samples using stateful filtering:

.. code-block:: python
Expand Down

0 comments on commit 41e9ace

Please sign in to comment.