4
Revision 1.1.1.1 2001/11/19 19:50:14 smorlat
7
Revision 1.1.1.1 2001/08/08 21:29:08 simon
10
* Revision 1.1 1996/08/19 22:32:31 jaf
16
#ifdef P_R_O_T_O_T_Y_P_E_S
17
extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *maxptr);
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
/* DIFMAG Version 49 */
32
/* Revision 1.1.1.1 2001/11/19 19:50:14 smorlat
35
/* Revision 1.1.1.1 2001/08/08 21:29:08 simon
38
* Revision 1.1 1996/08/19 22:32:31 jaf
41
/* Revision 1.3 1996/03/15 23:09:39 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 14:41:31 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:04 jaf */
50
/* Initial revision */
53
/* ********************************************************************* */
55
/* Compute Average Magnitude Difference Function */
58
/* SPEECH - Low pass filtered speech */
59
/* Indices MIN_N1 through MAX_N1+LPITA-1 are read, where */
60
/* MIN_N1 = (MAXLAG - MAX_TAU)/2+1 MAX_TAU = max of TAU(I) for I=1,LTAU
62
/* MAX_N1 = (MAXLAG - MIN_TAU)/2+1 MIN_TAU = min of TAU(I) for I=1,LTAU
64
/* LPITA - Length of speech buffer */
65
/* TAU - Table of lags */
66
/* Indices 1 through LTAU read. */
67
/* LTAU - Number of lag values to compute */
68
/* MAXLAG - Maximum possible lag value */
70
/* (All of these outputs are also read, but only after being written.) */
71
/* AMDF - Average Magnitude Difference for each lag in TAU */
72
/* Indices 1 through LTAU written */
73
/* MINPTR - Index of minimum AMDF value */
74
/* MAXPTR - Index of maximum AMDF value */
76
/* This subroutine has no local state. */
78
/* Subroutine */ int difmag_(real *speech, integer *lpita, integer *tau,
79
integer *ltau, integer *maxlag, real *amdf, integer *minptr, integer *
82
/* System generated locals */
87
integer i__, j, n1, n2;
91
/* Local variables that need not be saved */
94
/* Parameter adjustments */
103
for (i__ = 1; i__ <= i__1; ++i__) {
104
n1 = (*maxlag - tau[i__]) / 2 + 1;
105
n2 = n1 + *lpita - 1;
108
for (j = n1; j <= i__2; j += 4) {
109
sum += (r__1 = speech[j] - speech[j + tau[i__]], abs(r__1));
112
if (amdf[i__] < amdf[*minptr]) {
115
if (amdf[i__] > amdf[*maxptr]) {