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(spx_sig_t *x, int len);
00039 #ifdef FIXED_POINT
00040 int normalize16(spx_sig_t *x, spx_word16_t *y, int max_scale, int len);
00041 #endif
00042
00043 typedef struct CombFilterMem {
00044 int last_pitch;
00045 float last_pitch_gain[3];
00046 float smooth_gain;
00047 } CombFilterMem;
00048
00049
00050 void qmf_decomp(short *xx, spx_word16_t *aa, spx_sig_t *y1, spx_sig_t *y2, int N, int M, spx_word16_t *mem, char *stack);
00051 void fir_mem_up(spx_sig_t *x, spx_word16_t *a, spx_sig_t *y, int N, int M, spx_word32_t *mem, char *stack);
00052
00053
00054 void filter_mem2(spx_sig_t *x, spx_coef_t *num, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
00055 void fir_mem2(spx_sig_t *x, spx_coef_t *num, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
00056 void iir_mem2(spx_sig_t *x, spx_coef_t *den, spx_sig_t *y, int N, int ord, spx_mem_t *mem);
00057
00058
00059 void bw_lpc(float gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
00060
00061
00062
00063
00064 void fir_decim_mem(spx_sig_t *x, float *a, spx_sig_t *y, int N, int M, float *mem);
00065
00066 void syn_percep_zero(spx_sig_t *x, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
00067
00068 void residue_percep_zero(spx_sig_t *xx, spx_coef_t *ak, spx_coef_t *awk1, spx_coef_t *awk2, spx_sig_t *y, int N, int ord, char *stack);
00069
00070 void comp_filter_mem_init (CombFilterMem *mem);
00071
00072 void comb_filter(
00073 spx_sig_t *exc,
00074 spx_sig_t *new_exc,
00075 spx_coef_t *ak,
00076 int p,
00077 int nsf,
00078 int pitch,
00079 float *pitch_gain,
00080 float comb_gain,
00081 CombFilterMem *mem
00082 );
00083
00084
00085 #endif