deemp.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.2  1996/08/20  20:23:46  jaf
00017  * Removed all static local variables that were SAVE'd in the Fortran
00018  * code, and put them in struct lpc10_decoder_state that is passed as an
00019  * argument.
00020  *
00021  * Removed init function, since all initialization is now done in
00022  * init_lpc10_decoder_state().
00023  *
00024  * Revision 1.1  1996/08/19  22:32:34  jaf
00025  * Initial revision
00026  *
00027 
00028 */
00029 
00030 /*  -- translated by f2c (version 19951025).
00031    You must link the resulting object file with the libraries:
00032    -lf2c -lm   (in that order)
00033 */
00034 
00035 #include "f2c.h"
00036 
00037 #ifdef P_R_O_T_O_T_Y_P_E_S
00038 extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
00039 #endif
00040 
00041 /* ***************************************************************** */
00042 
00043 /*    DEEMP Version 48 */
00044 
00045 /* $Log$
00046  * Revision 1.15  2004/06/26 03:50:14  markster
00047  * Merge source cleanups (bug #1911)
00048  *
00049  * Revision 1.14  2003/02/12 13:59:14  matteo
00050  * mer feb 12 14:56:57 CET 2003
00051  *
00052  * Revision 1.1.1.1  2003/02/12 13:59:14  matteo
00053  * mer feb 12 14:56:57 CET 2003
00054  *
00055  * Revision 1.2  2000/01/05 08:20:39  markster
00056  * Some OSS fixes and a few lpc changes to make it actually work
00057  *
00058  * Revision 1.2  1996/08/20  20:23:46  jaf
00059  * Removed all static local variables that were SAVE'd in the Fortran
00060  * code, and put them in struct lpc10_decoder_state that is passed as an
00061  * argument.
00062  *
00063  * Removed init function, since all initialization is now done in
00064  * init_lpc10_decoder_state().
00065  *
00066  * Revision 1.1  1996/08/19  22:32:34  jaf
00067  * Initial revision
00068  * */
00069 /* Revision 1.3  1996/03/20  15:54:37  jaf */
00070 /* Added comments about which indices of array arguments are read or */
00071 /* written. */
00072 
00073 /* Added entry INITDEEMP to reinitialize the local state variables, if */
00074 /* desired. */
00075 
00076 /* Revision 1.2  1996/03/14  22:11:13  jaf */
00077 /* Comments added explaining which of the local variables of this */
00078 /* subroutine need to be saved from one invocation to the next, and which */
00079 /* do not. */
00080 
00081 /* Revision 1.1  1996/02/07 14:44:53  jaf */
00082 /* Initial revision */
00083 
00084 
00085 /* ***************************************************************** */
00086 
00087 /*  De-Emphasize output speech with   1 / ( 1 - .75z**-1 ) */
00088 /*    cascaded with 200 Hz high pass filter */
00089 /*    ( 1 - 1.9998z**-1 + z**-2 ) / ( 1 - 1.75z**-1 + .78z**-2 ) */
00090 
00091 /*  WARNING!  The coefficients above may be out of date with the code */
00092 /*  below.  Either that, or some kind of transformation was performed */
00093 /*  on the coefficients above to create the code below. */
00094 
00095 /* Input: */
00096 /*  N  - Number of samples */
00097 /* Input/Output: */
00098 /*  X  - Speech */
00099 /*       Indices 1 through N are read before being written. */
00100 
00101 /* This subroutine maintains local state from one call to the next.  If */
00102 /* you want to switch to using a new audio stream for this filter, or */
00103 /* reinitialize its state for any other reason, call the ENTRY */
00104 /* INITDEEMP. */
00105 
00106 /* Subroutine */ int deemp_(real *x, integer *n, struct lpc10_decoder_state *st)
00107 {
00108     /* Initialized data */
00109 
00110     real *dei1;
00111     real *dei2;
00112     real *deo1;
00113     real *deo2;
00114     real *deo3;
00115 
00116     /* System generated locals */
00117     integer i__1;
00118     real r__1;
00119 
00120     /* Local variables */
00121     integer k;
00122     real dei0;
00123 
00124 /*       Arguments */
00125 /*       Local variables that need not be saved */
00126 /*       Local state */
00127 /*       All of the locals saved below were not given explicit initial */
00128 /*       values in the original code.  I think 0 is a safe choice. */
00129     /* Parameter adjustments */
00130     if (x) {
00131    --x;
00132    }
00133 
00134     /* Function Body */
00135 
00136     dei1 = &(st->dei1);
00137     dei2 = &(st->dei2);
00138     deo1 = &(st->deo1);
00139     deo2 = &(st->deo2);
00140     deo3 = &(st->deo3);
00141 
00142     i__1 = *n;
00143     for (k = 1; k <= i__1; ++k) {
00144    dei0 = x[k];
00145    r__1 = x[k] - *dei1 * 1.9998f + *dei2;
00146    x[k] = r__1 + *deo1 * 2.5f - *deo2 * 2.0925f + *deo3 * .585f;
00147    *dei2 = *dei1;
00148    *dei1 = dei0;
00149    *deo3 = *deo2;
00150    *deo2 = *deo1;
00151    *deo1 = x[k];
00152     }
00153     return 0;
00154 } /* deemp_ */

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