anaFilter.c File Reference

#include <string.h>
#include "iLBC_define.h"

Include dependency graph for anaFilter.c:

Go to the source code of this file.

Functions

void anaFilter (float *In, float *a, int len, float *Out, float *mem)


Function Documentation

void anaFilter ( float *  In,
float *  a,
int  len,
float *  Out,
float *  mem 
)

Definition at line 20 of file anaFilter.c.

References LPC_FILTERORDER.

Referenced by iLBC_encode().

00026     {
00027        int i, j;
00028        float *po, *pi, *pm, *pa;
00029 
00030        po = Out;
00031 
00032        /* Filter first part using memory from past */
00033 
00034        for (i=0; i<LPC_FILTERORDER; i++) {
00035            pi = &In[i];
00036            pm = &mem[LPC_FILTERORDER-1];
00037            pa = a;
00038            *po=0.0;
00039 
00040 
00041 
00042 
00043 
00044            for (j=0; j<=i; j++) {
00045                *po+=(*pa++)*(*pi--);
00046            }
00047            for (j=i+1; j<LPC_FILTERORDER+1; j++) {
00048 
00049                *po+=(*pa++)*(*pm--);
00050            }
00051            po++;
00052        }
00053 
00054        /* Filter last part where the state is entirely
00055           in the input vector */
00056 
00057        for (i=LPC_FILTERORDER; i<len; i++) {
00058            pi = &In[i];
00059            pa = a;
00060            *po=0.0;
00061            for (j=0; j<LPC_FILTERORDER+1; j++) {
00062                *po+=(*pa++)*(*pi--);
00063            }
00064            po++;
00065        }
00066 
00067        /* Update state vector */
00068 
00069        memcpy(mem, &In[len-LPC_FILTERORDER],
00070            LPC_FILTERORDER*sizeof(float));
00071    }


Generated on Thu Apr 16 06:28:13 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6