3 * Revision 1.1 1996/08/19 22:32:17 jaf
9 /* -- translated by f2c (version 19951025).
10 You must link the resulting object file with the libraries:
11 -lf2c -lm (in that order)
16 extern int energy_(integer
*len
, real
*speech
, real
*rms
);
18 /* ********************************************************************* */
20 /* ENERGY Version 50 */
23 * Revision 1.1 1996/08/19 22:32:17 jaf
26 /* Revision 1.3 1996/03/18 21:17:41 jaf */
27 /* Just added a few comments about which array indices of the arguments */
28 /* are used, and mentioning that this subroutine has no local state. */
30 /* Revision 1.2 1996/03/13 16:46:02 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. */
34 /* Revision 1.1 1996/02/07 14:45:40 jaf */
35 /* Initial revision */
38 /* ********************************************************************* */
40 /* Compute RMS energy. */
43 /* LEN - Length of speech buffer */
44 /* SPEECH - Speech buffer */
45 /* Indices 1 through LEN read. */
47 /* RMS - Root Mean Square energy */
49 /* This subroutine has no local state. */
51 /* Subroutine */ int energy_(integer
*len
, real
*speech
, real
*rms
)
53 /* System generated locals */
56 /* Builtin functions */
57 double sqrt(doublereal
);
63 /* Local variables that need not be saved */
64 /* Parameter adjustments */
70 for (i__
= 1; i__
<= i__1
; ++i__
) {
71 *rms
+= speech
[i__
] * speech
[i__
];
73 *rms
= sqrt(*rms
/ *len
);