diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-03 18:13:26 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-03 18:13:26 +0000 |
commit | 67da2f8263b4e9bb5522fa59b27e143381d69774 (patch) | |
tree | e69baf2b1594606e9ea2e80d26d691a10bd23831 /1.2-netsec/codecs/ilbc/syntFilter.c | |
parent | 187ac8fdb51443812933047136b96b5a532dd857 (diff) |
Creating tag for the release of asterisk-1.2.5
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.2.5@11747 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to '1.2-netsec/codecs/ilbc/syntFilter.c')
-rw-r--r-- | 1.2-netsec/codecs/ilbc/syntFilter.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/1.2-netsec/codecs/ilbc/syntFilter.c b/1.2-netsec/codecs/ilbc/syntFilter.c new file mode 100644 index 000000000..bb7f7a559 --- /dev/null +++ b/1.2-netsec/codecs/ilbc/syntFilter.c @@ -0,0 +1,108 @@ + +/****************************************************************** + + iLBC Speech Coder ANSI-C Source Code + + syntFilter.c + + Copyright (C) The Internet Society (2004). + All Rights Reserved. + +******************************************************************/ + +#include "iLBC_define.h" +#include "syntFilter.h" + +/*----------------------------------------------------------------* + * LP synthesis filter. + *---------------------------------------------------------------*/ + +void syntFilter( + float *Out, /* (i/o) Signal to be filtered */ + float *a, /* (i) LP parameters */ + int len, /* (i) Length of signal */ + float *mem /* (i/o) Filter state */ +){ + int i, j; + float *po, *pi, *pa, *pm; + + po=Out; + + /* Filter first part using memory from past */ + + for (i=0; i<LPC_FILTERORDER; i++) { + pi=&Out[i-1]; + pa=&a[1]; + pm=&mem[LPC_FILTERORDER-1]; + for (j=1; j<=i; j++) { + *po-=(*pa++)*(*pi--); + } + for (j=i+1; j<LPC_FILTERORDER+1; j++) { + *po-=(*pa++)*(*pm--); + } + po++; + } + + /* Filter last part where the state is entierly in + the output vector */ + + for (i=LPC_FILTERORDER; i<len; i++) { + + + pi=&Out[i-1]; + pa=&a[1]; + for (j=1; j<LPC_FILTERORDER+1; j++) { + *po-=(*pa++)*(*pi--); + } + po++; + } + + /* Update state vector */ + + memcpy(mem, &Out[len-LPC_FILTERORDER], + LPC_FILTERORDER*sizeof(float)); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |