我使用以下代码来计算数组平方值的平均值。但它返回错误“143表达式必须有指向对象类型的指针”。
Int16 mono_input;
Int16 delayed_input;
double sum_sq;
double power;
int j;
int n;
delayed_input = delay_1(mono_input); //delay_1 returns sample of sound (eg 1024 samples)
for ( n = 0 ; n < 1024 ; n++)
{
sum_sq += delayed_input [n] * delayed_inputA [n] ; // to get the squared values of n th sample and add that to the previous value. but here it returns error 143.
}
power = sum_sq/ 1024; // to get the average of squared values
答案 0 :(得分:1)
你输错了第二个delayed_input:
sum_sq += delayed_input [n] * delayed_inputA [n] ;
应该(我假设)
sum_sq += delayed_input [n] * delayed_input [n] ;