Low Pass Filters in FPGA's

一曲冷凌霜 提交于 2020-02-07 05:39:12

问题


I am trying to implement a Low Pass Filter in an FPGA using VHDL. Now, I worked out all the filter coefficients, but I am having trouble trying to understand how to work with the coefficients, given the fact that they are non-whole numbers. I would appreciate any help with an example of a simple filter implementation in VHDL.

Thanks a lot, Chris


回答1:


You should convert the coefficients to fix-point numbers.

Very short:

  • Chose a precision and multiply all coefficients by the nearest higher reciprocal power of two.
  • Do the normal multiply-add operation in the FPGA.
  • The end result should be divided by that same power of two.

Example:

  • Coefficients are C0 = 0.707, C1= 0.123
  • Lets take a precision of 0.5% which is 1/200
  • Nearest power of 2 above 200 is 256
  • C0 becomes 0.707*256 = 181, C1 becomes 0.123*256 = 31.
  • Use those in your filter.
  • At the end throw away the bottom 8 bits (As extra you can round using bit 7)


来源:https://stackoverflow.com/questions/58804713/low-pass-filters-in-fpgas

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!