• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
清风醉明月 slp_art
博客园    首页    新随笔    联系   管理    订阅  订阅

FIR滤波器设计流程 fpga (定点) 流程

FIR滤波器设计流程 fpga (定点)

流程:

1.计算出FIR脉冲响应

2.量化

定点总位数:G+输入位宽  wps_clip_image-4539

f[k]脉冲响应

防止动态范围溢出  加减乘除···

3.仿真,代数分析,看量化后的设计是否符合要求

module fir_srg          //----> Interface

(

input  clk,

input  [7:0] x,

output reg [7:0] y

);

// Tapped delay line array of bytes

  reg  [7:0] tap [0:3]; 

// For bit access use single vectors in Verilog   integer I;

  always @(posedge clk)  //----> Behavioral style

  begin : p1

   // Compute output y with the filter coefficients weight.

   // The coefficients are [-1  3.75  3.75  -1]. 

   // Multiplication and division for Altera MaxPlusII can 

   // be done in Verilog 2001 with signed shifts !  时域相乘 累加 响应

    y <= (tap[1] <<< 1) + tap[1] + (tap[1] >>> 1) - tap[0]

         + ( tap[1] >>> 2) + (tap[2] <<< 1) + tap[2]

         + (tap[2] >>> 1) + (tap[2] >>> 2) - tap[3];

    for (I=3; I>0; I=I-1) begin  

      tap[I] <= tap[I-1];  // Tapped delay line: shift one 

    end

    tap[0] <= x;   // Input in register 0

  end

endmodule

posted @ 2011-08-18 20:16  清风醉明月 slp_art  阅读(1362)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3