2. Signal Preprocessing for Correlation: Filtering and Resampling
Why Preprocessing Decides the Correlation Outcome
In a test-vs-CAE correlation workflow, the raw time histories rarely share the same sampling rate, and the test channel almost always carries broadband noise that the CAE solver never produced. If you feed both signals directly into a CORA evaluation, the metric will penalize differences that are artifacts of acquisition and post-processing rather than physics. This case establishes a disciplined preprocessing stage: a low-pass anti-aliasing filter applied consistently, a resampling step that brings both signals onto a common time base, and a controlled experiment that quantifies how filter cutoff and resampling choices move the CORA scorecard.
The guiding principle is symmetry: any filter or resampler applied to the test signal must be applied to the CAE signal with equivalent passband and phase behavior, otherwise you introduce a systematic bias that masquerades as a modeling error. The second principle is traceability: every preprocessing parameter (cutoff frequency, filter order, target rate, interpolation method) must be recorded alongside the CORA result so the scorecard can be reproduced.
Establishing the Common Time Base
Assume a representative pair of channels from a road-load durability event. The test accelerometer was logged at 5120 Hz; the CAE response was exported at 2000 Hz. The physical content of interest sits below 400 Hz, and the test channel shows visible high-frequency hash above 600 Hz that is sensor/amplifier noise, not structural response.
| Property | Test signal | CAE signal |
|---|---|---|
| Original sampling rate | 5120 Hz | 2000 Hz |
| Record length | 4.0 s | 4.0 s |
| Bandwidth of interest | 0–400 Hz | 0–400 Hz |
| Known contamination | Broadband noise > 600 Hz | None (solver output) |
| Target common rate | 1000 Hz (≥ 2.5× the 400 Hz band) | |
The target rate of 1000 Hz satisfies the Nyquist criterion for the 400 Hz band with margin, and it is an integer divisor relationship that keeps resampling interpolation clean. Choosing a target below the CAE native rate avoids upsampling the simulation, which would add no information.
Filter Design: Anti-Aliasing Before Decimation
Because the test signal will be decimated from 5120 Hz to 1000 Hz, an anti-aliasing low-pass filter must run before the rate change. A zero-phase Butterworth filter (forward-backward filtering, filtfilt) is preferred so that no group delay is introduced — group delay would shift the test signal relative to CAE and corrupt the time-domain CORA component. The cutoff is set at 450 Hz: above the 400 Hz band of interest, but comfortably below the 500 Hz Nyquist limit of the 1000 Hz target rate.
import numpy as np
from scipy import signal
def preprocess(x, fs_in, fs_out, fc, order=4):
# 1. Anti-alias low-pass at the input rate (zero-phase)
sos = signal.butter(order, fc, btype="low", fs=fs_in, output="sos")
x_filt = signal.sosfiltfilt(sos, x)
# 2. Resample to the common rate
n_out = int(round(len(x_filt) * fs_out / fs_in))
x_out = signal.resample_poly(x_filt, fs_out, fs_in)
return x_out[:n_out]
fs_test, fs_cae, fs_common = 5120, 2000, 1000
fc = 450.0
test_pp = preprocess(test_raw, fs_test, fs_common, fc)
cae_pp = preprocess(cae_raw, fs_cae, fs_common, fc)
assert len(test_pp) == len(cae_pp), "time bases must match"
Note that the same fc and order are applied to both channels. Applying the filter only to the test signal would attenuate the test's genuine 400–450 Hz content while leaving the CAE content intact, creating a false amplitude mismatch in that band.
Quantifying the Effect on CORA
To make the preprocessing choice defensible, run a small parameter sweep and record the CORA score for each configuration. The table below shows the expected direction of the effect for a representative case; the actual numbers must be produced by running the sweep on your own data, not assumed.
| Configuration | Filter | Target rate | Expected CORA behavior |
|---|---|---|---|
| A — raw, no preprocessing | None | Mismatched | Low score; noise inflates residual, rate mismatch blocks evaluation |
| B — filter only, no resample | 450 Hz, order 4 | Mismatched | Noise removed but time base still invalid |
| C — resample only | None | 1000 Hz | Aliased noise contaminates band; score unstable |
| D — filter + resample (recommended) | 450 Hz, order 4 | 1000 Hz | Highest stable score; residual reflects physics |
| E — over-filter | 200 Hz, order 4 | 1000 Hz | Score drops; genuine 200–400 Hz response removed |
Configuration E is the critical control: it demonstrates that filtering is not "more is better." If the CORA score falls when you tighten the cutoff below the band of interest, you have removed real signal and the score is no longer a fair measure of model fidelity. The recommended cutoff is the lowest frequency that still suppresses out-of-band noise while leaving the analysis band untouched.
Verification and Failure Symptoms
After preprocessing, verify three things before trusting any CORA number. First, confirm the two arrays have identical length and a shared time vector — a length mismatch means the resampling ratio was computed incorrectly. Second, inspect the power spectral density of both preprocessed signals: the test PSD should now roll off above 450 Hz and match the CAE roll-off in the analysis band; a residual noise floor above 500 Hz on the test channel indicates the filter was applied after decimation or with too high a cutoff. Third, check the time-domain overlay near sharp transients — if the test signal appears shifted relative to CAE, the filter introduced phase distortion (likely because a causal filter was used instead of filtfilt).
- Score collapses after filtering: cutoff set below the band of interest — raise
fcback toward 450 Hz. - Noise still visible in PSD above Nyquist/2: filter applied after resampling — reorder to filter-then-resample.
- Systematic time offset appears: causal filter used — switch to zero-phase forward-backward filtering.
- Length mismatch assertion fires: non-integer resampling ratio — use
resample_polywith integer up/down factors and trim to the shorter length.
Once configuration D is confirmed — matched lengths, clean PSD roll-off, no phase shift — the preprocessed pair is ready for the synchronization and amplitude-correction stages that follow, and the CORA scorecard now reflects model fidelity rather than acquisition artifacts.