4 Revision 1.6 2000/01/05 08:20:39 markster
7 Revision 1.2 2000/01/05 08:20:39 markster
8 Some OSS fixes and a few lpc changes to make it actually work
10 * Revision 1.1 1996/08/19 22:31:35 jaf
16 #ifdef P_R_O_T_O_T_Y_P_E_S
17 extern int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp);
20 /* -- translated by f2c (version 19951025).
21 You must link the resulting object file with the libraries:
22 -lf2c -lm (in that order)
27 /* *********************************************************************** */
29 /* LPFILT Version 55 */
32 * Revision 1.6 2000/01/05 08:20:39 markster
33 * Version 0.1.7 from FTP
35 /* Revision 1.2 2000/01/05 08:20:39 markster
36 /* Some OSS fixes and a few lpc changes to make it actually work
38 * Revision 1.1 1996/08/19 22:31:35 jaf
41 /* Revision 1.3 1996/03/15 16:53:49 jaf */
42 /* Just put comment header in standard form. */
44 /* Revision 1.2 1996/03/12 23:58:06 jaf */
45 /* Comments added explaining that none of the local variables of this */
46 /* subroutine need to be saved from one invocation to the next. */
48 /* Revision 1.1 1996/02/07 14:47:44 jaf */
49 /* Initial revision */
52 /* *********************************************************************** */
54 /* 31 Point Equiripple FIR Low-Pass Filter */
55 /* Linear phase, delay = 15 samples */
57 /* Passband: ripple = 0.25 dB, cutoff = 800 Hz */
58 /* Stopband: atten. = 40. dB, cutoff = 1240 Hz */
61 /* LEN - Length of speech buffers */
62 /* NSAMP - Number of samples to filter */
63 /* INBUF - Input speech buffer */
64 /* Indices len-nsamp-29 through len are read. */
66 /* LPBUF - Low passed speech buffer (must be different array than INBUF) */
67 /* Indices len+1-nsamp through len are written. */
69 /* This subroutine has no local state. */
71 /* Subroutine */ int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *
74 /* System generated locals */
82 /* Parameters/constants */
83 /* Local variables that need not be saved */
86 /* Parameter adjustments */
92 for (j = *len + 1 - *nsamp; j <= i__1; ++j) {
93 t = (inbuf[j] + inbuf[j - 30]) * -.0097201988f;
94 t += (inbuf[j - 1] + inbuf[j - 29]) * -.0105179986f;
95 t += (inbuf[j - 2] + inbuf[j - 28]) * -.0083479648f;
96 t += (inbuf[j - 3] + inbuf[j - 27]) * 5.860774e-4f;
97 t += (inbuf[j - 4] + inbuf[j - 26]) * .0130892089f;
98 t += (inbuf[j - 5] + inbuf[j - 25]) * .0217052232f;
99 t += (inbuf[j - 6] + inbuf[j - 24]) * .0184161253f;
100 t += (inbuf[j - 7] + inbuf[j - 23]) * 3.39723e-4f;
101 t += (inbuf[j - 8] + inbuf[j - 22]) * -.0260797087f;
102 t += (inbuf[j - 9] + inbuf[j - 21]) * -.0455563702f;
103 t += (inbuf[j - 10] + inbuf[j - 20]) * -.040306855f;
104 t += (inbuf[j - 11] + inbuf[j - 19]) * 5.029835e-4f;
105 t += (inbuf[j - 12] + inbuf[j - 18]) * .0729262903f;
106 t += (inbuf[j - 13] + inbuf[j - 17]) * .1572008878f;
107 t += (inbuf[j - 14] + inbuf[j - 16]) * .2247288674f;
108 t += inbuf[j - 15] * .250535965f;