Main Page | Class List | Directories | File List | Class Members | File Members

filters.h

00001 /* Copyright (C) 2002 Jean-Marc Valin 
00002    File: filters.h
00003    Various analysis/synthesis filters
00004 
00005    Redistribution and use in source and binary forms, with or without
00006    modification, are permitted provided that the following conditions
00007    are met:
00008    
00009    - Redistributions of source code must retain the above copyright
00010    notice, this list of conditions and the following disclaimer.
00011    
00012    - Redistributions in binary form must reproduce the above copyright
00013    notice, this list of conditions and the following disclaimer in the
00014    documentation and/or other materials provided with the distribution.
00015    
00016    - Neither the name of the Xiph.org Foundation nor the names of its
00017    contributors may be used to endorse or promote products derived from
00018    this software without specific prior written permission.
00019    
00020    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00023    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00024    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00027    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00028    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00029    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 /* Apply bandwidth expansion on LPC coef */
00059 void bw_lpc(float gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
00060 
00061 
00062 
00063 /* FIR filter */
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,          /*decoded excitation*/
00074 spx_sig_t *new_exc,      /*enhanced excitation*/
00075 spx_coef_t *ak,           /*LPC filter coefs*/
00076 int p,               /*LPC order*/
00077 int nsf,             /*sub-frame size*/
00078 int pitch,           /*pitch period*/
00079 float *pitch_gain,   /*pitch gain (3-tap)*/
00080 float  comb_gain,    /*gain of comb filter*/
00081 CombFilterMem *mem
00082 );
00083 
00084 
00085 #endif

Generated on Wed Aug 24 01:08:52 2005 for Speex by  doxygen 1.4.2