Altera Home Page
Literature Licensing
Buy On-Line Download

  Home   |   Products   |   Support   |   End Markets   |   Technology Center   |   Education & Events   |   Corporate   |   Buy On-Line  
  Knowledge Database   |   Devices   |   Design Software   |   Intellectual Property   |   Design Examples   |   mySupport   |   Reference Designs  

 Products
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 Functionality
      Arithmetic
      Memory
      Bus & I/O
      Logic
      Interfaces & Peripherals
      DSP
      Communications
      PLL & Clocking
  
 Design Entry
      Quartus II Project
      Tcl
      VHDL
      Verilog HDL
      C Code Examples
      DSP Builder
      TimeQuest
   On-Chip Debugging
  
 Simulation Tools
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 Legacy Examples
      Graphic Editor
      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:

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:


Feedback

Did this information help you?

If not, please log onto mySupport> to file a technical request or enhancement.


Altera does not warrant that this solution will work for the customer's intended purpose and disclaims all liability for use of or reliance on the solution.

  Please Give Us Feedback