Thursday, July 08, 2010

weighted_cepstral

Digital Signal Processing Library

Voice Lab

weighted_cepstral


void weighted_cepstral(double ccep[], double ccepp[], int order, int type)
{
int n;
double aux, L;

for(n = 0; n <= order; n++) {
ccepp[n]=0.0;
}

L = (double) order;

switch (type) {
case 1:
for(n = 0; n <= order; n++) {
ccepp[n] = ccep[n];
}
break;
case 2:
for(n = 0; n <= order; n++) {
ccepp[n] = ccep[n] * n;
}
break;
case 3:
for(n = 0; n <= order; n++) {
aux = PI*(double)(n+1)/L;
ccepp[n] = ccep[n] * (1.0+((L/2.0)*sin(aux)));
}
break;
default:
fprintf(stderr, "Weighted Cepstral type not within range(1-3)\n");
exit(1);
break;
}
} /* End of the weighted cepstral function */


No comments:

Post a Comment