export interface DistinctClip { /** Stable id used in messages, e.g. `rb26e_on_5800` or `slot horn "vehicle.horn"`. */ id: string; samples: Float64Array; sampleRate: number; /** The role this sound plays: a slot name (`shiftUp`) or a ladder key (`engineBlend[0]`). Pairs with equal role are within one role. */ role: string; /** Set for ladder rungs: the rpm the rung was authored at. Rungs of the same `role` use the label ratio as a pitch seed. */ rpm?: number; } export interface DuplicatePair { a: string; b: string; /** Peak band-envelope correlation after undoing the pitch ratio (the harness's `env_ncc`). */ envNcc: number; /** The playback ratio that best aligned them. */ ratio: number; /** Peak log-frequency line-pattern correlation. */ lineNcc: number; crossRole: boolean; /** Strong enough to be one recording: the envelope match is copy-strength, or the line pattern agrees too. */ corroborated: boolean; } export interface DuplicateCluster { ids: string[]; roles: string[]; crossRole: boolean; exact: boolean; /** At least one pair is corroborated by the line pattern (or the samples are identical). An uncorroborated cluster is a suspicion, not a proof. */ confirmed: boolean; pairs: DuplicatePair[]; } /** A pair at or above this envelope correlation is one recording. Real independent ladders measure <= 0.66. */ export declare const DUPLICATE_ENV_NCC = 0.8; /** * The envelope match alone also fires on two independent takes that share a slow wander (stationary loops have few * independent envelope samples): in the package this was calibrated on, three of four clusters at 0.80-0.87 had an * aperiodic residual correlation of 0.13 after the pitch change, where a resampled copy scores >= 0.9. A pair is * CONFIRMED when the envelope match is the strength of a real copy (>= 0.93: the harness measured copies at 0.93-1.0) * or the fine line pattern (the resonance structure at the same pitch ratio) correlates too (the retimed shift pair * measured 0.92; independent real ladders <= 0.74). Anything between is reported as a warning. */ export declare const CONFIRMED_ENV_NCC = 0.93; export declare const LINE_CORROBORATION = 0.8; /** Windowed-sinc low-pass at 3.6 kHz, evaluated on an 8 kHz grid (linear between the two nearest source samples). */ export declare function toEightK(samples: Float64Array, sr: number): Float64Array; /** Four band amplitude envelopes at 200 Hz, trend-removed, ~40 ms smoothed and zero-mean. `null` for a clip too short. */ export declare function bandEnvelopes(x8: Float64Array): Float64Array[] | null; /** Max over lags of the band-summed normalised envelope correlation, overlap-weighted (the harness's `env_ncc`). */ export declare function envelopeNcc(A: Float64Array[] | null, B: Float64Array[] | null, minOverlapFraction?: number): number; /** Fine log-frequency line pattern (broad 1-octave envelope removed), so two takes of one resonance structure correlate. */ export declare function linePattern(samples: Float64Array, sr: number): Float64Array; /** * Every pair of clips that is one recording under two names. `labelRatioOf` lets rungs of one * ladder seed the pitch search with their authored rpm ratio. */ export declare function findNearDuplicates(clips: readonly DistinctClip[]): { pairs: DuplicatePair[]; exact: string[][]; clusters: DuplicateCluster[]; pairsChecked: number; };