Asterisk - The Open Source Telephony Project GIT-master-f36a736
dcbias.c
Go to the documentation of this file.
1/*
2
3$Log$
4Revision 1.15 2004/06/26 03:50:14 markster
5Merge source cleanups (bug #1911)
6
7Revision 1.14 2003/02/12 13:59:14 matteo
8mer feb 12 14:56:57 CET 2003
9
10Revision 1.1.1.1 2003/02/12 13:59:14 matteo
11mer feb 12 14:56:57 CET 2003
12
13Revision 1.2 2000/01/05 08:20:39 markster
14Some OSS fixes and a few lpc changes to make it actually work
15
16 * Revision 1.1 1996/08/19 22:40:23 jaf
17 * Initial revision
18 *
19
20*/
21
22/* -- translated by f2c (version 19951025).
23 You must link the resulting object file with the libraries:
24 -lf2c -lm (in that order)
25*/
26
27#include "f2c.h"
28
29#ifdef P_R_O_T_O_T_Y_P_E_S
30extern int dcbias_(integer *len, real *speech, real *sigout);
31#endif
32
33/* ********************************************************************* */
34
35/* DCBIAS Version 50 */
36
37/* $Log$
38 * Revision 1.15 2004/06/26 03:50:14 markster
39 * Merge source cleanups (bug #1911)
40 *
41 * Revision 1.14 2003/02/12 13:59:14 matteo
42 * mer feb 12 14:56:57 CET 2003
43 *
44 * Revision 1.1.1.1 2003/02/12 13:59:14 matteo
45 * mer feb 12 14:56:57 CET 2003
46 *
47 * Revision 1.2 2000/01/05 08:20:39 markster
48 * Some OSS fixes and a few lpc changes to make it actually work
49 *
50 * Revision 1.1 1996/08/19 22:40:23 jaf
51 * Initial revision
52 * */
53/* Revision 1.3 1996/03/18 21:19:22 jaf */
54/* Just added a few comments about which array indices of the arguments */
55/* are used, and mentioning that this subroutine has no local state. */
56
57/* Revision 1.2 1996/03/13 16:44:53 jaf */
58/* Comments added explaining that none of the local variables of this */
59/* subroutine need to be saved from one invocation to the next. */
60
61/* Revision 1.1 1996/02/07 14:44:21 jaf */
62/* Initial revision */
63
64
65/* ********************************************************************* */
66
67/* Calculate and remove DC bias from buffer. */
68
69/* Input: */
70/* LEN - Length of speech buffers */
71/* SPEECH - Input speech buffer */
72/* Indices 1 through LEN read. */
73/* Output: */
74/* SIGOUT - Output speech buffer */
75/* Indices 1 through LEN written */
76
77/* This subroutine has no local state. */
78
79/* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
80{
81 /* System generated locals */
82 integer i__1;
83
84 /* Local variables */
85 real bias;
86 integer i__;
87
88/* Arguments */
89/* Local variables that need not be saved */
90 /* Parameter adjustments */
91 --sigout;
92 --speech;
93
94 /* Function Body */
95 bias = 0.f;
96 i__1 = *len;
97 for (i__ = 1; i__ <= i__1; ++i__) {
98 bias += speech[i__];
99 }
100 bias /= *len;
101 i__1 = *len;
102 for (i__ = 1; i__ <= i__1; ++i__) {
103 sigout[i__] = speech[i__] - bias;
104 }
105 return 0;
106} /* dcbias_ */
int dcbias_(integer *len, real *speech, real *sigout)
Definition: dcbias.c:79
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
float real
Definition: lpc10.h:79
INT32 integer
Definition: lpc10.h:80