32 {(float)0.00635, (
float)0.003175, (float)0.0015875,
41 float old_p, old_q, *old;
43 float omega, old_omega;
45 float hlp, hlp1, hlp2, hlp3, hlp4, hlp5;
52 p_pre[0] = (float)-1.0 - p[0];
53 p_pre[1] = - p_pre[0] - p[1];
54 p_pre[2] = - p_pre[1] - p[2];
55 p_pre[3] = - p_pre[2] - p[3];
56 p_pre[4] = - p_pre[3] - p[4];
57 p_pre[4] = p_pre[4] / 2;
59 q_pre[0] = (float)1.0 - q[0];
60 q_pre[1] = q_pre[0] - q[1];
61 q_pre[2] = q_pre[1] - q[2];
62 q_pre[3] = q_pre[2] - q[3];
63 q_pre[4] = q_pre[3] - q[4];
64 q_pre[4] = q_pre[4] / 2;
86 if ((lsp_index & 0x1) == 0) {
96 for (step_idx = 0, step = steps[step_idx];
103 hlp1 = (float)2.0 * hlp + pq_coef[0];
104 hlp2 = (float)2.0 * hlp * hlp1 - (
float)1.0 +
106 hlp3 = (float)2.0 * hlp * hlp2 - hlp1 + pq_coef[2];
107 hlp4 = (float)2.0 * hlp * hlp3 - hlp2 + pq_coef[3];
108 hlp5 = hlp * hlp4 - hlp3 + pq_coef[4];
111 if (((hlp5 * (*old)) <= 0.0) || (omega >= 0.5)){
113 if (step_idx == (LSF_NUMBER_OF_STEPS - 1)){
115 if (fabs(hlp5) >= fabs(*old)) {
116 freq[lsp_index] = omega - step;
118 freq[lsp_index] = omega;
144 omega -= steps[step_idx];
148 step = steps[step_idx];
162 freq[i] = freq[i] *
TWO_PI;
188 freq[i] = freq[i] *
PI2;
199 if ((freq[0] <= 0.0) || (freq[LPC_FILTERORDER - 1] >= 0.5)){
202 if (freq[0] <= 0.0) {
203 freq[0] = (float)0.022;
207 if (freq[LPC_FILTERORDER - 1] >= 0.5) {
208 freq[LPC_FILTERORDER - 1] = (float)0.499;
211 hlp = (freq[LPC_FILTERORDER - 1] - freq[0]) /
212 (
float) (LPC_FILTERORDER - 1);
215 freq[i] = freq[i - 1] + hlp;
239 q[i] = (float)
cos(
TWO_PI * freq[2 * i + 1]);
246 a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i];
247 b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i];
264 a[i + 1] = a[i] - 2 * p[i] * a1[i] + a2[i];
265 b[i + 1] = b[i] - 2 * q[i] * b1[i] + b2[i];
void lsf2a(float *a_coef, float *freq)
#define LSF_NUMBER_OF_STEPS
void a2lsf(float *freq, float *a)