1 /*
2 
3  * Revision 1.1  1996/08/19  22:40:23  jaf
4  * Initial revision
5  *
6 
7 */
8 
9 /*  -- translated by f2c (version 19951025).
10    You must link the resulting object file with the libraries:
11 	-lf2c -lm   (in that order)
12 */
13 
14 #include "f2c.h"
15 
16 extern int dcbias_(integer *len, real *speech, real *sigout);
17 
18 /* ********************************************************************* */
19 
20 /* 	DCBIAS Version 50 */
21 
22 /*
23  * Revision 1.1  1996/08/19  22:40:23  jaf
24  * Initial revision
25  * */
26 /* Revision 1.3  1996/03/18  21:19:22  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. */
29 
30 /* Revision 1.2  1996/03/13  16:44:53  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. */
33 
34 /* Revision 1.1  1996/02/07 14:44:21  jaf */
35 /* Initial revision */
36 
37 
38 /* ********************************************************************* */
39 
40 /* Calculate and remove DC bias from buffer. */
41 
42 /* Input: */
43 /*  LEN    - Length of speech buffers */
44 /*  SPEECH - Input speech buffer */
45 /*           Indices 1 through LEN read. */
46 /* Output: */
47 /*  SIGOUT - Output speech buffer */
48 /*           Indices 1 through LEN written */
49 
50 /* This subroutine has no local state. */
51 
dcbias_(integer * len,real * speech,real * sigout)52 /* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
53 {
54     /* System generated locals */
55     integer i__1;
56 
57     /* Local variables */
58     real bias;
59     integer i__;
60 
61 /* 	Arguments */
62 /*       Local variables that need not be saved */
63     /* Parameter adjustments */
64     --sigout;
65     --speech;
66 
67     /* Function Body */
68     bias = 0.f;
69     i__1 = *len;
70     for (i__ = 1; i__ <= i__1; ++i__) {
71 	bias += speech[i__];
72     }
73     bias /= *len;
74     i__1 = *len;
75     for (i__ = 1; i__ <= i__1; ++i__) {
76 	sigout[i__] = speech[i__] - bias;
77     }
78     return 0;
79 } /* dcbias_ */
80 
81