Audio processing (C API)

EmlError eml_audio_melspectrogram(EmlAudioMel mel_params, EmlFFT fft, EmlVector inout, EmlVector temp)

Convert a block of audio to mel-filter spectrum coefficients.

Will perform windowing (Hann), followed by FFT and then Mel-filterbank reduction

  • mel_params – The mel-filterbank parameters to use

  • fft – FFT instance to use. Must already be initialized

  • inout – Input audio. Will be filled with

  • temp – A temporary buffer


EmlOk on success, or error on failure

EmlError eml_audio_melspec(EmlAudioMel mel, EmlVector spec, EmlVector mels)

Reduce a SFTF/linear spectrum to Mel-scale coefficiens.

EmlError eml_audio_power_spectrogram(EmlVector rfft, EmlVector out, int n_fft)

Computer power from magnitude-spectrogram, and normalize based on FFT length.

EmlError eml_sparse_filterbank(const float *input, float *output, int output_length, const int *starts, const int *stops, const float *lut)

Apply a sparse filterbank which reduces @input to a smaller @output.

Each filter is on form 0000nonzero0000. The nonzero filter coefficients are stored consecutively in @lut, with @start and @end indicating which index (in the input) each filter start/end at.

Typically the filters are triangular and applied to an FFT power spectrum. Can be used for mel-filtering a spectrogram.


EmlOk on success, or error on failure