00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef FILTERS_H
00034 #define FILTERS_H
00035
00036 #include "misc.h"
00037
00038 spx_word16_t compute_rms(const spx_sig_t *x, int len);
00039 void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
00040 void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
00041
00042 #ifdef FIXED_POINT
00043
00044 int normalize16(const spx_sig_t *x, spx_word16_t *y, int max_scale, int len);
00045
00046 #endif
00047
00048 typedef struct CombFilterMem {
00049 int last_pitch;
00050 spx_word16_t last_pitch_gain[3];
00051 spx_word16_t smooth_gain;
00052 } CombFilterMem;
00053
00054
00055 void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack);
00056 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);
00057
00058
00059 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);
00060 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);
00061 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);
00062
00063
00064 void bw_lpc(spx_word16_t gamma, const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
00065
00066
00067
00068 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);
00069
00070 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);
00071
00072 void comb_filter_mem_init (CombFilterMem *mem);
00073
00074 void comb_filter(
00075 spx_sig_t *exc,
00076 spx_sig_t *new_exc,
00077 spx_coef_t *ak,
00078 int p,
00079 int nsf,
00080 int pitch,
00081 spx_word16_t *pitch_gain,
00082 spx_word16_t comb_gain,
00083 CombFilterMem *mem
00084 );
00085
00086
00087 #endif