3 * Revision 1.1 1996/08/19 22:32:31 jaf
9 /* -- translated by f2c (version 19951025).
10 You must link the resulting object file with the libraries:
11 -lf2c -lm (in that order)
16 extern int difmag_(real
*speech
, integer
*lpita
, integer
*tau
, integer
*ltau
, integer
*maxlag
, real
*amdf
, integer
*minptr
, integer
*maxptr
);
18 /* ********************************************************************** */
20 /* DIFMAG Version 49 */
23 * Revision 1.1 1996/08/19 22:32:31 jaf
26 /* Revision 1.3 1996/03/15 23:09:39 jaf */
27 /* Just added a few comments about which array indices of the arguments */
28 /* are used, and mentioning that this subroutine has no local state. */
30 /* Revision 1.2 1996/03/13 14:41:31 jaf */
31 /* Comments added explaining that none of the local variables of this */
32 /* subroutine need to be saved from one invocation to the next. */
34 /* Revision 1.1 1996/02/07 14:45:04 jaf */
35 /* Initial revision */
38 /* ********************************************************************* */
40 /* Compute Average Magnitude Difference Function */
43 /* SPEECH - Low pass filtered speech */
44 /* Indices MIN_N1 through MAX_N1+LPITA-1 are read, where */
45 /* MIN_N1 = (MAXLAG - MAX_TAU)/2+1 MAX_TAU = max of TAU(I) for I=1,LTAU
47 /* MAX_N1 = (MAXLAG - MIN_TAU)/2+1 MIN_TAU = min of TAU(I) for I=1,LTAU
49 /* LPITA - Length of speech buffer */
50 /* TAU - Table of lags */
51 /* Indices 1 through LTAU read. */
52 /* LTAU - Number of lag values to compute */
53 /* MAXLAG - Maximum possible lag value */
55 /* (All of these outputs are also read, but only after being written.) */
56 /* AMDF - Average Magnitude Difference for each lag in TAU */
57 /* Indices 1 through LTAU written */
58 /* MINPTR - Index of minimum AMDF value */
59 /* MAXPTR - Index of maximum AMDF value */
61 /* This subroutine has no local state. */
63 /* Subroutine */ int difmag_(real
*speech
, integer
*lpita
, integer
*tau
,
64 integer
*ltau
, integer
*maxlag
, real
*amdf
, integer
*minptr
, integer
*
67 /* System generated locals */
72 integer i__
, j
, n1
, n2
;
76 /* Local variables that need not be saved */
79 /* Parameter adjustments */
88 for (i__
= 1; i__
<= i__1
; ++i__
) {
89 n1
= (*maxlag
- tau
[i__
]) / 2 + 1;
93 for (j
= n1
; j
<= i__2
; j
+= 4) {
94 sum
+= (r__1
= speech
[j
] - speech
[j
+ tau
[i__
]], abs(r__1
));
97 if (amdf
[i__
] < amdf
[*minptr
]) {
100 if (amdf
[i__
] > amdf
[*maxptr
]) {