0

The filter I need to implement is H(z)=(0.875+0.322z^-1 + 0.283z^-2)/(1+0.334z^-1+0.654z^-2). For H(z)=0.333/(1+0.333z^-1) 32bit Q24 I used this code:

Int32 filter(int32 x) {
Q=24;
xn = floor(x*2^(Q-31));
int32;
int32 y1;
g = floor(0.333*2^(Q-31));
y=g*xn – xn - g*y1;
y1=y;

return(y);
}

but, I'm not sure how to do this in single precision floating point.

  • Please read up on operator syntax in C. The `^` operator does _not_ perform exponentiation. – paddy Oct 10 '19 at 00:30
  • Possible duplicate of [Why is my power operator (^) not working?](https://stackoverflow.com/questions/4843304/why-is-my-power-operator-not-working) – paddy Oct 10 '19 at 00:31
  • Please provide a [example] that we can use. The currently shown code has far too many syntax errors. – the busybee Oct 10 '19 at 06:06

0 Answers0