--- source_files: - Common/DTS.Common.Calculations/ChannelData.cs - Common/DTS.Common.Calculations/Integral.cs - Common/DTS.Common.Calculations/Resultant.cs - Common/DTS.Common.Calculations/HeadInjuryCriterion.cs generated_at: "2026-04-17T16:03:17.838159+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "f8b0959de0ed6cde" --- # DTS.Common.Calculations ### Purpose This module provides mathematical calculation utilities for signal processing and injury analysis. It supports integration of time-series data, generation of resultant vectors from multi-axis inputs, and computation of the Head Injury Criterion (HIC) used in impact analysis. The module is designed to work with filtered engineering unit data from sensor channels. ### Public Interface **ChannelData** - `string Units { get; }` - Engineering units of the data (read-only, set via constructor). - `double[] FilteredEU { get; set; }` - Pre-filtered engineering unit data array. - `ChannelData(string units)` - Constructor accepting engineering units string. **Integral** (static class) - `static double DefiniteIntegral(double[] input, int start, int end, double SPS)` - Computes definite integral using trapezoidal summation. Parameters: input data array, start index (inclusive), end index (inclusive), samples per second. Returns integrated value. **Resultant** (static class) - `static ChannelData GenerateResultantChannel(List channels)` - Generates a resultant vector channel from input channels using sum-of-squares method. Returns new `ChannelData` with sqrt(Σxi²) values. Asserts all channels have same length and units. **HeadInjuryCriterion** - `static HICResult GetHeadInjuryCriterion(ChannelData resultant, double SPS, int clipLengthMS)` - Calculates maximum HIC over the input data for the specified clip length. Returns `HICResult` with max HIC value and sample indices. - **HICResult** (nested class) - `int StartSample { get; }` - Start sample index of max HIC window. - `int EndSample { get; }` - End sample index of max HIC window. - `int HicLengthMS { get; }` - HIC window length in milliseconds. - `double HIC { get; }` - The HIC value. - `HICResult(double hic, int hicLength, int startSample, int endSample)` - Constructor. ### Invariants - `DefiniteIntegral` assumes input data is tightly time-aligned (uniform sampling interval). - `GenerateResultantChannel` asserts all input channels have identical `FilteredEU.Length` and identical `Units`. - `GetHeadInjuryCriterion` requires `SPS > 0` and `clipLengthMS > 0` (asserted). - `GetHeadInjuryCriterion` asserts data length is at least `clipLengthMS` worth of samples. - HIC calculation uses the formula: `hic = clipInSeconds * (integral / clipInSeconds)^2.5` ### Dependencies - **Depends on**: `System`, `System.Collections.Generic`, `System.Linq` - **Depended on by**: Unc