/** * Pitch tracking on thresholded parabolically-interpolated STFT * (piptrack), restricted to what estimate_tuning needs: * returns the sparse list of detected {pitch, mag} peaks. * @param {Object} options - { y, sr, S, n_fft, hop_length, fmin, fmax, threshold } * @returns {{pitches: number[], mags: number[]}} */ export function piptrackPeaks(options?: any): { pitches: number[]; mags: number[]; }; /** * Tuning offset of a set of detected frequencies relative to A440, * in fractions of a chroma bin. * @returns {number} tuning in [-0.5, 0.5) */ export function pitch_tuning(frequencies: any, options?: {}): number; /** * Estimate tuning from a signal or spectrogram. * @param {Object} options - { y, sr, S, n_fft, resolution, bins_per_octave, * + piptrack options } * @returns {number} tuning deviation in fractions of a bin, in [-0.5, 0.5) */ export function estimate_tuning(options?: any): number; /** * Chromagram from a waveform or power spectrogram * (Ellis chromagram_E lineage). * @param {Float32Array|Array|null} y - time series (or null when S given) * @param {Object} options * @param {Array|null} options.S - precomputed POWER spectrogram [freq][time] * @param {number|null} options.norm - per-frame norm (default Infinity = max) * @param {number|null} options.tuning - tuning in fractional chroma bins; * null (default) estimates it from the input * @param {number} options.n_chroma - number of chroma bins (default 12) * @param {number} options.ctroct / options.octwidth / options.filter_norm / * options.base_c - forwarded to filters.chroma (filter_norm maps to that * function's `norm` to avoid colliding with the frame norm) * @returns {Array} [n_chroma][n_frames] */ export function chroma_stft(y?: Float32Array | any[] | null, options?: { S: any[] | null; norm: number | null; tuning: number | null; n_chroma: number; ctroct: number; }): Array; /** * Log-frequency spectrum by nearest-FFT-bin sampling. * * HONESTY NOTE: this is NOT a constant-Q transform (no wavelet basis, no * per-bin Q resolution). It frames the signal, takes one large FFT per hop * (n_fft = 2^ceil(log2(4*sr/fmin))) and picks the magnitude of the nearest * FFT bin for each log-spaced frequency. Formerly (mis)named * `constant_q_transform` in xa-chroma.js; kept as a fast approximation. * * @param {Float32Array|Array} y - time series * @param {number} sr - sample rate * @param {number} hop_length - hop between frames * @param {number|null} fmin - minimum frequency (default C1 = 32.7 Hz) * @param {number} n_bins - number of log-frequency bins * @param {number} tuning - tuning offset in cents * @param {number} bins_per_octave - log-frequency bins per octave * @returns {Array} time-major [n_frames][n_bins] */ export function logFrequencySpectrum(y: Float32Array | any[], sr: number, hop_length?: number, fmin?: number | null, n_bins?: number, tuning?: number, bins_per_octave?: number): Array; /** * Fold a time-major log-frequency spectrum into pitch classes by * energy sum over `bin % n_chroma`, with per-frame sqrt-energy-share * normalization. Only valid when the spectrum has exactly n_chroma bins * per octave (the fold has no sub-semitone resolution). * @param {Array} logSpec - time-major [n_frames][n_bins] * @param {number} n_chroma - pitch classes (default 12) * @param {number} bins_per_octave - must equal n_chroma * @returns {Array} [n_chroma][n_frames] */ export function foldLogSpectrumToChroma(logSpec: Array, n_chroma?: number, bins_per_octave?: number): Array;