3 * Revision 1.1 1996/08/19 22:31:53 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 ivfilt_(real
*lpbuf
, real
*ivbuf
, integer
*len
, integer
*nsamp
, real
*ivrc
);
18 /* ********************************************************************* */
20 /* IVFILT Version 48 */
23 * Revision 1.1 1996/08/19 22:31:53 jaf
26 /* Revision 1.3 1996/03/15 21:36:29 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 00:01:00 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:47:34 jaf */
35 /* Initial revision */
38 /* ********************************************************************* */
40 /* 2nd order inverse filter, speech is decimated 4:1 */
43 /* LEN - Length of speech buffers */
44 /* NSAMP - Number of samples to filter */
45 /* LPBUF - Low pass filtered speech buffer */
46 /* Indices LEN-NSAMP-7 through LEN read. */
48 /* IVBUF - Inverse filtered speech buffer */
49 /* Indices LEN-NSAMP+1 through LEN written. */
50 /* IVRC - Inverse filter reflection coefficients (for voicing) */
51 /* Indices 1 and 2 both written (also read, but only after writing).
54 /* This subroutine has no local state. */
56 /* Subroutine */ int ivfilt_(real
*lpbuf
, real
*ivbuf
, integer
*len
, integer
*
59 /* System generated locals */
64 real r__
[3], pc1
, pc2
;
67 /* Local variables that need not be saved */
70 /* Calculate Autocorrelations */
71 /* Parameter adjustments */
77 for (i__
= 1; i__
<= 3; ++i__
) {
81 for (j
= (i__
<< 2) + *len
- *nsamp
; j
<= i__1
; j
+= 2) {
82 r__
[i__
- 1] += lpbuf
[j
] * lpbuf
[j
- k
];
85 /* Calculate predictor coefficients */
90 if (r__
[0] > 1e-10f
) {
91 ivrc
[1] = r__
[1] / r__
[0];
92 ivrc
[2] = (r__
[2] - ivrc
[1] * r__
[1]) / (r__
[0] - ivrc
[1] * r__
[1]);
93 pc1
= ivrc
[1] - ivrc
[1] * ivrc
[2];
96 /* Inverse filter LPBUF into IVBUF */
98 for (i__
= *len
+ 1 - *nsamp
; i__
<= i__1
; ++i__
) {
99 ivbuf
[i__
] = lpbuf
[i__
] - pc1
* lpbuf
[i__
- 4] - pc2
* lpbuf
[i__
- 8];