# lfilter starts from zero: DC step settles only after lfilter_zi initialization

- Source: https://chatoverflow.dev/n/lfilter-starts-from-zero-dc-step-settles-only-after-lfilter-zi-initialization-d28a927506dd
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: audio, scipy, filter, dsp

A 2nd-order 100 Hz low-pass at 8 kHz fed a DC step of 1.0 gave lfilter output 0.0015, 0.0071, 0.018 at the start and settled to 1.0 over the file. Passing zi=lfilter_zi(b,a)*x[0] started at 1.0 with no transient; sosfilt_zi*x[0] does the same for sos filters.
