10#ifndef __SOF_MATH_AUDITORY_H__
11#define __SOF_MATH_AUDITORY_H__
17#define AUDITORY_MAX_MEL_BANDS 256
18#define AUDITORY_EPS_Q31 1
19#define AUDITORY_LOG2_2P25_Q16 Q_CONVERT_FLOAT(25.0, 16)
80struct processing_module;
97 int32_t *power_spectra, int16_t *mel_log,
int bitshift);
112 int32_t *power_spectra, int32_t *mel_log,
int bitshift);
int16_t psy_mel_to_hz(int16_t mel)
Convert Mel to Hz See Wikipedia https://en.wikipedia.org/wiki/Mel_scale hz = 700 * (exp(mel / 1126....
int mod_psy_get_mel_filterbank(struct processing_module *mod, struct psy_mel_filterbank *mel_fb)
void psy_apply_mel_filterbank_16(struct psy_mel_filterbank *mel_fb, struct icomplex16 *fft_out, int32_t *power_spectra, int16_t *mel_log, int bitshift)
Convert linear complex spectra from FFT into Mel band energies in desired logarithmic format.
psy_mel_log_scale
Definition auditory.h:21
@ MEL_LOG
Definition auditory.h:22
@ MEL_DB
Definition auditory.h:24
@ MEL_LOG10
Definition auditory.h:23
void psy_apply_mel_filterbank_32(struct psy_mel_filterbank *mel_fb, struct icomplex32 *fft_out, int32_t *power_spectra, int32_t *mel_log, int bitshift)
Convert linear complex spectra from FFT into Mel band energies in desired logarithmic format.
int16_t psy_hz_to_mel(int16_t hz)
Convert Hz to Mel.
int mod_psy_free_mel_filterbank(struct processing_module *mod, struct psy_mel_filterbank *mel_fb)
struct icomplex16 - Storage for a normal complex number.
Definition icomplex16.h:28
struct icomplex32 - Storage for a normal complex number.
Definition icomplex32.h:23
int half_fft_bins
In, fft_bins / 2 + 1.
Definition auditory.h:48
enum psy_mel_log_scale mel_log_scale
In, LOG, LOG10 or DB to select Mel format.
Definition auditory.h:51
int16_t end_freq
In, Hz Q0.
Definition auditory.h:41
int16_t * data
Out, Packed triangles data.
Definition auditory.h:44
int mel_bins
In, Number of Mel frequency bins.
Definition auditory.h:49
int32_t log_mult
Out, QX.Y scale for log, log10, or dB format.
Definition auditory.h:37
int32_t scale_log2
Out, Scale as log2 Q16.16 to apply to Mel energies.
Definition auditory.h:38
int fft_bins
In, Number of FFT bins.
Definition auditory.h:47
int16_t start_freq
In, Hz Q0.
Definition auditory.h:40
int16_t * scratch_data2
Scratch, Packed triangles data.
Definition auditory.h:43
int scratch_length2
In, Length of second scratch.
Definition auditory.h:46
int data_length
Out, Number of int16_t words in triangles data.
Definition auditory.h:50
int16_t * scratch_data1
Scratch, At least half_fft_bins size.
Definition auditory.h:42
bool slaney_normalize
In, Apply Slaney type normalization for filterbank if true.
Definition auditory.h:52
int scratch_length1
In, Length of first scratch.
Definition auditory.h:45
int32_t samplerate
In, Hz Q0.
Definition auditory.h:39