NaN-aware zero-phase filtering¶
What it does¶
This utility applies forward-backward zero-phase filtering while interpolating short internal NaN gaps and preserving long missing spans.
When to use it¶
Use it for offline processing when phase preservation matters and short missing gaps may be bridged. It is not suitable for real-time causal processing.
Canonical ID: tools.nan_filtfilt
Inputs¶
| Name | Meaning | Type | Unit | Requirements |
|---|---|---|---|---|
numerator_coefficients |
Numerator coefficients of the digital filter. | real vector | 1 | minimum length: 1; no NaN; finite |
denominator_coefficients |
Denominator coefficients of the digital filter. | real vector | 1 | minimum length: 1; no NaN; finite |
signal |
Signal to filter, optionally containing missing-value gaps. | real vector | a.u. | NaN allowed; finite |
Parameters¶
| Name | Meaning | Type | Unit | Default | Requirements |
|---|---|---|---|---|---|
max_gap |
Largest internal NaN gap that will be interpolated before filtering. | integer scalar | sample | 0 |
minimum: 0 |
Outputs¶
| Name | Meaning | Type | Unit |
|---|---|---|---|
filtered_signal |
Zero-phase filtered signal with long missing spans preserved. | real vector | a.u. |
How it works¶
Short internal gaps are interpolated before filtering. Long gaps split the signal into independent finite segments. Each sufficiently long segment is filtered forward and backward without using samples across a missing span.
Interpretation and limitations¶
Short segments may be impossible to filter with the requested coefficients. Interpolation and forward-backward edge handling can affect samples near gaps and segment boundaries.