fitLinearSegments

fun fitLinearSegments(contour: PitchContour, tonicHz: Float, config: LinearFitConfig = LinearFitConfig.DEFAULT): List<TonalSegment>

Fit linear segments to a pitch contour using a sliding window.

Return

List of TonalSegments with fitted slope, intercept, and mean cents

Parameters

contour

Input pitch contour

tonicHz

Tonic frequency in Hz

config

Linear fit configuration (window size, break threshold, hop)