Asterisk - The Open Source Telephony Project GIT-master-f36a736
irc2pc.c
Go to the documentation of this file.
1/*
2
3$Log$
4Revision 1.15 2004/06/26 03:50:14 markster
5Merge source cleanups (bug #1911)
6
7Revision 1.14 2003/02/12 13:59:15 matteo
8mer feb 12 14:56:57 CET 2003
9
10Revision 1.1.1.1 2003/02/12 13:59:15 matteo
11mer feb 12 14:56:57 CET 2003
12
13Revision 1.2 2000/01/05 08:20:39 markster
14Some OSS fixes and a few lpc changes to make it actually work
15
16 * Revision 1.1 1996/08/19 22:31:56 jaf
17 * Initial revision
18 *
19
20*/
21
22/* -- translated by f2c (version 19951025).
23 You must link the resulting object file with the libraries:
24 -lf2c -lm (in that order)
25*/
26
27#include "f2c.h"
28
29#ifdef P_R_O_T_O_T_Y_P_E_S
30extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
31#endif
32
33/* ***************************************************************** */
34
35/* IRC2PC Version 48 */
36
37/* $Log$
38 * Revision 1.15 2004/06/26 03:50:14 markster
39 * Merge source cleanups (bug #1911)
40 *
41 * Revision 1.14 2003/02/12 13:59:15 matteo
42 * mer feb 12 14:56:57 CET 2003
43 *
44 * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
45 * mer feb 12 14:56:57 CET 2003
46 *
47 * Revision 1.2 2000/01/05 08:20:39 markster
48 * Some OSS fixes and a few lpc changes to make it actually work
49 *
50 * Revision 1.1 1996/08/19 22:31:56 jaf
51 * Initial revision
52 * */
53/* Revision 1.3 1996/03/20 15:47:19 jaf */
54/* Added comments about which indices of array arguments are read or */
55/* written. */
56
57/* Revision 1.2 1996/03/14 16:59:04 jaf */
58/* Comments added explaining that none of the local variables of this */
59/* subroutine need to be saved from one invocation to the next. */
60
61/* Revision 1.1 1996/02/07 14:47:27 jaf */
62/* Initial revision */
63
64
65/* ***************************************************************** */
66
67/* Convert Reflection Coefficients to Predictor Coeficients */
68
69/* Inputs: */
70/* RC - Reflection coefficients */
71/* Indices 1 through ORDER read. */
72/* ORDER - Number of RC's */
73/* GPRIME - Excitation modification gain */
74/* Outputs: */
75/* PC - Predictor coefficients */
76/* Indices 1 through ORDER written. */
77/* Indices 1 through ORDER-1 are read after being written. */
78/* G2PASS - Excitation modification sharpening factor */
79
80/* This subroutine has no local state. */
81
82/* Subroutine */ int irc2pc_(real *rc, real *pc, integer *order, real *gprime,
83 real *g2pass)
84{
85 /* System generated locals */
86 integer i__1, i__2;
87
88 /* Builtin functions */
89 double sqrt(doublereal);
90
91 /* Local variables */
92 real temp[10];
93 integer i__, j;
94
95/* Arguments */
96/* $Log$
97 * Revision 1.15 2004/06/26 03:50:14 markster
98 * Merge source cleanups (bug #1911)
99 *
100 * Revision 1.14 2003/02/12 13:59:15 matteo
101 * mer feb 12 14:56:57 CET 2003
102 *
103 * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
104 * mer feb 12 14:56:57 CET 2003
105 *
106 * Revision 1.2 2000/01/05 08:20:39 markster
107 * Some OSS fixes and a few lpc changes to make it actually work
108 *
109 * Revision 1.1 1996/08/19 22:31:56 jaf
110 * Initial revision
111 * */
112/* Revision 1.3 1996/03/29 22:03:47 jaf */
113/* Removed definitions for any constants that were no longer used. */
114
115/* Revision 1.2 1996/03/26 19:34:33 jaf */
116/* Added comments indicating which constants are not needed in an */
117/* application that uses the LPC-10 coder. */
118
119/* Revision 1.1 1996/02/07 14:43:51 jaf */
120/* Initial revision */
121
122/* LPC Configuration parameters: */
123/* Frame size, Prediction order, Pitch period */
124/* Local variables that need not be saved */
125 /* Parameter adjustments */
126 --pc;
127 --rc;
128
129 /* Function Body */
130 *g2pass = 1.f;
131 i__1 = *order;
132 for (i__ = 1; i__ <= i__1; ++i__) {
133 *g2pass *= 1.f - rc[i__] * rc[i__];
134 }
135 *g2pass = *gprime * (real)sqrt(*g2pass);
136 pc[1] = rc[1];
137 i__1 = *order;
138 for (i__ = 2; i__ <= i__1; ++i__) {
139 i__2 = i__ - 1;
140 for (j = 1; j <= i__2; ++j) {
141 temp[j - 1] = pc[j] - rc[i__] * pc[i__ - j];
142 }
143 i__2 = i__ - 1;
144 for (j = 1; j <= i__2; ++j) {
145 pc[j] = temp[j - 1];
146 }
147 pc[i__] = rc[i__];
148 }
149 return 0;
150} /* irc2pc_ */
integer order
Definition: analys.c:66
double doublereal
Definition: f2c.h:50
int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass)
Definition: irc2pc.c:82
float real
Definition: lpc10.h:79
INT32 integer
Definition: lpc10.h:80