Main Page   Compound List   File List   Compound Members   File Members  

filters.h

Go to the documentation of this file.
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 
00037 typedef struct CombFilterMem {
00038    int   last_pitch;
00039    float last_pitch_gain[3];
00040    float smooth_gain;
00041 } CombFilterMem;
00042 
00043 
00044 void qmf_decomp(float *xx, float *aa, float *y1, float *y2, int N, int M, float *mem, char *stack);
00045 void fir_mem_up(float *x, float *a, float *y, int N, int M, float *mem, char *stack);
00046 
00047 
00048 void filter_mem2(float *x, float *num, float *den, float *y, int N, int ord, float *mem);
00049 void fir_mem2(float *x, float *num, float *y, int N, int ord, float *mem);
00050 void iir_mem2(float *x, float *den, float *y, int N, int ord, float *mem);
00051 
00052 /* Apply bandwidth expansion on LPC coef */
00053 void bw_lpc(float gamma, float *lpc_in, float *lpc_out, int order);
00054 
00055 
00056 
00057 /* FIR filter */
00058 void fir_decim_mem(float *x, float *a, float *y, int N, int M, float *mem);
00059 
00060 void syn_percep_zero(float *x, float *ak, float *awk1, float *awk2, float *y, int N, int ord, char *stack);
00061 
00062 void residue_percep_zero(float *xx, float *ak, float *awk1, float *awk2, float *y, int N, int ord, char *stack);
00063 
00064 void comp_filter_mem_init (CombFilterMem *mem);
00065 
00066 void comb_filter(
00067 float *exc,          /*decoded excitation*/
00068 float *new_exc,      /*enhanced excitation*/
00069 float *ak,           /*LPC filter coefs*/
00070 int p,               /*LPC order*/
00071 int nsf,             /*sub-frame size*/
00072 int pitch,           /*pitch period*/
00073 float *pitch_gain,   /*pitch gain (3-tap)*/
00074 float  comb_gain,    /*gain of comb filter*/
00075 CombFilterMem *mem
00076 );
00077 
00078 
00079 #endif

Generated on Sat Dec 6 08:47:41 2003 for speex by doxygen1.2.15