4 Revision 1.11 2000/01/05 08:20:39 markster
5 Version 0.1.12 from FTP
7 Revision 1.2 2000/01/05 08:20:39 markster
8 Some OSS fixes and a few lpc changes to make it actually work
10 * Revision 1.1 1996/08/19 22:31:25 jaf
16 #ifdef P_R_O_T_O_T_Y_P_E_S
17 extern int mload_(integer *order, integer *awins, integer *awinf, real *speech, real *phi, real *psi);
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 /* MLOAD Version 48 */
32 * Revision 1.11 2000/01/05 08:20:39 markster
33 * Version 0.1.12 from FTP
35 /* Revision 1.2 2000/01/05 08:20:39 markster
36 /* Some OSS fixes and a few lpc changes to make it actually work
38 * Revision 1.1 1996/08/19 22:31:25 jaf
41 /* Revision 1.5 1996/03/27 23:59:51 jaf */
42 /* Added some more accurate comments about which indices of the argument */
43 /* array SPEECH are read. I thought that this might be the cause of a */
44 /* problem I've been having, but it isn't. */
46 /* Revision 1.4 1996/03/26 19:16:53 jaf */
47 /* Commented out the code at the end that copied the lower triangular */
48 /* half of PHI into the upper triangular half (making the resulting */
49 /* matrix symmetric). The upper triangular half was never used by later */
50 /* code in subroutine ANALYS. */
52 /* Revision 1.3 1996/03/18 21:16:00 jaf */
53 /* Just added a few comments about which array indices of the arguments */
54 /* are used, and mentioning that this subroutine has no local state. */
56 /* Revision 1.2 1996/03/13 16:47:41 jaf */
57 /* Comments added explaining that none of the local variables of this */
58 /* subroutine need to be saved from one invocation to the next. */
60 /* Revision 1.1 1996/02/07 14:48:01 jaf */
61 /* Initial revision */
64 /* ***************************************************************** */
66 /* Load a covariance matrix. */
69 /* ORDER - Analysis order */
70 /* AWINS - Analysis window start */
71 /* AWINF - Analysis window finish */
72 /* SPEECH(AWINF) - Speech buffer */
73 /* Indices MIN(AWINS, AWINF-(ORDER-1)) through */
74 /* MAX(AWINF, AWINS+(ORDER-1)) read. */
75 /* As long as (AWINF-AWINS) .GE. (ORDER-1), */
76 /* this is just indices AWINS through AWINF. */
78 /* PHI(ORDER,ORDER) - Covariance matrix */
79 /* Lower triangular half and diagonal written, and read.*/
80 /* Upper triangular half untouched. */
81 /* PSI(ORDER) - Prediction vector */
82 /* Indices 1 through ORDER written, */
83 /* and most are read after that. */
85 /* This subroutine has no local state. */
87 /* Subroutine */ int mload_(integer *order, integer *awins, integer *awinf,
88 real *speech, real *phi, real *psi)
90 /* System generated locals */
91 integer phi_dim1, phi_offset, i__1, i__2;
94 integer c__, i__, r__, start;
97 /* Local variables that need not be saved */
98 /* Load first column of triangular covariance matrix PHI */
99 /* Parameter adjustments */
102 phi_offset = phi_dim1 + 1;
107 start = *awins + *order;
109 for (r__ = 1; r__ <= i__1; ++r__) {
110 phi[r__ + phi_dim1] = 0.f;
112 for (i__ = start; i__ <= i__2; ++i__) {
113 phi[r__ + phi_dim1] += speech[i__ - 1] * speech[i__ - r__];
116 /* Load last element of vector PSI */
119 for (i__ = start; i__ <= i__1; ++i__) {
120 psi[*order] += speech[i__] * speech[i__ - *order];
122 /* End correct to get additional columns of PHI */
124 for (r__ = 2; r__ <= i__1; ++r__) {
126 for (c__ = 2; c__ <= i__2; ++c__) {
127 phi[r__ + c__ * phi_dim1] = phi[r__ - 1 + (c__ - 1) * phi_dim1] -
128 speech[*awinf + 1 - r__] * speech[*awinf + 1 - c__] +
129 speech[start - r__] * speech[start - c__];
132 /* End correct to get additional elements of PSI */
134 for (c__ = 1; c__ <= i__1; ++c__) {
135 psi[c__] = phi[c__ + 1 + phi_dim1] - speech[start - 1] * speech[start
136 - 1 - c__] + speech[*awinf] * speech[*awinf - c__];
138 /* Copy lower triangular section into upper (why bother?) */
139 /* I'm commenting this out, since the upper triangular half of PHI
141 /* is never used by later code, unless a sufficiently high level of
143 /* tracing is turned on. */
146 /* PHI(C,R) = PHI(R,C) */