/** * Spectral centroid per frame. * centroid[t] = sum_f freq[f] * S_norm[f][t], with per-frame L1 normalization. * @param {Float32Array|Array|null} y - time series (or null when S given) * @param {Object} options - { sr, S, n_fft, hop_length, win_length, window, center, pad_mode, freq } * @returns {Float64Array} centroid frequency (Hz) per frame */ export function spectral_centroid(y?: Float32Array | any[] | null, options?: any): Float64Array; /** * p'th-order spectral bandwidth. * bw[t] = (sum_f S_norm[f][t] * |freq[f] - centroid[t]|**p) ** (1/p) * @returns {Float64Array} bandwidth per frame */ export function spectral_bandwidth(y?: any, options?: {}): Float64Array; /** * Roll-off frequency: the minimum * frequency bin whose cumulative energy reaches roll_percent of the total. * @returns {Float64Array} rolloff frequency (Hz) per frame */ export function spectral_rolloff(y?: any, options?: {}): Float64Array; /** * Spectral flatness: * geometric mean / arithmetic mean of max(amin, S**power) per frame. * (Formula salvaged from xa-spectral.js — verified against fixtures — * re-hosted here with correct freq-major orientation.) * @returns {Float64Array} flatness in [0, 1] per frame */ export function spectral_flatness(y?: any, options?: {}): Float64Array; /** * Spectral contrast. * Octave-band peak/valley contrast: mean of the top / bottom `quantile` * fraction of sorted magnitudes per band, then power_to_db difference. * @returns {Array} [n_bands + 1][n_frames] */ export function spectral_contrast(y?: any, options?: {}): Array; /** * Root-mean-square energy per frame. * y path: centered constant-padded framing (verified salvage of the * xa-spectral rms y-path — numerically exact on fixtures). * S path: Parseval-based power from a magnitude spectrogram. * @returns {Float64Array} RMS per frame */ export function rms(y?: any, options?: {}): Float64Array; /** * Frame-wise zero-crossing rate: * edge-padded centering, |v| <= threshold clipped to zero before the sign * test, first sample of each frame never counted (pad=False). * @returns {Float64Array} fraction of zero crossings per frame */ export function zero_crossing_rate(y: any, options?: {}): Float64Array; export class ParameterError extends Error { constructor(message: any); }