vhdl problem for iir filter

Joined
Jan 5, 2008
Messages
1
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top