Skip to content

sp500_log_mel_params

#include <sp500/log_mel.h>

struct sp500_log_mel_params

Front-end parameters.

Fill this with sp500_log_mel_params_init(); the defaults are the Whisper 80-mel front end. Qwen3-ASR and Whisper large-v3 use n_mels = 128. Only n_samples has no useful default and must be set.

Attributes

Member Description
n_samples
sample_rate
n_fft
hop_length
n_mels
min_frequency
max_frequency
normalize
reserved0
mel_filters
mel_filters_count
reserved

n_samples

int32_t n_samples

number of input samples (required)

sample_rate

int32_t sample_rate

sampling rate in Hz; default 16000

n_fft

int32_t n_fft

FFT size; default 400. Must be 16..2048 and factor into 2, 3 and 5 only

hop_length

int32_t hop_length

hop in samples; default 160. Must be 1..65535

n_mels

int32_t n_mels

mel bins; default 80. Must be 1..256

min_frequency

float min_frequency

lower edge of the mel bank in Hz; default 0

max_frequency

float max_frequency

upper edge of the mel bank in Hz; default 8000

normalize

uint8_t normalize

1: apply the Whisper clamp and rescale. Default 1

reserved0

uint8_t reserved0[3]

must be zero

mel_filters

const float * mel_filters

Optional dense mel bank, [n_fft/2 + 1][n_mels] row-major - the same layout as Hugging Face mel_filters. NULL generates the slaney bank from the parameters above. Read only during the call; it does not need to outlive it.

mel_filters_count

uint32_t mel_filters_count

Number of floats in mel_filters. Must be sp500_log_mel_num_freq(n_fft) * n_mels when mel_filters is set, and 0 when it is NULL.

reserved

uint32_t reserved[5]

must be zero