hnriiuu/moonbit_forceplate/core does not have a README file

    AxisTransform

    pub struct AxisTransform {
    gain_x : Double
    gain_y : Double
    gain_z : Double
    offset_x : Double
    offset_y : Double
    offset_z : Double
    } derive(Eq,
    Debug
    )

    Per-axis affine transform for sensor gains and offsets.

    AxisTransform::identity

    fn AxisTransform::identity() -> AxisTransform

    AxisTransform::new

    fn AxisTransform::new(gain_x : Double, gain_y : Double, gain_z : Double, offset_x : Double, offset_y : Double, offset_z : Double) -> AxisTransform

    BaselineCalibration

    pub struct BaselineCalibration {
    offset_fx : Double
    offset_fy : Double
    offset_fz : Double
    noise_fx : Double
    noise_fy : Double
    noise_fz : Double
    baseline_samples : Int
    stable : Bool
    } derive(Eq,
    Debug
    )

    Robust baseline estimate for a force plate recording.

    CalibrationDiagnostics

    pub struct CalibrationDiagnostics {
    sample_count : Int
    finite_samples : Int
    saturated_samples : Int
    maximum_abs_force_n : Double
    saturation_limit_n : Double
    } derive(Eq,
    Debug
    )

    Raw-signal diagnostics for sensor saturation and finite data coverage.

    CalibrationParams

    pub struct CalibrationParams {
    gain_fx : Double
    gain_fy : Double
    gain_fz : Double
    offset_fx : Double
    offset_fy : Double
    offset_fz : Double
    plate_origin_z : Double
    } derive(Eq,
    Debug
    )

    Calibration and tare parameters for multi-axis force plate sensors.

    CalibrationParams::default

    CalibrationParams::new

    fn CalibrationParams::new(gain_fx : Double, gain_fy : Double, gain_fz : Double, offset_fx : Double, offset_fy : Double, offset_fz : Double, plate_origin_z : Double) -> CalibrationParams

    Creates explicit axis gains, offsets, and plate origin parameters.

    CoPPoint

    pub struct CoPPoint {
    x : Double
    y : Double
    } derive(Eq,
    Debug
    )

    Center of Pressure (COP) 2D coordinates on the force plate surface.

    CoPPoint::distance_to

    fn CoPPoint::distance_to(self : CoPPoint, other : CoPPoint) -> Double

    CoPPoint::new

    fn CoPPoint::new(x : Double, y : Double) -> CoPPoint

    CoPPoint::zero

    fn CoPPoint::zero() -> CoPPoint

    ForceMagnitudeSummary

    pub struct ForceMagnitudeSummary {
    count : Int
    mean_magnitude_n : Double
    rms_magnitude_n : Double
    peak_magnitude_n : Double
    p95_magnitude_n : Double
    } derive(Eq,
    Debug
    )

    ForceSample

    pub struct ForceSample {
    timestamp : Double
    force : Vec3
    moment : Vec3
    cop : CoPPoint
    } derive(Eq,
    Debug
    )

    Single time-step multichannel force plate sample frame.

    ForceSample::new

    fn ForceSample::new(timestamp : Double, force : Vec3, moment : Vec3, cop : CoPPoint) -> ForceSample

    ForceTrial

    pub struct ForceTrial {
    metadata : TrialMetadata
    samples : Array[ForceSample]
    } derive(Eq,
    Debug
    )

    A continuous sequence of force plate samples representing a single trial recording.

    ForceTrial::apply_calibration

    fn ForceTrial::apply_calibration(self : ForceTrial, cal : CalibrationParams) -> ForceTrial

    ForceTrial::duration

    fn ForceTrial::duration(self : ForceTrial) -> Double

    ForceTrial::get_cop_points

    fn ForceTrial::get_cop_points(self : ForceTrial) -> Array[CoPPoint]

    ForceTrial::get_fx

    fn ForceTrial::get_fx(self : ForceTrial) -> Array[Double]

    ForceTrial::get_fy

    fn ForceTrial::get_fy(self : ForceTrial) -> Array[Double]

    ForceTrial::get_fz

    fn ForceTrial::get_fz(self : ForceTrial) -> Array[Double]

    ForceTrial::get_timestamps

    fn ForceTrial::get_timestamps(self : ForceTrial) -> Array[Double]

    ForceTrial::length

    fn ForceTrial::length(self : ForceTrial) -> Int

    ForceTrial::new

    fn ForceTrial::new(metadata : TrialMetadata, samples : Array[ForceSample]) -> ForceTrial

    ForceTrial::slice

    fn ForceTrial::slice(self : ForceTrial, start_idx : Int, end_idx : Int) -> ForceTrial

    ForceTrial::zero_tare

    fn ForceTrial::zero_tare(self : ForceTrial, baseline_samples_cnt : Int) -> ForceTrial

    Matrix3x3

    pub struct Matrix3x3 {
    m00 : Double
    m01 : Double
    m02 : Double
    m10 : Double
    m11 : Double
    m12 : Double
    m20 : Double
    m21 : Double
    m22 : Double
    } derive(Eq,
    Debug
    )

    Represents a 3x3 Matrix for 3D coordinate transformations and rotation.

    Matrix3x3::determinant

    fn Matrix3x3::determinant(self : Matrix3x3) -> Double

    Computes determinant of a 3x3 matrix.

    Matrix3x3::identity

    fn Matrix3x3::identity() -> Matrix3x3

    Matrix3x3::inverse

    fn Matrix3x3::inverse(self : Matrix3x3) -> Matrix3x3

    Inverts a 3x3 matrix if non-singular.

    Matrix3x3::new

    fn Matrix3x3::new(m00 : Double, m01 : Double, m02 : Double, m10 : Double, m11 : Double, m12 : Double, m20 : Double, m21 : Double, m22 : Double) -> Matrix3x3

    Matrix3x3::transform_vec

    fn Matrix3x3::transform_vec(self : Matrix3x3, v : Vec3) -> Vec3

    MetadataValidation

    pub struct MetadataValidation {
    is_valid : Bool
    flags : Array[String]
    } derive(
    Debug
    )

    Validation result for trial metadata received from an acquisition system.

    SampleRange

    pub struct SampleRange {
    start : Int
    end : Int
    } derive(Eq,
    Debug
    )

    An inclusive-exclusive index range clamped to an array length.

    SignalAgreement

    pub struct SignalAgreement {
    sample_count : Int
    mean_absolute_error : Double
    mean_squared_error : Double
    root_mean_squared_error : Double
    mean_bias : Double
    correlation : Double
    maximum_absolute_error : Double
    } derive(Eq,
    Debug
    )

    Agreement statistics for two synchronized measurement channels.

    SignalSummary

    pub struct SignalSummary {
    count : Int
    mean : Double
    standard_deviation : Double
    minimum : Double
    maximum : Double
    median : Double
    first_quartile : Double
    third_quartile : Double
    interquartile_range : Double
    rms : Double
    finite_fraction : Double
    } derive(Eq,
    Debug
    )

    Descriptive statistics for one finite signal. Non-finite samples are excluded from all numeric estimates while count records usable samples.

    TimebaseSummary

    pub struct TimebaseSummary {
    sample_count : Int
    interval_count : Int
    positive_intervals : Int
    duration_s : Double
    mean_dt_s : Double
    median_dt_s : Double
    min_dt_s : Double
    max_dt_s : Double
    nominal_rate_hz : Double
    monotonic : Bool
    } derive(Eq,
    Debug
    )

    Summary of timestamp spacing in a force plate recording.

    TrialFeatureSummary

    pub struct TrialFeatureSummary {
    sample_count : Int
    duration_s : Double
    sampling_rate_hz : Double
    body_mass_kg : Double
    force : SignalSummary
    cop_path_length : Double
    cop_mean_x : Double
    cop_mean_y : Double
    cop_range_x : Double
    cop_range_y : Double
    missing_cop_fraction : Double
    } derive(Eq,
    Debug
    )

    Feature vector shared by quality dashboards and downstream pipelines.

    TrialMetadata

    pub struct TrialMetadata {
    subject_id : String
    sampling_rate : Double
    nominal_body_mass : Double
    side : String
    } derive(Eq,
    Debug
    )

    Trial metadata describing sampling rate, subject body mass estimate, and side.

    TrialMetadata::new

    fn TrialMetadata::new(subject_id : String, sampling_rate : Double, nominal_body_mass : Double, side : String) -> TrialMetadata

    TrialShapeReport

    pub struct TrialShapeReport {
    sample_count : Int
    finite_force_samples : Int
    finite_cop_samples : Int
    monotonic_timestamps : Bool
    finite_timestamps : Int
    duration_s : Double
    sampling_rate_hz : Double
    first_bad_timestamp_index : Int
    is_usable : Bool
    } derive(Eq,
    Debug
    )

    Structural validation for a complete force plate trial.

    Vec3

    pub struct Vec3 {
    x : Double
    y : Double
    z : Double
    } derive(Eq,
    Debug
    )

    Represents a 3D vector for ground reaction forces, centers, or moments.

    Vec3::add

    fn Vec3::add(self : Vec3, other : Vec3) -> Vec3

    Vec3::dot

    fn Vec3::dot(self : Vec3, other : Vec3) -> Double

    Vec3::magnitude

    fn Vec3::magnitude(self : Vec3) -> Double

    Vec3::new

    fn Vec3::new(x : Double, y : Double, z : Double) -> Vec3

    Vec3::scale

    fn Vec3::scale(self : Vec3, factor : Double) -> Vec3

    Vec3::sub

    fn Vec3::sub(self : Vec3, other : Vec3) -> Vec3

    Vec3::zero

    fn Vec3::zero() -> Vec3

    WindowFeature

    pub struct WindowFeature {
    start_idx : Int
    end_idx : Int
    duration_s : Double
    summary : SignalSummary
    area : Double
    peak_index : Int
    time_to_peak_s : Double
    slope_to_peak : Double
    zero_crossings : Int
    } derive(Eq,
    Debug
    )

    Features computed for one timestamped signal window.

    apply_baseline_tare

    fn apply_baseline_tare(trial : ForceTrial, baseline : BaselineCalibration) -> ForceTrial

    Applies robust baseline offsets while preserving the trial timebase.

    autocorrelation

    fn autocorrelation(values : Array[Double], lag : Int) -> Double

    Normalized autocorrelation at a non-negative integer lag.

    clamp_range

    fn clamp_range(length : Int, start : Int, end : Int) -> SampleRange

    Clamps an index range without ever producing an invalid array access range.

    coefficient_of_variation

    fn coefficient_of_variation(values : Array[Double]) -> Double

    Coefficient of variation, expressed as a unitless ratio.

    compare_signals

    fn compare_signals(reference : Array[Double], measured : Array[Double]) -> SignalAgreement

    Compares finite pairs with an unbiased Pearson correlation estimate.

    compute_force_magnitude_series

    fn compute_force_magnitude_series(trial : ForceTrial) -> Array[Double]

    compute_kurtosis

    fn compute_kurtosis(arr : Array[Double]) -> Double

    Computes Kurtosis of an array distribution.

    compute_max

    fn compute_max(arr : Array[Double]) -> Double

    compute_mean

    fn compute_mean(arr : Array[Double]) -> Double

    compute_min

    fn compute_min(arr : Array[Double]) -> Double

    compute_rms

    fn compute_rms(arr : Array[Double]) -> Double

    Computes Root Mean Square (RMS) of an array.

    compute_signal_agreement_score

    fn compute_signal_agreement_score(reference : Array[Double], measured : Array[Double], tolerance : Double) -> Double

    Maps mean absolute error to a bounded 0--100 agreement score.

    compute_skewness

    fn compute_skewness(arr : Array[Double]) -> Double

    Computes Skewness of an array distribution.

    compute_sliding_signal_features

    fn compute_sliding_signal_features(timestamps : Array[Double], values : Array[Double], window_samples : Int, step_samples : Int) -> Array[WindowFeature]

    Computes overlapping signal windows with deterministic tail handling.

    compute_std_dev

    fn compute_std_dev(arr : Array[Double]) -> Double

    compute_window_features

    fn compute_window_features(timestamps : Array[Double], values : Array[Double], start_idx : Int, end_idx : Int) -> WindowFeature

    Computes integral, extrema, timing, slope, and crossing features safely.

    copy_range

    fn copy_range(values : Array[Double], start : Int, end : Int) -> Array[Double]

    Copies a clamped range. The source array is not changed.

    count_finite

    fn count_finite(values : Array[Double]) -> Int

    Counts values that are neither NaN nor positive/negative infinity.

    estimate_baseline_calibration

    fn estimate_baseline_calibration(trial : ForceTrial, baseline_samples : Int, stability_threshold_n : Double) -> BaselineCalibration

    Estimates tare offsets with medians and noise with scaled MAD.

    estimate_sample_rate

    fn estimate_sample_rate(timestamps : Array[Double]) -> Double

    Estimates the sampling rate from a monotonic timestamp sequence.

    extract_cop_window

    fn extract_cop_window(trial : ForceTrial, start : Int, end : Int) -> Array[CoPPoint]

    Copies COP samples in a safe, half-open window.

    extract_force_window

    fn extract_force_window(trial : ForceTrial, start : Int, end : Int) -> Array[Double]

    Copies the vertical force samples in a safe, half-open window.

    format_metadata_csv

    fn format_metadata_csv(metadata : TrialMetadata) -> String

    Compact CSV row for provenance logs.

    format_metadata_json

    fn format_metadata_json(metadata : TrialMetadata) -> String

    JSON-compatible metadata object for machine-readable provenance.

    format_metadata_summary

    fn format_metadata_summary(metadata : TrialMetadata) -> String

    Stable one-line metadata representation for logs and benchmark provenance.

    inspect_calibration

    fn inspect_calibration(trial : ForceTrial, saturation_limit_n : Double) -> CalibrationDiagnostics

    lagged_correlation

    fn lagged_correlation(reference : Array[Double], measured : Array[Double], lag : Int) -> Double

    Correlates two channels with a non-negative integer sample lag.

    mad

    fn mad(values : Array[Double]) -> Double

    Returns the median absolute deviation from the median.

    mean_in_range

    fn mean_in_range(values : Array[Double], start : Int, end : Int) -> Double

    Computes the finite mean over a clamped range.

    median

    fn median(values : Array[Double]) -> Double

    Returns the median of finite values, or zero when no finite value exists.

    median_in_range

    fn median_in_range(values : Array[Double], start : Int, end : Int) -> Double

    Returns the median inside an inclusive-exclusive range.

    metadata_flag_summary

    fn metadata_flag_summary(validation : MetadataValidation) -> String

    Joins validation flags into a stable diagnostic string.

    metadata_has_subject_id

    fn metadata_has_subject_id(metadata : TrialMetadata) -> Bool

    metadata_is_bilateral

    fn metadata_is_bilateral(metadata : TrialMetadata) -> Bool

    metadata_is_complete

    fn metadata_is_complete(metadata : TrialMetadata) -> Bool

    metadata_is_physical

    fn metadata_is_physical(metadata : TrialMetadata) -> Bool

    metadata_is_unilateral

    fn metadata_is_unilateral(metadata : TrialMetadata) -> Bool

    metadata_sampling_period_s

    fn metadata_sampling_period_s(metadata : TrialMetadata) -> Double

    Returns the nominal sample period in seconds, or zero for invalid rates.

    metadata_side_code

    fn metadata_side_code(metadata : TrialMetadata) -> Int

    metadata_side_name

    fn metadata_side_name(metadata : TrialMetadata) -> String

    normalize_minmax

    fn normalize_minmax(values : Array[Double]) -> Array[Double]

    Linearly maps finite values to [0, 1]. Constant signals map to zero.

    project_force_series

    fn project_force_series(trial : ForceTrial, axis : Vec3) -> Array[Double]

    Projects each force vector onto a normalized axis; a zero axis gives zero.

    quantile

    fn quantile(values : Array[Double], q : Double) -> Double

    Returns the q-th quantile of finite values using linear interpolation.

    rolling_mean

    fn rolling_mean(values : Array[Double], window_size : Int) -> Array[Double]

    Causal rolling mean with a shrinking prefix window.

    root_mean_square

    fn root_mean_square(values : Array[Double]) -> Double

    Root mean square of finite signal values.

    sampling_rate_is_supported

    fn sampling_rate_is_supported(metadata : TrialMetadata, minimum_hz : Double, maximum_hz : Double) -> Bool

    summarize_force_magnitude

    fn summarize_force_magnitude(values : Array[Double]) -> ForceMagnitudeSummary

    summarize_signal

    fn summarize_signal(values : Array[Double]) -> SignalSummary

    Summarizes a signal with robust quartiles and a population-style RMS.

    summarize_timebase

    fn summarize_timebase(timestamps : Array[Double]) -> TimebaseSummary

    Summarizes timestamp ordering and sampling interval statistics.

    summarize_trial

    fn summarize_trial(trial : ForceTrial) -> TrialFeatureSummary

    Produces a compact finite-aware feature summary of a force plate trial.

    timebase_is_regular

    fn timebase_is_regular(summary : TimebaseSummary, tolerance_s : Double) -> Bool

    Returns true when all positive intervals lie within an absolute tolerance.

    transform_force_sample

    fn transform_force_sample(sample : ForceSample, transform : AxisTransform) -> ForceSample

    transform_trial_axes

    fn transform_trial_axes(trial : ForceTrial, transform : AxisTransform) -> ForceTrial

    Applies an affine transform while preserving moments, COP, and timestamps.

    validate_trial_metadata

    fn validate_trial_metadata(metadata : TrialMetadata) -> MetadataValidation

    Validates identifiers, physical mass, rate, and supported bilateral side.

    validate_trial_shape

    fn validate_trial_shape(trial : ForceTrial) -> TrialShapeReport

    Validates timestamp order and finite coverage without changing the trial.

    variance_in_range

    fn variance_in_range(values : Array[Double], start : Int, end : Int) -> Double

    Computes sample variance over a clamped range, ignoring non-finite values.

    window_indices

    fn window_indices(length : Int, start : Int, end : Int) -> SampleRange

    Returns a clamped half-open window. Reversed windows become empty.

    zscore

    fn zscore(values : Array[Double]) -> Array[Double]

    Converts a finite signal into z-scores; degenerate signals map to zero.