filtered_time = spike_patch.hampel_filter(time=0.02, threshold=3.5)ax = filtered_time.viz.waterfall(**plot_kwargs)ax.set_title("Filtered along Time (threshold=3.5)");
Warning
Large exact windows (approximate=False) are expensive because cost grows with window area. The default approximation is nearly insensitive to window size.
Multiple dimensions
Include distance to remove channel-wide spikes:
filtered_2d = spike_patch.hampel_filter(time=0.02, distance=5.0, threshold=3.5)ax = filtered_2d.viz.waterfall(**plot_kwargs)ax.set_title("Filtered along Time and Distance");
Start with thresholds of 3.5–5 and odd windows of 5, 7, or 9 samples per dimension (samples=True), then inspect the result. Use exact medians only when the approximation is insufficient.