Asterisk - The Open Source Telephony Project GIT-master-f36a736
Functions
difmag.c File Reference
#include "f2c.h"
Include dependency graph for difmag.c:

Go to the source code of this file.

Functions

int difmag_ (real *speech, integer *lpita, integer *tau, integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *maxptr)
 

Function Documentation

◆ difmag_()

int difmag_ ( real speech,
integer lpita,
integer tau,
integer ltau,
integer maxlag,
real amdf,
integer minptr,
integer maxptr 
)

Definition at line 90 of file difmag.c.

93{
94 /* System generated locals */
95 integer i__1, i__2;
96 real r__1;
97
98 /* Local variables */
99 integer i__, j, n1, n2;
100 real sum;
101
102/* Arguments */
103/* Local variables that need not be saved */
104/* Local state */
105/* None */
106 /* Parameter adjustments */
107 --amdf;
108 --tau;
109 --speech;
110
111 /* Function Body */
112 *minptr = 1;
113 *maxptr = 1;
114 i__1 = *ltau;
115 for (i__ = 1; i__ <= i__1; ++i__) {
116 n1 = (*maxlag - tau[i__]) / 2 + 1;
117 n2 = n1 + *lpita - 1;
118 sum = 0.f;
119 i__2 = n2;
120 for (j = n1; j <= i__2; j += 4) {
121 sum += (r__1 = speech[j] - speech[j + tau[i__]], abs(r__1));
122 }
123 amdf[i__] = sum;
124 if (amdf[i__] < amdf[*minptr]) {
125 *minptr = i__;
126 }
127 if (amdf[i__] > amdf[*maxptr]) {
128 *maxptr = i__;
129 }
130 }
131 return 0;
132} /* difmag_ */
#define abs(x)
Definition: f2c.h:195
float real
Definition: lpc10.h:79
INT32 integer
Definition: lpc10.h:80

References abs.

Referenced by tbdm_().