Problem: Structural Health Vibration Signal Processing Toolkit

The problem focuses on building a mechanical vibration sensor signal processing system for structural health monitoring, which needs to reliably process raw telemetry data, resist outlier interference and signal noise, compute key structural state metrics, and generate valid performance evaluation indicators to support accurate structural safety assessment.


Input/Output: The problem accepts four categories of input data: 1) Mechanical vibration sensor time series data, formatted as a list of float lists, numpy ndarray, or scipy sparse matrix, representing multi-node temporal vibration readings. 2) Signal batch, a nested list of numeric temporal slices of multi-node sensor readings supporting both real and complex values. 3) 1D numeric filter coefficient sequence, plus a coupling matrix that can be a dense nested list or scipy sparse matrix. 4) 1D numeric expected amplitude vector, plus a positive integer specifying trial configuration count. All inputs first run validity and dimension validation, with corresponding errors raised for invalid entries. The problem generates four corresponding outputs sequentially: 1) A float list of per-node steady-state baseline estimates. 2) An unbiased inter-node coupling tensor as a nested list. 3) A non-negative float scalar for energy dispersion. 4) A list of (gain, jitter) float pairs mapping the stability performance envelope. Each output maps to its input group after the specified robust signal processing and statistical computation operations.

Required dependencies:

Sub-steps:
step_number: 1
step_description_prompt: Please use Python to generate a function named forecast_baseline_oscillations. It estimates steady-state baseline of mechanical vibration sensor time series, accepts list, numpy array or sparse matrix as input. Combine AR(1) drift model and Huber robust M-estimator, blend 60% drift prediction and 40% robust center, return per-node baseline value list.
function_header: def forecast_baseline_oscillations(time_series_sensor_data: Union[List[List[float]], np.ndarray, sparse.spmatrix]) -> List[float]:
test_cases: sensor_data1 = [[100, 101, 102], [200, 199, 201]]
result1 = forecast_baseline_oscillations(sensor_data1)
assert len(result1) == 2
assert all(isinstance(x, float) for x in result1)

# Static sensor data (should return near zero)
sensor_data2 = [[150, 150, 150], [250, 250, 250]]
result2 = forecast_baseline_oscillations(sensor_data2)
assert all(abs(x) < 1e-6 for x in result2)


step_number: 2
step_description_prompt: Please use Python code to generate a function named map_inter_node_coupling that takes signal_batch as input. It first validates the input signal batch's structure and data validity, raises errors for invalid inputs, computes inter-node coupling tensor via Welford's method, supports both real and complex signals, returns the unbiased estimate as a nested list.
function_header: def map_inter_node_coupling(signal_batch):
test_cases: 
signal_batch1 = [[1.0, 2.0], [1.1, 2.1], [0.9, 1.9]]
coupling1 = map_inter_node_coupling(signal_batch1)
assert len(coupling1) == 2 and len(coupling1[0]) == 2
assert abs(coupling1[0][1] - coupling1[1][0]) < 1e-10  # symmetry check

signal_batch1 = [[1.0, 2.0], [1.1, 2.1], [0.9, 1.9]]
coupling1 = map_inter_node_coupling(signal_batch1)
assert len(coupling1) == 2 and len(coupling1[0]) == 2
assert abs(coupling1[0][1] - coupling1[1][0]) < 1e-10  # symmetry check

step_number: 3
step_description_prompt: Please use Python code to generate a function named quantify_energy_dispersion. The function takes filter_coefficients and coupling_matrix as inputs, supports both sparse and dense coupling matrix processing, completes data validation, symmetry adjustment, diagonal regularization, computes quadratic form result, and finally returns a non-negative energy dispersion scalar.
function_header: def quantify_energy_dispersion(filter_coefficients, coupling_matrix):
test_cases: 

weights1 = [0.5, 0.5]
coupling2 = [[1.0, 0.5], [0.5, 1.0]]
dispersion1 = quantify_energy_dispersion(weights1, coupling2)
assert dispersion1 > 0

weights2 = [0.0, 0.0]
dispersion2 = quantify_energy_dispersion(weights2, coupling2)
assert abs(dispersion2) < 1e-10


step_number: 4
step_description_prompt: Please use Python to write a function named map_stability_performance_envelope.
It takes expected_amplitudes, coupling_matrix (supports both sparse and dense formats) and positive integer trial_configurations as inputs. First run input validation, process the coupling matrix to symmetric positive definite, generate stochastic trial weights via Dirichlet sampling, compute and return a list of gain-jitter pairs.
function_header: def map_stability_performance_envelope(expected_amplitudes, coupling_matrix, trial_configurations):
test_cases: amplitudes1 = [1.0, 0.8]
coupling3 = [[1.0, 0.2], [0.2, 1.0]]
envelope1 = map_stability_performance_envelope(amplitudes1, coupling3, 5)
assert len(envelope1) == 5
for gain, jitter in envelope1:
    assert isinstance(gain, float)
    assert isinstance(jitter, float)
    assert jitter >= 0

General solution:

General tests: