3 * Revision 1.1 1996/08/19 22:31:25 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 mload_(integer
*order
, integer
*awins
, integer
*awinf
, real
*speech
, real
*phi
, real
*psi
);
18 /* ***************************************************************** */
20 /* MLOAD Version 48 */
23 * Revision 1.1 1996/08/19 22:31:25 jaf
26 /* Revision 1.5 1996/03/27 23:59:51 jaf */
27 /* Added some more accurate comments about which indices of the argument */
28 /* array SPEECH are read. I thought that this might be the cause of a */
29 /* problem I've been having, but it isn't. */
31 /* Revision 1.4 1996/03/26 19:16:53 jaf */
32 /* Commented out the code at the end that copied the lower triangular */
33 /* half of PHI into the upper triangular half (making the resulting */
34 /* matrix symmetric). The upper triangular half was never used by later */
35 /* code in subroutine ANALYS. */
37 /* Revision 1.3 1996/03/18 21:16:00 jaf */
38 /* Just added a few comments about which array indices of the arguments */
39 /* are used, and mentioning that this subroutine has no local state. */
41 /* Revision 1.2 1996/03/13 16:47:41 jaf */
42 /* Comments added explaining that none of the local variables of this */
43 /* subroutine need to be saved from one invocation to the next. */
45 /* Revision 1.1 1996/02/07 14:48:01 jaf */
46 /* Initial revision */
49 /* ***************************************************************** */
51 /* Load a covariance matrix. */
54 /* ORDER - Analysis order */
55 /* AWINS - Analysis window start */
56 /* AWINF - Analysis window finish */
57 /* SPEECH(AWINF) - Speech buffer */
58 /* Indices MIN(AWINS, AWINF-(ORDER-1)) through */
59 /* MAX(AWINF, AWINS+(ORDER-1)) read. */
60 /* As long as (AWINF-AWINS) .GE. (ORDER-1), */
61 /* this is just indices AWINS through AWINF. */
63 /* PHI(ORDER,ORDER) - Covariance matrix */
64 /* Lower triangular half and diagonal written, and read.*/
65 /* Upper triangular half untouched. */
66 /* PSI(ORDER) - Prediction vector */
67 /* Indices 1 through ORDER written, */
68 /* and most are read after that. */
70 /* This subroutine has no local state. */
72 /* Subroutine */ int mload_(integer
*order
, integer
*awins
, integer
*awinf
,
73 real
*speech
, real
*phi
, real
*psi
)
75 /* System generated locals */
76 integer phi_dim1
, phi_offset
, i__1
, i__2
;
79 integer c__
, i__
, r__
, start
;
82 /* Local variables that need not be saved */
83 /* Load first column of triangular covariance matrix PHI */
84 /* Parameter adjustments */
87 phi_offset
= phi_dim1
+ 1;
92 start
= *awins
+ *order
;
94 for (r__
= 1; r__
<= i__1
; ++r__
) {
95 phi
[r__
+ phi_dim1
] = 0.f
;
97 for (i__
= start
; i__
<= i__2
; ++i__
) {
98 phi
[r__
+ phi_dim1
] += speech
[i__
- 1] * speech
[i__
- r__
];
101 /* Load last element of vector PSI */
104 for (i__
= start
; i__
<= i__1
; ++i__
) {
105 psi
[*order
] += speech
[i__
] * speech
[i__
- *order
];
107 /* End correct to get additional columns of PHI */
109 for (r__
= 2; r__
<= i__1
; ++r__
) {
111 for (c__
= 2; c__
<= i__2
; ++c__
) {
112 phi
[r__
+ c__
* phi_dim1
] = phi
[r__
- 1 + (c__
- 1) * phi_dim1
] -
113 speech
[*awinf
+ 1 - r__
] * speech
[*awinf
+ 1 - c__
] +
114 speech
[start
- r__
] * speech
[start
- c__
];
117 /* End correct to get additional elements of PSI */
119 for (c__
= 1; c__
<= i__1
; ++c__
) {
120 psi
[c__
] = phi
[c__
+ 1 + phi_dim1
] - speech
[start
- 1] * speech
[start
121 - 1 - c__
] + speech
[*awinf
] * speech
[*awinf
- c__
];
123 /* Copy lower triangular section into upper (why bother?) */
124 /* I'm commenting this out, since the upper triangular half of PHI
126 /* is never used by later code, unless a sufficiently high level of
128 /* tracing is turned on. */
131 /* PHI(C,R) = PHI(R,C) */