energy.c File Reference

#include "f2c.h"

Include dependency graph for energy.c:

Go to the source code of this file.

Functions

int energy_ (integer *len, real *speech, real *rms)


Function Documentation

int energy_ ( integer len,
real speech,
real rms 
)

Definition at line 78 of file energy.c.

Referenced by analys_().

00079 {
00080     /* System generated locals */
00081     integer i__1;
00082 
00083     /* Builtin functions */
00084     double sqrt(doublereal);
00085 
00086     /* Local variables */
00087     integer i__;
00088 
00089 /*       Arguments */
00090 /*       Local variables that need not be saved */
00091     /* Parameter adjustments */
00092     --speech;
00093 
00094     /* Function Body */
00095     *rms = 0.f;
00096     i__1 = *len;
00097     for (i__ = 1; i__ <= i__1; ++i__) {
00098    *rms += speech[i__] * speech[i__];
00099     }
00100     *rms = (real)sqrt(*rms / *len);
00101     return 0;
00102 } /* energy_ */


Generated on Thu Apr 16 06:30:51 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6