Asterisk - The Open Source Telephony Project GIT-master-f36a736
Functions
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

◆ energy_()

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

Definition at line 78 of file energy.c.

79{
80 /* System generated locals */
81 integer i__1;
82
83 /* Builtin functions */
84 double sqrt(doublereal);
85
86 /* Local variables */
87 integer i__;
88
89/* Arguments */
90/* Local variables that need not be saved */
91 /* Parameter adjustments */
92 --speech;
93
94 /* Function Body */
95 *rms = 0.f;
96 i__1 = *len;
97 for (i__ = 1; i__ <= i__1; ++i__) {
98 *rms += speech[i__] * speech[i__];
99 }
100 *rms = (real)sqrt(*rms / *len);
101 return 0;
102} /* energy_ */
double doublereal
Definition: f2c.h:50
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
float real
Definition: lpc10.h:79
INT32 integer
Definition: lpc10.h:80

References len().

Referenced by analys_().