| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
#ifndef FILTERS_H |
| 34 |
#define FILTERS_H |
| 35 |
|
| 36 |
#include "misc.h" |
| 37 |
|
| 38 |
spx_word16_t compute_rms(const spx_sig_t *x, int len); |
| 39 |
void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len); |
| 40 |
void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len); |
| 41 |
|
| 42 |
#ifdef FIXED_POINT |
| 43 |
|
| 44 |
int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len); |
| 45 |
|
| 46 |
#endif |
| 47 |
|
| 48 |
typedef struct CombFilterMem { |
| 49 |
int last_pitch; |
| 50 |
spx_word16_t last_pitch_gain[3]; |
| 51 |
spx_word16_t smooth_gain; |
| 52 |
} CombFilterMem; |
| 53 |
|
| 54 |
|
| 55 |
void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_sig_t *, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack); |
| 56 |
void fir_mem_up(const spx_sig_t *x, const spx_word16_t *a, spx_sig_t *y, int N, int M, spx_word32_t *mem, char *stack); |
| 57 |
|
| 58 |
|
| 59 |
void filter_mem2(const spx_sig_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem); |
| 60 |
void fir_mem2(const spx_sig_t *x, const spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem); |
| 61 |
void iir_mem2(const spx_sig_t *x, const spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem); |
| 62 |
|
| 63 |
|
| 64 |
void bw_lpc(spx_word16_t , const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order); |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
void syn_percep_zero(const spx_sig_t *x, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack); |
| 69 |
|
| 70 |
void residue_percep_zero(const spx_sig_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack); |
| 71 |
|
| 72 |
void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack); |
| 73 |
|
| 74 |
void comb_filter_mem_init (CombFilterMem *mem); |
| 75 |
|
| 76 |
void comb_filter( |
| 77 |
spx_sig_t *exc, |
| 78 |
spx_sig_t *new_exc, |
| 79 |
spx_coef_t *ak, |
| 80 |
int p, |
| 81 |
int nsf, |
| 82 |
int pitch, |
| 83 |
spx_word16_t *pitch_gain, |
| 84 |
spx_word16_t comb_gain, |
| 85 |
CombFilterMem *mem |
| 86 |
); |
| 87 |
|
| 88 |
|
| 89 |
#endif |