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.
工具/软件:Code Composer Studio
我正在为"多频带压缩机"开发音频效果算法。
问题是 禁止使用浮点数据、因为处理器不实现此数据类型。
这就是我需要将其转换为 Q15格式的原因。 但我不知道怎么做。 请帮助。
#这是程序的主体
float min (float num1、float num2、float num3){
if (num1 < num2 && num1 < num3) return num1;
否则、如果(num2 < num3)返回 num2;
否则返回编号3;
}
void compexp (float CT、float CS、float ET、float ES){ #here I should use Q15 format
float tav = 0.01;
浮点= 0.03;
浮点 RT = 0.003;
INT 延迟= 150;
INT xrms = 0;
int g = 1;
数据缓冲区[150]={0};
对于(I = 0;I < W_LEN;+I){
Rin[i]= buf_in_right_1[i];
LIN[i]= buf_in_left_1_[i];
}
int i;
对于(I = 0;I < W_LEN;+I){
xrm =(1 -tav)* xrm + tav * pow (rin [i]、2);
float X = 10 * log (xrms);
浮点 G =最小值(0、CS *(CT - X)、ES *(ET - X));
int f = pow (10、G / 20);
浮点系数;
如果(f < g){
COEff = AT;
}否则{
COEff = RT;
}
G =(1 -系数)* g +系数* f;
buf_out_right_1[i]= g * buffer[149];
缓冲器[0]= x[i];
}
}
您好!
抱歉、这是与算法相关的问题、与 SDK 无关或与 SoC 相关的问题。
此论坛仅讨论有关支持的 SoC (DSP)和处理器 SDK 的硬件和软件相关问题。
此致、
Yordan