This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320C5515: CCS/TMS320C5515: Audio effect

Part Number: TMS320C5515

Tool/software: Code Composer Studio

I am developing a audio effect algorithm for "Multiband compressor".

The problem is that the use of float data is prohibited, since the processor does not implement this data type.

Thats why I need to convert it to Q15 format. But I dont know how can I do it. Please help.

#Here is the body od the program 

float min(float num1, float num2, float num3) {
if(num1 < num2 && num1 < num3) return num1;
else if(num2 < num3) return num2;
else return num3;
}
void compexp(float CT, float CS, float ET, float ES) {    #here i should use Q15 format 

float tav = 0.01;

float at = 0.03;
float rt = 0.003;
int delay = 150;
int xrms = 0;
int g = 1;
DATA buffer[150] = {0};
for (i = 0; i < W_LEN; ++i) {
rin[i] = buf_in_right_1[i];
lin[i] = buf_in_left_1[i];
}
int i;
for(i = 0; i < W_LEN; ++i) {
xrms = (1 -tav) * xrms + tav * pow(rin[i], 2);
float X = 10 * log(xrms);
float G = min(0, CS * (CT - X), ES * (ET - X));
int f = pow (10, G / 20);
float coeff;
if (f < g) {
coeff = at;
} else {
coeff = rt;
}

g = (1 - coeff) * g + coeff * f;
buf_out_right_1[i] = g * buffer[149];
buffer[0] = x[i];
}
}