- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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링크가 복사됨
4 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hello,
I can't indentify a filter, cause there is no signal input. If you are actually trying to design an oscillator, then you should probably choose a structure less sensitive to rounding errors or use an NCO instead. But apart from this consideration, the shown IIR structure can surely be synthesized in VHDL. I understand, that cos(w) is a constant that either can be calculated at compile time or loaded as a parameter (which is big difference for FPGA implementation), the same with the said initial values. Next you have to define a numeric format (probably signed) and a resolution. Then the algorithm can be build from a multiplier and a substractor megafunction or infered from HDL. Two registers are needed to store previous y(n). Basic operation can be evaluated also in a spreadsheet tool, e. g. Excel to study rounding error effects with different numerial resolution. Regards, Frank- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
to Frank:
thank you pay attentation to my problem. yes, as you said i am doing a digital oscillator utilized a iir structure. you said i need two registers to store previous y(n). i show u my codes as attached, may be when u see my codes you can understand my problem totally. Please check out my codes, and give me some advise agian. Thank you- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
sorry to Frank
the forum can not attached the .rar files, so please show me your email address, i send it to you directly.