dcbias.c

Go to the documentation of this file.
00001 /*
00002 
00003 $Log$
00004 Revision 1.15  2004/06/26 03:50:14  markster
00005 Merge source cleanups (bug #1911)
00006 
00007 Revision 1.14  2003/02/12 13:59:14  matteo
00008 mer feb 12 14:56:57 CET 2003
00009 
00010 Revision 1.1.1.1  2003/02/12 13:59:14  matteo
00011 mer feb 12 14:56:57 CET 2003
00012 
00013 Revision 1.2  2000/01/05 08:20:39  markster
00014 Some OSS fixes and a few lpc changes to make it actually work
00015 
00016  * Revision 1.1  1996/08/19  22:40:23  jaf
00017  * Initial revision
00018  *
00019 
00020 */
00021 
00022 /*  -- translated by f2c (version 19951025).
00023    You must link the resulting object file with the libraries:
00024    -lf2c -lm   (in that order)
00025 */
00026 
00027 #include "f2c.h"
00028 
00029 #ifdef P_R_O_T_O_T_Y_P_E_S
00030 extern int dcbias_(integer *len, real *speech, real *sigout);
00031 #endif
00032 
00033 /* ********************************************************************* */
00034 
00035 /*    DCBIAS Version 50 */
00036 
00037 /* $Log$
00038  * Revision 1.15  2004/06/26 03:50:14  markster
00039  * Merge source cleanups (bug #1911)
00040  *
00041  * Revision 1.14  2003/02/12 13:59:14  matteo
00042  * mer feb 12 14:56:57 CET 2003
00043  *
00044  * Revision 1.1.1.1  2003/02/12 13:59:14  matteo
00045  * mer feb 12 14:56:57 CET 2003
00046  *
00047  * Revision 1.2  2000/01/05 08:20:39  markster
00048  * Some OSS fixes and a few lpc changes to make it actually work
00049  *
00050  * Revision 1.1  1996/08/19  22:40:23  jaf
00051  * Initial revision
00052  * */
00053 /* Revision 1.3  1996/03/18  21:19:22  jaf */
00054 /* Just added a few comments about which array indices of the arguments */
00055 /* are used, and mentioning that this subroutine has no local state. */
00056 
00057 /* Revision 1.2  1996/03/13  16:44:53  jaf */
00058 /* Comments added explaining that none of the local variables of this */
00059 /* subroutine need to be saved from one invocation to the next. */
00060 
00061 /* Revision 1.1  1996/02/07 14:44:21  jaf */
00062 /* Initial revision */
00063 
00064 
00065 /* ********************************************************************* */
00066 
00067 /* Calculate and remove DC bias from buffer. */
00068 
00069 /* Input: */
00070 /*  LEN    - Length of speech buffers */
00071 /*  SPEECH - Input speech buffer */
00072 /*           Indices 1 through LEN read. */
00073 /* Output: */
00074 /*  SIGOUT - Output speech buffer */
00075 /*           Indices 1 through LEN written */
00076 
00077 /* This subroutine has no local state. */
00078 
00079 /* Subroutine */ int dcbias_(integer *len, real *speech, real *sigout)
00080 {
00081     /* System generated locals */
00082     integer i__1;
00083 
00084     /* Local variables */
00085     real bias;
00086     integer i__;
00087 
00088 /*    Arguments */
00089 /*       Local variables that need not be saved */
00090     /* Parameter adjustments */
00091     --sigout;
00092     --speech;
00093 
00094     /* Function Body */
00095     bias = 0.f;
00096     i__1 = *len;
00097     for (i__ = 1; i__ <= i__1; ++i__) {
00098    bias += speech[i__];
00099     }
00100     bias /= *len;
00101     i__1 = *len;
00102     for (i__ = 1; i__ <= i__1; ++i__) {
00103    sigout[i__] = speech[i__] - bias;
00104     }
00105     return 0;
00106 } /* dcbias_ */
00107 

Generated on Thu Apr 16 06:27:32 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6