My thesis is about voice segeration. I am reading a code which has been used in this field. It most probably not needed but here is the fullCode
I can't understand something which owner code did ,
if ((fp = fopen(filename, "r")) == NULL){
printf("Cannot open input file!\n");
exit(0);
}
while (!feof(fp))
{
float f;
fscanf(fp, "%f\n", &f);
Input[SigLength]=f;
SigLength++;
}
fclose(fp);
float sumE=0;
for(int n=0; n<SigLength; n++)
sumE += Input[n]*Input[n];
sumE /= float(SigLength);
for(int n=0; n<SigLength; n++)
Input[n] *= 1000/sqrt(sumE);
return(1000/sqrt(sumE));
He opens a file which has DB of sound like 48, 200 etc..
My question why he is doing the process below ? To apply just logic is common in sound analysis ?
for(int n=0; n<SigLength; n++)
Input[n] *= 1000/sqrt(sumE);