Skip to content

mel_to_stft

mel_to_stft(M, sr?, n_fft?, power?, kwargs?): any[]

Defined in: packages/pleco-xa/src/scripts/xa-inverse.js:24

Approximate STFT magnitude from a Mel power spectrogram.

NOTE: an exact inverse solves a non-negative least squares problem (nnls(mel_basis, M)); this implementation uses the filterbank TRANSPOSE as a pseudo-inverse — a rough approximation. Spectral shape (per-frame peak location, cosine similarity vs |stft|) survives; absolute magnitudes do not.

any[]

Mel spectrogram [n_mels x n_frames]

number = 22050

Sample rate

number = 2048

FFT size

number = 2.0

Power for the spectrogram (2.0 for power, 1.0 for magnitude)

any = {}

Additional arguments for mel_filterbank

any[]

Approximate STFT magnitude [n_freq x n_frames]