32 for (lag = 0; lag <=
order; lag++) {
34 for (n = 0; n < N - lag; n++) {
35 sum += x[n] * x[n+lag];
58 for (i = 0; i < N; i++) {
80 for (i = 0; i <
order; i++) {
85 a[1] = k[0] = -r[1]/r[0];
86 alpha = r[0] + r[1] * k[0];
87 for (m = 1; m <
order; m++){
89 for (i = 0; i < m; i++){
90 sum += a[i+1] * r[m - i];
100 for (i = 0; i < m_h; i++){
101 sum = a[i+1] + k[m] * a[m - i];
102 a[m - i] += k[m] * a[i+1];
126 invcoef = (float)1.0 - coef;
127 for (i = 0; i < length; i++) {
128 out[i] = coef * in1[i] + invcoef * in2[i];
155 for (i = 1; i < length; i++) {
156 out[i] = chirp * in[i];
175 float dist,
tmp, mindist;
180 for (j = 0; j < n_cb; j++) {
181 dist = X[0] - CB[pos];
183 for (i = 1; i < dim; i++) {
184 tmp = X[i] - CB[pos + i];
188 if (dist < mindist) {
194 for (i = 0; i < dim; i++) {
195 Xq[i] = CB[minindex*dim + i];
219 int cb_pos, X_pos, i;
223 for (i = 0; i < nsplit; i++) {
224 vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos,
227 cb_pos += dim[i] * cbsize[i];
249 while ((x > cb[i]) && i < cb_size - 1) {
258 if (x > ((cb[i] + cb[i - 1])/2)) {
279 int k,n,m, Nit=2, change=0,pos;
280 static float eps=(float)0.039;
281 static float eps2=(float)0.0195;
282 static float maxlsf=(float)3.14;
283 static float minlsf=(float)0.01;
287 for (n=0; n<Nit; n++) {
288 for (m=0; m<NoAn; m++) {
289 for (k=0; k<(dim-1); k++) {
292 if ((lsf[pos+1]-lsf[pos])<eps) {
294 if (lsf[pos+1]<lsf[pos]) {
295 lsf[pos+1]= lsf[pos]+eps2;
296 lsf[pos]= lsf[pos+1]-eps2;
309 if (lsf[pos]<minlsf) {
314 if (lsf[pos]>maxlsf) {
void interpolate(float *out, float *in1, float *in2, float coef, int length)
void autocorr(float *r, const float *x, int N, int order)
void window(float *z, const float *x, const float *y, int N)
void bwexpand(float *out, float *in, float coef, int length)
int LSF_check(float *lsf, int dim, int NoAn)
void SplitVQ(float *qX, int *index, float *X, const float *CB, int nsplit, const int *dim, const int *cbsize)
void levdurb(float *a, float *k, float *r, int order)
void vq(float *Xq, int *index, const float *CB, float *X, int n_cb, int dim)
void sort_sq(float *xq, int *index, float x, const float *cb, int cb_size)