Example Code

Plotting Transfer Function, Filter Coefficients, and Poles/Zeros of a Digital Filter in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW
  • LabVIEW Digital Filter Design Toolkit

Code and Documents

Attachment

Description

1. Overview

This VI creates a digital Elliptic infinite impulse response (IIR) filter and plots the magnitude and frequency response of the filter. It also plots the poles and zeroes of the filter on a Z-plane plot. Finally, it provides the coefficients of the filter so that the user can rebuild it on a DSP chip.

 

2. Description

Create your digital filter by choosing the sample rate, cutoff frequencies, filter type, and filter order. A different filter can be implemented by replacing the DFD Elliptic Design VI with another filter design from the Advanced IIR Filter Design Pallete.
Elliptic filters have the following characteristics:

  • Minimum peak error in the passband and stopband.
  • Equi-ripple magnitude response in the passband and stopband.
  • Compared with same-order Butterworth or Chebyshev filters, Elliptic filters have the sharpest transition band, which accounts for their widespread use.

 

3. Requirements

  • NI LabVIEW Professional Development System 2012 or compatible.
  • NI Digital Filter Design Toolkit 2012 or compatible.

 

4. Steps to Implement or Execute Code

  1. Download and open the example VI.
  2. Write the Filter Order, Filter Type, Sample Rate, Low Cutoff Freq, and High Cutoff Freq.
  3. Run the VI.

 

5. Additional Information or References

Transfer Function and Pole-Zero FP.PNG

 

Transfer Function and Pole-Zero Screenshot.PNG

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.