2. Baseline Drift Removal Using High-Pass Filtering

Why Baseline Drift Corrupts Crash Metrics

In a crash acceleration record, the quantity of interest is the transient pulse: the sharp rise to peak deceleration and the subsequent crash pulse shape. Baseline drift is a slow, low-frequency offset superimposed on that pulse — typically caused by sensor thermal transients, charge-amplifier leakage, seat-rail mounting compliance, or post-processing integration of a slightly biased signal. Because crash metrics such as peak acceleration, pulse duration, and Δv (velocity change, obtained by integrating acceleration) are sensitive to any non-zero mean, a drifting baseline can shift the apparent zero crossing, inflate or deflate the integrated velocity, and distort the pulse onset.

The engineering task here is narrow and specific: remove the low-frequency drift with a Butterworth high-pass filter while leaving the initial impact transient intact, then compare several cutoff frequencies to judge whether the filtering has preserved signal integrity. The critical tension is that a high-pass filter removes exactly the low-frequency content that also carries part of the pulse's own energy — push the cutoff too high and the transient is differentiated and its peak is attenuated.

Signal Model and Filter Design

Work with a sampled acceleration channel, a[n], at a known sample rate fs. A representative crash channel uses fs = 10 000 Hz (10 kHz), which is common for accelerometer data acquisition in sled and barrier tests. The drift component is modeled as a slow trend below roughly 1–2 Hz; the impact transient has meaningful energy from a few Hz up to several hundred Hz.

A Butterworth high-pass of order N and cutoff fc is designed in the digital domain. Using a second-order (or cascaded second-order) section keeps the passband maximally flat, which is desirable because it avoids the ripple that a Chebyshev design would introduce into the pulse. The design below uses a zero-phase forward–backward application (filtfilt) so that the transient is not shifted in time — a one-sided filter would delay the pulse and misalign the onset.

import numpy as np
from scipy.signal import butter, filtfilt

fs = 10_000.0          # sample rate, Hz
order = 2              # Butterworth order per section

def highpass_zero_phase(a, fc, fs, order=2):
    """Zero-phase Butterworth high-pass; returns filtered signal."""
    b, a_coef = butter(order, fc / (fs / 2.0), btype="highpass")
    return filtfilt(b, a_coef, a)

# Example: compare three cutoffs on the same record
cutoffs = [0.5, 1.0, 2.0]   # Hz
filtered = {fc: highpass_zero_phase(raw, fc, fs, order) for fc in cutoffs}

Two design choices matter for integrity. First, filtfilt applies the filter twice (forward and backward), which squares the magnitude response — a second-order Butterworth becomes effectively fourth-order in attenuation, and the −3 dB point shifts slightly. Second, the effective passband edge should sit well below the pulse's dominant frequency content; a cutoff of 0.5–2 Hz is a reasonable starting band for a crash pulse whose transient energy begins in the low tens of Hz.

Comparing Cutoffs Against Integrity Criteria

Do not judge the result by eye alone. Compute a small set of integrity metrics for each cutoff and compare them to the raw record:

  • Peak acceleration retention — max(|a_filt|) / max(|a_raw|); a value near 1.0 means the transient peak survived. A drop below roughly 0.98 signals that the cutoff is eating into the pulse.
  • Onset time shift — the sample index of the first crossing of a threshold (e.g., 5 % of peak) before and after filtering; zero-phase filtering should keep this within a sample or two.
  • Residual baseline — the mean of the pre-impact quiet segment (before the pulse) and the post-pulse tail; a good high-pass drives both toward zero.
  • Δv consistency — integrate the filtered and raw signals over the pulse window and compare; large divergence indicates the filter removed pulse energy rather than drift.

The table below shows the kind of comparison you would build (values are illustrative for a synthetic record, not measured data):

Cutoff (Hz)Peak retentionOnset shift (samples)Pre-impact mean (g)Δv deviation
0.50.99900.0020.4 %
1.00.99410.0011.1 %
2.00.97220.0003.8 %

Read the table as a trade-off curve: the lowest cutoff removes the least drift but preserves the pulse best; the highest cutoff cleans the baseline most aggressively but begins to attenuate the peak and bias Δv. The acceptable cutoff is the highest one whose peak retention and Δv deviation stay within your test program's tolerance — commonly a few percent for peak and Δv in comparative work.

Always inspect the pre-impact segment and the post-pulse tail separately. A filter that zeroes the tail but leaves a step at the pulse onset is a sign the cutoff is too high and the transient is being differentiated.

Reading the Filter Behavior

The diagram below shows how the same raw record responds to the three cutoffs: the drift is progressively flattened, but the leading edge of the transient is increasingly steepened and its peak slightly reduced as fc rises. Use it to connect the numeric metrics to the visible waveform change.

High-pass cutoff comparison — drift removal vs. transient preservation time (ms) acceleration (g) raw (drift) fc = 0.5 Hz fc = 1.0 Hz fc = 2.0 Hz impact onset raw with drift 0.5 Hz (best retention) 2.0 Hz (peak attenuated)

Practical Execution and Failure Symptoms

Run the comparison on the full record, but evaluate metrics only over the pulse window plus a short pre-impact quiet segment. A reproducible workflow:

  1. Load the channel and confirm fs; a wrong sample rate silently rescales every cutoff.
  2. Define the pulse window from the raw record (first and last threshold crossings) and a pre-impact quiet segment of at least 50 ms.
  3. Apply highpass_zero_phase for each candidate cutoff and compute the four integrity metrics.
  4. Select the highest cutoff that keeps peak retention and Δv deviation within tolerance; record the chosen fc and order with the dataset.

Typical failure symptoms and their causes: a negative undershoot just after the pulse indicates the cutoff is too high and the filter is differentiating the falling edge; a persistent offset in the pre-impact segment means the cutoff is too low or the drift is non-stationary and needs a higher order; a shifted onset means a one-sided filter was used instead of filtfilt. If the drift is a slow ramp rather than a constant offset, a single high-pass may leave residual curvature — in that case detrending the pre-impact segment before filtering, or raising the order, is the appropriate next step.

Do not report a filtered peak as the "true" peak without stating the cutoff and order. The peak is a function of the filter settings, and a reader reproducing your result needs both to obtain the same number.

Deliverable: Cutoff Selection Record

Keep a short record with each filtered dataset so the choice is auditable. A minimal, fillable form:

FieldExample entry
Channel / test IDACC_CH1 / SLED-2024-017
Sample rate10 000 Hz
Filter type / orderButterworth high-pass, order 2, zero-phase (filtfilt)
Candidate cutoffs tested0.5, 1.0, 2.0 Hz
Selected cutoff1.0 Hz
Peak retention0.994
Δv deviation1.1 %
Pre-impact residual mean0.001 g
Acceptance basisPeak retention ≥ 0.99, Δv deviation ≤ 2 %

With the cutoff selected and recorded, the signal is ready for downstream processing — but note that high-pass filtering alone does not address high-frequency noise; that is a separate, later step, and the two filters must be applied in an order and with settings that do not compound their transient effects.