comparison libgsmefr/residu.c @ 53:49dd1ac8e75b

libgsmefr: import most *.c files from ETSI source
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 Nov 2022 16:18:21 +0000
parents
children de9dc80c1312
comparison
equal deleted inserted replaced
52:988fd7ff514f 53:49dd1ac8e75b
1 /*************************************************************************
2 *
3 * FUNCTION: Residu
4 *
5 * PURPOSE: Computes the LP residual.
6 *
7 * DESCRIPTION:
8 * The LP residual is computed by filtering the input speech through
9 * the LP inverse filter A(z).
10 *
11 *************************************************************************/
12
13 #include "typedef.h"
14 #include "basic_op.h"
15 #include "count.h"
16
17 /* m = LPC order == 10 */
18 #define m 10
19
20 void Residu (
21 Word16 a[], /* (i) : prediction coefficients */
22 Word16 x[], /* (i) : speech signal */
23 Word16 y[], /* (o) : residual signal */
24 Word16 lg /* (i) : size of filtering */
25 )
26 {
27 Word16 i, j;
28 Word32 s;
29
30 for (i = 0; i < lg; i++)
31 {
32 s = L_mult (x[i], a[0]);
33 for (j = 1; j <= m; j++)
34 {
35 s = L_mac (s, a[j], x[i - j]);
36 }
37 s = L_shl (s, 3);
38 y[i] = round (s); move16 ();
39 }
40 return;
41 }