/ proof-of-concept / phase-perception-2
Sign in
proof-of-concept / phase-perception-2
phase-perception-2 / src / types.ts
60 lines · 1.6 KBCodeBlameHistory
3/** A mono clip at a given sample rate. */
4export type Source = {
5 name: string
6 fs: number
7 samples: Float32Array
8}
10export type RenderRequest = {
11 id: number
12 samples: Float32Array
13 fs: number
14 sigmaMs: number
15 map: PhaseMapSpec
16 /** upper frequency for all plots */
17 fmax: number
18 maxCols: number
19 maxRows: number
24export type Curve = { f: Float32Array; y: Float32Array }
e9f92d1Time-varying random phase maps by decimated subband synthesis; drag-to-zoom, scrollbar pan and zoom buttons for the waveformsJeremy Magland 26/** A rows x cols image over time (columns) and frequency (rows, row 0 at 0 Hz). */
27export type ImageData2D = {
28 data: Float32Array
30 cols: number
31 durationSec: number
32 fmax: number
35export type RenderResult = {
36 id: number
37 /** the phase-rotated sound, unscaled */
38 y: Float32Array
39 /** shared playback gain for A and B */
40 gain: number
41 /** ||y - x|| / ||x|| */
42 relDiff: number
43 bands: number
44 sigmaF: number
46 timeVarying: boolean
47 /** the phase map over time and frequency, in radians wrapped to (-pi, pi] */
48 phaseField: ImageData2D
49 /** magnitude in dB of the filter equivalent to the map (at the middle of the clip if it varies) */
53 maxGroupDelayMs: number
54 /** largest |magnitude response| in dB over the plotted range; large values mean the map is too rough for the window */
55 maxMagDeviationDb: number
57 specA: ImageData2D
58 specB: ImageData2D
↑↓ move↵openescclose