32 {
33 int j, k, n, memInd, sFilt;
35 int base_size;
36 int ilow, ihigh;
37 float alfa, alfa1;
38
39
40
41 base_size=lMem-cbveclen+1;
42
44 base_size+=cbveclen/2;
45 }
46
47
48
49 if (index<lMem-cbveclen+1) {
50
51
52
53 k=index+cbveclen;
54
55 memcpy(cbvec, mem+lMem-k, cbveclen*sizeof(float));
56
57 } else if (index < base_size) {
58
59 k=2*(index-(lMem-cbveclen+1))+cbveclen;
60
61 ihigh=k/2;
62 ilow=ihigh-5;
63
64
65
66 memcpy(cbvec, mem+lMem-k/2, ilow*sizeof(float));
67
68
69
70 alfa1=(float)0.2;
71 alfa=0.0;
72 for (j=ilow; j<ihigh; j++) {
73 cbvec[j]=((float)1.0-alfa)*mem[lMem-k/2+j]+
74 alfa*mem[lMem-k+j];
75
76
77
78
79
80 alfa+=alfa1;
81 }
82
83
84
85 memcpy(cbvec+ihigh, mem+lMem-k+ihigh,
86 (cbveclen-ihigh)*sizeof(float));
87
88 }
89
90
91
92 else {
93
94
95
96 if (index-base_size<lMem-cbveclen+1) {
98 float *pos;
99 float *pp, *pp1;
100
101 memset(tempbuff2, 0,
104 lMem*sizeof(float));
107
108 k=index-base_size+cbveclen;
109 sFilt=lMem-k;
111
112
113 pos=cbvec;
114 memset(pos, 0, cbveclen*sizeof(float));
115 for (n=0; n<cbveclen; n++) {
119 (*pos)+=(*pp++)*(*pp1--);
120 }
121 pos++;
122 }
123 }
124
125
126
127 else {
128
129
130
131
132
134
135 float *pos;
136 float *pp, *pp1;
137 int i;
138
139 memset(tempbuff2, 0,
142 lMem*sizeof(float));
145
146 k=2*(index-base_size-
147 (lMem-cbveclen+1))+cbveclen;
148 sFilt=lMem-k;
150
151
152 pos=&tmpbuf[sFilt];
153 memset(pos, 0, k*sizeof(float));
154 for (i=0; i<k; i++) {
158 (*pos)+=(*pp++)*(*pp1--);
159 }
160 pos++;
161 }
162
163 ihigh=k/2;
164 ilow=ihigh-5;
165
166
167
168 memcpy(cbvec, tmpbuf+lMem-k/2,
169 ilow*sizeof(float));
170
171
172
173 alfa1=(float)0.2;
174 alfa=0.0;
175 for (j=ilow; j<ihigh; j++) {
176 cbvec[j]=((float)1.0-alfa)*
177 tmpbuf[lMem-k/2+j]+alfa*tmpbuf[lMem-k+j];
178 alfa+=alfa1;
179 }
180
181
182
183
184
185
186
187
188 memcpy(cbvec+ihigh, tmpbuf+lMem-k+ihigh,
189 (cbveclen-ihigh)*sizeof(float));
190 }
191 }
192 }
float cbfiltersTbl[CB_FILTERLEN]