hi: guys
i have a problem makes me crazy.
how to use vhdl codes to implement iir filter
y(n)= 2cos(w)*y(n-1) - y(n-2)
and the initial conditions is y(-1)=sin(w),y(-2)=sin(2w).
which means i need output this filter every cycle calculation like following y(0),y(1)....
y(0)=2cos(w)*y(-1)-y(-2);
y(1)=2cos(w)*y(0)-y(-1);
...
i use a mac and a rounding operation to do it.
but its not work like i describe above.
how should i do. Am i need plus some selfcycle computation on testbench or on original filter codes. And how to plus it into this codes.
Thanks
i have a problem makes me crazy.
how to use vhdl codes to implement iir filter
y(n)= 2cos(w)*y(n-1) - y(n-2)
and the initial conditions is y(-1)=sin(w),y(-2)=sin(2w).
which means i need output this filter every cycle calculation like following y(0),y(1)....
y(0)=2cos(w)*y(-1)-y(-2);
y(1)=2cos(w)*y(0)-y(-1);
...
i use a mac and a rounding operation to do it.
but its not work like i describe above.
how should i do. Am i need plus some selfcycle computation on testbench or on original filter codes. And how to plus it into this codes.
Thanks