Asterisk - The Open Source Telephony Project  18.5.0
helpfun.h
Go to the documentation of this file.
1 
2  /******************************************************************
3 
4  iLBC Speech Coder ANSI-C Source Code
5 
6  helpfun.h
7 
8  Copyright (C) The Internet Society (2004).
9  All Rights Reserved.
10 
11  ******************************************************************/
12 
13  #ifndef __iLBC_HELPFUN_H
14  #define __iLBC_HELPFUN_H
15 
16  void autocorr(
17  float *r, /* (o) autocorrelation vector */
18  const float *x, /* (i) data vector */
19  int N, /* (i) length of data vector */
20  int order /* largest lag for calculated
21  autocorrelations */
22  );
23 
24  void window(
25  float *z, /* (o) the windowed data */
26  const float *x, /* (i) the original data vector */
27  const float *y, /* (i) the window */
28  int N /* (i) length of all vectors */
29  );
30 
31  void levdurb(
32  float *a, /* (o) lpc coefficient vector starting
33  with 1.0 */
34  float *k, /* (o) reflection coefficients */
35  float *r, /* (i) autocorrelation vector */
36  int order /* (i) order of lpc filter */
37  );
38 
39  void interpolate(
40 
41 
42 
43 
44 
45  float *out, /* (o) the interpolated vector */
46  float *in1, /* (i) the first vector for the
47  interpolation */
48  float *in2, /* (i) the second vector for the
49  interpolation */
50  float coef, /* (i) interpolation weights */
51  int length /* (i) length of all vectors */
52  );
53 
54  void bwexpand(
55  float *out, /* (o) the bandwidth expanded lpc
56  coefficients */
57  float *in, /* (i) the lpc coefficients before bandwidth
58  expansion */
59  float coef, /* (i) the bandwidth expansion factor */
60  int length /* (i) the length of lpc coefficient vectors */
61  );
62 
63  void vq(
64  float *Xq, /* (o) the quantized vector */
65  int *index, /* (o) the quantization index */
66  const float *CB,/* (i) the vector quantization codebook */
67  float *X, /* (i) the vector to quantize */
68  int n_cb, /* (i) the number of vectors in the codebook */
69  int dim /* (i) the dimension of all vectors */
70  );
71 
72  void SplitVQ(
73  float *qX, /* (o) the quantized vector */
74  int *index, /* (o) a vector of indexes for all vector
75  codebooks in the split */
76  float *X, /* (i) the vector to quantize */
77  const float *CB,/* (i) the quantizer codebook */
78  int nsplit, /* the number of vector splits */
79  const int *dim, /* the dimension of X and qX */
80  const int *cbsize /* the number of vectors in the codebook */
81  );
82 
83 
84  void sort_sq(
85  float *xq, /* (o) the quantized value */
86  int *index, /* (o) the quantization index */
87  float x, /* (i) the value to quantize */
88  const float *cb,/* (i) the quantization codebook */
89  int cb_size /* (i) the size of the quantization codebook */
90  );
91 
92  int LSF_check( /* (o) 1 for stable lsf vectors and 0 for
93 
94 
95 
96 
97 
98  nonstable ones */
99  float *lsf, /* (i) a table of lsf vectors */
100  int dim, /* (i) the dimension of each lsf vector */
101  int NoAn /* (i) the number of lsf vectors in the
102  table */
103  );
104 
105  #endif
void autocorr(float *r, const float *x, int N, int order)
Definition: helpfun.c:22
int LSF_check(float *lsf, int dim, int NoAn)
Definition: helpfun.c:272
void levdurb(float *a, float *k, float *r, int order)
Definition: helpfun.c:67
void vq(float *Xq, int *index, const float *CB, float *X, int n_cb, int dim)
Definition: helpfun.c:165
void SplitVQ(float *qX, int *index, float *X, const float *CB, int nsplit, const int *dim, const int *cbsize)
Definition: helpfun.c:209
void sort_sq(float *xq, int *index, float x, const float *cb, int cb_size)
Definition: helpfun.c:235
FILE * in
Definition: utils/frame.c:33
integer order
Definition: analys.c:66
void window(float *z, const float *x, const float *y, int N)
Definition: helpfun.c:50
void bwexpand(float *out, float *in, float coef, int length)
Definition: helpfun.c:136
FILE * out
Definition: utils/frame.c:33
void interpolate(float *out, float *in1, float *in2, float coef, int length)
Definition: helpfun.c:114
static struct test_val a