4
Revision 1.1.1.1 2001/11/19 19:50:15 smorlat
7
Revision 1.1.1.1 2001/08/08 21:29:08 simon
10
* Revision 1.1 1996/08/19 22:32:17 jaf
16
#ifdef P_R_O_T_O_T_Y_P_E_S
17
extern int energy_(integer *len, real *speech, real *rms);
20
/* -- translated by f2c (version 19951025).
21
You must link the resulting object file with the libraries:
22
-lf2c -lm (in that order)
27
/* ********************************************************************* */
29
/* ENERGY Version 50 */
32
/* Revision 1.1.1.1 2001/11/19 19:50:15 smorlat
35
/* Revision 1.1.1.1 2001/08/08 21:29:08 simon
38
* Revision 1.1 1996/08/19 22:32:17 jaf
41
/* Revision 1.3 1996/03/18 21:17:41 jaf */
42
/* Just added a few comments about which array indices of the arguments */
43
/* are used, and mentioning that this subroutine has no local state. */
45
/* Revision 1.2 1996/03/13 16:46:02 jaf */
46
/* Comments added explaining that none of the local variables of this */
47
/* subroutine need to be saved from one invocation to the next. */
49
/* Revision 1.1 1996/02/07 14:45:40 jaf */
50
/* Initial revision */
53
/* ********************************************************************* */
55
/* Compute RMS energy. */
58
/* LEN - Length of speech buffer */
59
/* SPEECH - Speech buffer */
60
/* Indices 1 through LEN read. */
62
/* RMS - Root Mean Square energy */
64
/* This subroutine has no local state. */
66
/* Subroutine */ int energy_(integer *len, real *speech, real *rms)
68
/* System generated locals */
71
/* Builtin functions */
72
double sqrt(doublereal);
78
/* Local variables that need not be saved */
79
/* Parameter adjustments */
85
for (i__ = 1; i__ <= i__1; ++i__) {
86
*rms += speech[i__] * speech[i__];
88
*rms = sqrt(*rms / *len);