FreeCalypso > hg > efr-experiments
comparison src/residu.c @ 0:56410792419a
src: original EFR source from ETSI
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Wed, 03 Apr 2024 05:31:37 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:56410792419a |
|---|---|
| 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 } |
