pub fn trapezoid_area_fractional(y: &[f32], x0: f32, x1: f32) -> f32Expand description
Safe integration of a piecewise-linear signal y over [x0, x1]. x is in sample-index units, segments are [s, s+1] for s=0..n-2. Handles boundaries: no y[n] access, supports n==0/1.