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

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.

References abs.

Referenced by tbdm_().

00093 {
00094     /* System generated locals */
00095     integer i__1, i__2;
00096     real r__1;
00097 
00098     /* Local variables */
00099     integer i__, j, n1, n2;
00100     real sum;
00101 
00102 /*       Arguments */
00103 /*       Local variables that need not be saved */
00104 /*       Local state */
00105 /*       None */
00106     /* Parameter adjustments */
00107     --amdf;
00108     --tau;
00109     --speech;
00110 
00111     /* Function Body */
00112     *minptr = 1;
00113     *maxptr = 1;
00114     i__1 = *ltau;
00115     for (i__ = 1; i__ <= i__1; ++i__) {
00116    n1 = (*maxlag - tau[i__]) / 2 + 1;
00117    n2 = n1 + *lpita - 1;
00118    sum = 0.f;
00119    i__2 = n2;
00120    for (j = n1; j <= i__2; j += 4) {
00121        sum += (r__1 = speech[j] - speech[j + tau[i__]], abs(r__1));
00122    }
00123    amdf[i__] = sum;
00124    if (amdf[i__] < amdf[*minptr]) {
00125        *minptr = i__;
00126    }
00127    if (amdf[i__] > amdf[*maxptr]) {
00128        *maxptr = i__;
00129    }
00130     }
00131     return 0;
00132 } /* difmag_ */


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