Thursday, July 15, 2010

vector_add

Digital Signal Processing Library

Voice Lab

vector_add


void vector_add(double *vector1, double *vector2, int vector_width, double **vector3)
{
int i;

if(vector_width > MAX_VECTOR_WIDTH) {
fprintf(stderr, "vector_width greater than MAX_VECTOR_WIDTH\n");
fprintf(stderr, "Please increase MAX_VECTOR_WIDTH in vector_lib.h and recompile.\n");
exit(-1);
}

for(i = 0; i < vector_width; i++){
(*vector3)[i] = vector1[i] + vector2[i];
number_adds++;
}
return;
}


No comments:

Post a Comment