Signal Processing Library
Program name: dcepstra
Language: C
In file: parameter_lib.c
Objective: Calculate the Delta Cepstral Coefficients from the Cepstral vectors
Usage: void delta_cepstral(double **matrix, double vector[], int order, int num_vectors, int k, double G);
Parameters:
- matrix - The cepstral vectors for the window of input data
- vector - The output array to put the calculated data
- order - The order
- num_vectors - The number of vectors in matrix
- k -
- G - The gain to use
Return value:
Mathematical Description:
Comments:
User Comments
Code:
void delta_cepstral(double **matrix, double vector[], int order, int num_vectors, int k, double G) { int i, j, index, contj;
/* start with a zero vector */ for(i = 0; i <= order; i++) { vector[i] = 0.0; }
if(k == 0) k = 2; if(G == 0) G = 0.375;
for(contj = k; contj < (num_vectors - k); contj++) { for(i = 0; i <= order; i++) { for(j = 0; j < ((2 * k) + 1); j++) { index = contj - (j - k); if(index < 0) { fprintf(stderr, "contj: %d, j = %d, k = %d\n", contj, j, k); fprintf(stderr, "Index out of range(dcepstra1): %d\n", index); exit(1); } else if(index >= num_vectors) { fprintf(stderr, "contj: %d, j = %d, k = %d\n", contj, j, k); fprintf(stderr, "Index out of range(dcepstra2): %d\n", index); exit(1); } else { vector[i] += (j-k)*matrix[index][i]*G; } } } } } /* End of the delta cepstral function */
|