Statistical Methods
Review Edge Effects Before Using Zero-Phase Filtering
Define the task
Forward-backward filtering applies a filter in both directions to a recorded sequence. It is an offline operation that uses later observations, so it must not be presented as a real-time predictor. Decide whether removing phase delay is compatible with the scientific question. Preserve the original signal and record sampling rate, filter design, second-order-section coefficients, axis and padding settings.
Carry out the check
Check that the series is long enough for the selected padding length. Compare the ends with the interior and repeat a justified edge-sensitivity analysis. Forward-backward application changes the magnitude response as well as phase: it is not equivalent to merely shifting a one-pass trace. A visually smooth result does not prove event timing or amplitudes are preserved. Do not choose the padding or cutoff by whichever result best supports a hypothesis. Describe any excluded boundary region and retain the unfiltered values for inspection.
Worked hypothetical example
Hypothetical arithmetic check: if a one-pass filter has magnitude gain 0.5 at a frequency, the ideal forward-backward magnitude is 0.25 at that frequency, away from finite-record edge effects. A component with original amplitude 4 would have amplitude 1 under that idealized response. This is not a simulation of endpoint behavior. It illustrates why the final response must be checked against the scientific specification rather than quoting the one-pass design alone.
Method checked 24 November 2026 against primary documentation: signal.sosfiltfilt.