00001
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
00034
00035 #ifndef FILTERS_H
00036 #define FILTERS_H
00037
00038 #include "misc.h"
00039
00040 spx_word16_t compute_rms(const spx_sig_t *x, int len);
00041 void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
00042 void signal_div(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
00043
00044 #ifdef FIXED_POINT
00045
00046 int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len);
00047
00048 #endif
00049
00051 typedef struct {
00052 int last_pitch;
00053 spx_word16_t last_pitch_gain[3];
00054 spx_word16_t smooth_gain;
00055 } CombFilterMem;
00056
00057
00058 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);
00059 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);
00060
00061
00062 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);
00063 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);
00064 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);
00065
00066
00067 void bw_lpc(spx_word16_t , const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
00068
00069
00070
00071 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);
00072
00073 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);
00074
00075 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);
00076
00077 void comb_filter_mem_init (CombFilterMem *mem);
00078
00079 void comb_filter(
00080 spx_sig_t *exc,
00081 spx_sig_t *new_exc,
00082 spx_coef_t *ak,
00083 int p,
00084 int nsf,
00085 int pitch,
00086 spx_word16_t *pitch_gain,
00087 spx_word16_t comb_gain,
00088 CombFilterMem *mem
00089 );
00090
00091
00092 #endif