Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 功能
      算法
      存储器
      总线及I/O
      逻辑
      接口与外设
      DSP
      通信
      PLL & Clocking
  
 设计输入方法
      Quartus II软件工程
      Tcl
      VHDL
      Verilog HDL
      C Code 范例
      DSP Builder
      TimeQuest
   片内调试
  
 仿真工具
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 旧范例
      图形编辑器
      AHDL
  

Verilog HDL: Butterworth IIR Filter

Butterworth filters are also known as "maximally flat" filters because they have no passband ripple. They also have a monotonic response in both the stopband and passband. Butterworth filters tradeoff roll off steepness for their no-ripple characteristic.

The complexity of calculating the result of the Butterworth filter can be greatly reduced if the filter is broken down into several second order systems known as biquads. The higher the filter order, the better its characteristics, but the more complex it is to implement. By breaking a complex filter into biquads, this complexity is greatly reduced.

The transfer function of a Butterworth filter is shown below:

Since the coefficient for the z-1 term is twice that of the other terms in the numerator, it can be implemented using a series of shift and add operations. This optimization reduces the number of multipliers in each biquad to just two. A gain factor is introduced, but this can be corrected at the end of the cascade chain through a single multiplier.

This Butterworth infinite impulse response (IIR) filter design uses two biquads to implement a 4th order filter in Stratix. The input is a 12-bit signed integer, the filter coefficients are scaled to 10 bits, and the output is 21 bits wide. For more details, see the Implementing High-Performance DSP Functions in Stratix & Stratix GX Devices chapter of the Stratix Device Handbook.

Download the files used in this example:

The use of this design is governed by, and subject to, the terms and conditions of the Altera Hardware Reference Design License Agreement.

Files in the download include:

  • butterworth_iir.v - Top-level design file
  • butterworth_iir_biquad.v - Second-order biquad structure
  • two_mult_add.v - Multiply-add function implemented using altmult_add Megafunction
  • fb_adder.v - Adder in the feedback path implemented using the lpm_add_sub Megafunction
  • ff_adder1.v, ff_adder2.v - Adders in the feedforward path implemented using the lpm_add_sub Megafunction
  • gain_blk.v - Gain block compensates for the gain factor at the end of the filtering stage
  • butter_iir.m - MATLAB script to verify functionality of design

Figure 1 contains the butterworth_iir top-level block diagram.

Figure 1. butterworth_iir Top-Level Block Diagram

Figure 1. butterworth_iir Top-Level Block Diagram

Table 1 shows the Butterworth IIR design example port listing.

Table 1. Butterworth IIR Design Example Port Listing
Port Name Type Description
x[11..0] Input The input is a 12-bit signed integer. This is the x[n] time sample represented as an 18-bit signed input.
clk Input Clock
clken Input Clock enable
reset Input Reset
result[20..0] Output Output of the IIR filter. This is 21 bits wide in the 17.4 signed binary fractional (SBF) format.

For more information on using this example, go to:

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.

  请填写反馈意见