Signal Processing Library
Program name: wcepstra
Language: C
In file: parameter_lib.c
Objective: Calculate the Weighted Cepstral Coefficients from the Cepstral vectors
Usage: void weighted_cepstral(double ccep[], double ccepp[], int order, int type);
Parameters:
- ccep - The Cepstral Coefficients vector for the window of input data
- ccepp - The output array to put the calculated data
- order - The order
- type - The type of weighting system
- 1 - no change
- 2 - multiply by n
- 3 - multiply by (1.0+((L/2.0)*sin(PI*(double)(n+1)/L)))
Return value:
Mathematical Description:
Comments:
User Comments
Code:
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 */
|