import type { PhaseMapSpec } from './phasemap' /** A mono clip at a given sample rate. */ export type Source = { name: string fs: number samples: Float32Array } export type RenderRequest = { id: number samples: Float32Array fs: number sigmaMs: number map: PhaseMapSpec /** upper frequency for all plots */ fmax: number maxCols: number maxRows: number /** number of points in the response and map curves */ curvePoints: number } export type Curve = { f: Float32Array; y: Float32Array } export type SpectrogramData = { /** rows x cols in dB relative to a shared maximum; row 0 is 0 Hz */ db: Float32Array rows: number cols: number durationSec: number fmax: number } export type RenderResult = { id: number /** the phase-rotated sound, unscaled */ y: Float32Array /** shared playback gain for A and B */ gain: number /** ||y - x|| / ||x|| */ relDiff: number bands: number sigmaF: number /** the requested map at the band centers, wrapped to (-pi, pi] */ map: Curve /** magnitude of the effective filter in dB */ magDb: Curve /** group delay of the effective filter in ms */ groupDelayMs: Curve /** largest |group delay| in ms over the plotted range */ maxGroupDelayMs: number /** largest |magnitude response| in dB over the plotted range; large values mean the map is too rough for the window */ maxMagDeviationDb: number specA: SpectrogramData specB: SpectrogramData elapsedMs: number }