{
int p=4;
double floor_sqrt;
- floor_sqrt = floor( sqrt((double)n) );
+ floor_sqrt = floorf( sqrtf((double)n) );
/*factor out powers of 4, powers of 2, then any remaining primes */
do {
/* convert from x domain to radians */
for(i=0; i<order; i++) {
- freq[i] = acos(freq[i]);
+ freq[i] = acosf(freq[i]);
}
return(roots);
/* convert from radians to the x=cos(w) domain */
for(i=0; i<order; i++)
- freq[i] = cos(lsp[i]);
+ freq[i] = cosf(lsp[i]);
pw = Wp;
for(f0=f0_start; f0<=f0_end; f0+= 2.5) {
e = test_candidate_mbe(Sw, W, f0);
#if !defined(NDEBUG) || defined(DUMP)
- bin = floor(f0); assert((bin > 0) && (bin < F0_MAX));
+ bin = floorf(f0); assert((bin > 0) && (bin < F0_MAX));
#endif
#ifdef DUMP
e_hz[bin] = e;
for(f0=f0_start; f0<=f0_end; f0+= 2.5) {
e = test_candidate_mbe(Sw, W, f0);
#if !defined(NDEBUG) || defined(DUMP)
- bin = floor(f0); assert((bin > 0) && (bin < F0_MAX));
+ bin = floorf(f0); assert((bin > 0) && (bin < F0_MAX));
#endif
#ifdef DUMP
e_hz[bin] = e;
float Wo; /* current "test" fundamental freq. */
int L;
- L = floor((SAMPLE_RATE/2.0)/f0);
+ L = floorf((SAMPLE_RATE/2.0)/f0);
Wo = f0*(2*PI/SAMPLE_RATE);
error = 0.0;
Am.real = 0.0;
Am.imag = 0.0;
den = 0.0;
- al = ceil((l - 0.5)*Wo*FFT_ENC/TWO_PI);
- bl = ceil((l + 0.5)*Wo*FFT_ENC/TWO_PI);
+ al = ceilf((l - 0.5)*Wo*FFT_ENC/TWO_PI);
+ bl = ceilf((l + 0.5)*Wo*FFT_ENC/TWO_PI);
/* Estimate amplitude of harmonic assuming harmonic is totally voiced */
else
w[i]=1.0/(0.01+d[i]);
- w[i]=pow(w[i]+0.3, 0.66);
+ w[i]=powf(w[i]+0.3, 0.66);
}
}
#endif
e = 0.0;
for(i=0; i<k; i++) {
diff = cb[j*k+i]-vec[i];
- e += pow(diff*w[i],2.0);
+ e += powf(diff*w[i],2.0);
}
index[0] = j;
mbest_insert(mbest, index, e);
float norm;
norm = (Wo - prev_Wo)/(Wo_max - Wo_min);
- index = floor(WO_LEVELS * norm + 0.5);
+ index = floorf(WO_LEVELS * norm + 0.5);
//printf("ENC index: %d ", index);
/* hard limit */
if (model->Wo > TWO_PI/P_MIN)
model->Wo = TWO_PI/P_MIN;
- model->L = floor(PI/model->Wo);
+ model->L = floorf(PI/model->Wo);
}
/*---------------------------------------------------------------------------*\
/* Estimate phase of harmonic, this is expensive in CPU for
embedded devicesso we make it an option */
- model->phi[m] = atan2(Sw[b].imag,Sw[b].real);
+ model->phi[m] = atan2f(Sw[b].imag,Sw[b].real);
}
}
}
Am.real = 0.0;
Am.imag = 0.0;
den = 0.0;
- al = ceil((l - 0.5)*Wo*FFT_ENC/TWO_PI);
- bl = ceil((l + 0.5)*Wo*FFT_ENC/TWO_PI);
+ al = ceilf((l - 0.5)*Wo*FFT_ENC/TWO_PI);
+ bl = ceilf((l + 0.5)*Wo*FFT_ENC/TWO_PI);
/* Estimate amplitude of harmonic assuming harmonic is totally voiced */
*/
for(l=1; l<=model->L; l++) {
for(i=0,j=-N+1; i<N-1; i++,j++) {
- Sw_[FFT_DEC-N+1+i].real += 2.0*model->A[l]*cos(j*model->Wo*l + model->phi[l]);
+ Sw_[FFT_DEC-N+1+i].real += 2.0*model->A[l]*cosf(j*model->Wo*l + model->phi[l]);
}
for(i=N-1,j=0; i<2*N; i++,j++)
- Sw_[j].real += 2.0*model->A[l]*cos(j*model->Wo*l + model->phi[l]);
+ Sw_[j].real += 2.0*model->A[l]*cosf(j*model->Wo*l + model->phi[l]);
}
#endif