logFrequencySpectrum
logFrequencySpectrum(
y,sr,hop_length?,fmin?,n_bins?,tuning?,bins_per_octave?):Float32Array<ArrayBufferLike>[]
Defined in: packages/pleco-xa/src/feature/chroma.js:345
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.
Parameters
Section titled “Parameters”any[] | Float32Array<ArrayBufferLike>
time series
number
sample rate
hop_length?
Section titled “hop_length?”number = 512
hop between frames
number = null
minimum frequency (default C1 = 32.7 Hz)
n_bins?
Section titled “n_bins?”number = 84
number of log-frequency bins
tuning?
Section titled “tuning?”number = 0.0
tuning offset in cents
bins_per_octave?
Section titled “bins_per_octave?”number = 12
log-frequency bins per octave
Returns
Section titled “Returns”Float32Array<ArrayBufferLike>[]
time-major [n_frames][n_bins]