formats: clarify setting of reverse_bytes
[sox.git] / lpc10 / dcbias.c
blobb3e91cd92c6c0e249bba1a966ef8db834ad5959c
1 /*
3 * Revision 1.1 1996/08/19 22:40:23 jaf
4 * Initial revision
7 */
9 /* -- translated by f2c (version 19951025).
10 You must link the resulting object file with the libraries:
11 -lf2c -lm (in that order)
14 #include "f2c.h"
16 extern int dcbias_(integer *len, real *speech, real *sigout);
18 /* ********************************************************************* */
20 /* DCBIAS Version 50 */
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. */
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. */
34 /* Revision 1.1 1996/02/07 14:44:21 jaf */
35 /* Initial revision */
38 /* ********************************************************************* */
40 /* Calculate and remove DC bias from buffer. */
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 */
50 /* This subroutine has no local state. */
52 /* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
54 /* System generated locals */
55 integer i__1;
57 /* Local variables */
58 real bias;
59 integer i__;
61 /* Arguments */
62 /* Local variables that need not be saved */
63 /* Parameter adjustments */
64 --sigout;
65 --speech;
67 /* Function Body */
68 bias = 0.f;
69 i__1 = *len;
70 for (i__ = 1; i__ <= i__1; ++i__) {
71 bias += speech[i__];
73 bias /= *len;
74 i__1 = *len;
75 for (i__ = 1; i__ <= i__1; ++i__) {
76 sigout[i__] = speech[i__] - bias;
78 return 0;
79 } /* dcbias_ */