1 /*
2
3 * Revision 1.1 1996/08/19 22:31:56 jaf
4 * Initial revision
5 *
6
7 */
8
9 /* -- translated by f2c (version 19951025).
10 You must link the resulting object file with the libraries:
11 -lf2c -lm (in that order)
12 */
13
14 #include "f2c.h"
15
16 extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
17
18 /* ***************************************************************** */
19
20 /* IRC2PC Version 48 */
21
22 /*
23 * Revision 1.1 1996/08/19 22:31:56 jaf
24 * Initial revision
25 * */
26 /* Revision 1.3 1996/03/20 15:47:19 jaf */
27 /* Added comments about which indices of array arguments are read or */
28 /* written. */
29
30 /* Revision 1.2 1996/03/14 16:59:04 jaf */
31 /* Comments added explaining that none of the local variables of this */
32 /* subroutine need to be saved from one invocation to the next. */
33
34 /* Revision 1.1 1996/02/07 14:47:27 jaf */
35 /* Initial revision */
36
37
38 /* ***************************************************************** */
39
40 /* Convert Reflection Coefficients to Predictor Coeficients */
41
42 /* Inputs: */
43 /* RC - Reflection coefficients */
44 /* Indices 1 through ORDER read. */
45 /* ORDER - Number of RC's */
46 /* GPRIME - Excitation modification gain */
47 /* Outputs: */
48 /* PC - Predictor coefficients */
49 /* Indices 1 through ORDER written. */
50 /* Indices 1 through ORDER-1 are read after being written. */
51 /* G2PASS - Excitation modification sharpening factor */
52
53 /* This subroutine has no local state. */
54
irc2pc_(real * rc,real * pc,integer * order,real * gprime,real * g2pass)55 /* Subroutine */ int irc2pc_(real *rc, real *pc, integer *order, real *gprime,
56 real *g2pass)
57 {
58 /* System generated locals */
59 integer i__1, i__2;
60
61 /* Builtin functions */
62 double sqrt(doublereal);
63
64 /* Local variables */
65 real temp[10];
66 integer i__, j;
67
68 /* Arguments */
69 /* LPC Configuration parameters: */
70 /* Frame size, Prediction order, Pitch period */
71 /* Local variables that need not be saved */
72 /* Parameter adjustments */
73 --pc;
74 --rc;
75
76 /* Function Body */
77 *g2pass = 1.f;
78 i__1 = *order;
79 for (i__ = 1; i__ <= i__1; ++i__) {
80 *g2pass *= 1.f - rc[i__] * rc[i__];
81 }
82 *g2pass = *gprime * sqrt(*g2pass);
83 pc[1] = rc[1];
84 i__1 = *order;
85 for (i__ = 2; i__ <= i__1; ++i__) {
86 i__2 = i__ - 1;
87 for (j = 1; j <= i__2; ++j) {
88 temp[j - 1] = pc[j] - rc[i__] * pc[i__ - j];
89 }
90 i__2 = i__ - 1;
91 for (j = 1; j <= i__2; ++j) {
92 pc[j] = temp[j - 1];
93 }
94 pc[i__] = rc[i__];
95 }
96 return 0;
97 } /* irc2pc_ */
98
99