**Introduction to Filter Design in LabVIEW**

The Digital Filter Design Utility is software that allows you to interactively specify and design floating point digital filters. This utility was created with LabVIEW and the Digital Filter Design Toolkit and compiled into a stand: alone application for your use. The full Digital Filter Design Toolkit contains a complete set of filter design tools for designing a wide range of floating point and fixed point digital filters within an open environment, using an easy: to: learn interactive graphical programming language.

Download LabVIEW Source

**Requirements**

The Digital Filter Design Utility, like LabVIEW, runs on current versions of Windows, Macintosh, and Linux operating systems. The utility can be run within this web page, or downloaded for offline use. You will need to download the LabVIEW Runtime Engine for your operating system and need to enable the browser plug: in for local execution. Visit ni.com for more information on enabling the LabVIEW browser plug-in.

Install LabVIEW Run-time Engine and configure the Browser Plug-in

**How to Use the Digital Filter Design Utility**

The Digital Filter Design Utility provides two filter design tools for either classical design or design by pole: zero placement.

Classical design mode allows you to specify a FIR or IIR filter design by setting design parameters such as filter type, sampling frequency, passband/stopband edge frequencies, passband and stopband ripple levels, and stopband attenuation. You can select from design methods that include Butterworth, Chebyshev, Inverse Chebyshev, Elliptic, Kaiser Window, Dolph: Chebyshev, and Equi: Ripple. LabVIEW will then use the design parameters to suggest a filter meeting as many of those specifications as possible. You are then free to optimize the design to meet your needs.

The pole – zero placement interface allows you specify the location of multiple poles and zero either by entering the coordinate locations directly or graphically by clicking on the z: plane. The resulting filter is then displayed using the Bode Plot.

The resulting filter coefficients can then be saved to a text file to facilitate deploying your design on real hardware or for further analysis.

**Getting Started**

To start a design, you first choose from one of the two available interactive design tools by making a selection from the tree control on the left side of the interface. Select Classical Design to design a filter based on specifications such as passband / stopband edge frequencies, passband ripple, and stopband attenuation. Select Pole: Zero Placement to design a filter by specifying the locations of poles and zeros on the complex plane.

The following sections detail how to work with each alternative.

**Classical Filter Design**

This tool allows you to design multiple filter types by adjusting the filter specifications by entering numbers or by changing the passband and stopband cursors in the magnitude vs. frequency graph in the same panel. As the cursors move, the poles and zeros plot and the text: based interface change dynamically to set the values for the desired filter.

Illustration 1, The Classical Filter Design Interface

**Classical Filter Parameter Descriptions**

- Filter Type: Specifies the type of filter you want. The default is a lowpass filter type. You also can select a highpass, bandpass, or bandstop filter type.

**Filter Specification**

- Sampling Frequency [Hz]: Specifies the sampling frequency of the filter in hertz
- Passband Edge Frequency [Hz]: Specifies the first passband edge frequency of the filter in hertz.
- Passband Edge Frequency [Hz]: Specifies the second passband edge frequency of the filter in hertz. This option does not appear for lowpass or highpass filters.
- Passband Ripple: Specifies the passband ripple of the filter in units determined by the Magnitude in dB option.
- Stopband Edge Frequency [Hz]: Specifies the first stopband edge frequency of the filter in hertz.
- Stopband Edge Frequency [Hz]: Specifies the second stopband edge frequency of the filter in hertz. This option does not appear for lowpass or highpass filters.
- Stopband Attenuation: Specifies the stopband attenuation of the filter in units determined by the Magnitude in dB option.
- Design Method: Specifies the method of filter design. The default is Elliptic. You also can select Butterworth, Chebyshev, Inverse Chebyshev, Kaiser Window, Dolph Chebyshev Window, and Equi Ripple FIR filter designs. Elliptic, Butterworth, Chebyshev, and Inverse Chebyshev designs are IIR filter designs. Kaiser Window, Dolph Chebyshev Window, and Equi Ripple FIR designs are FIR filter designs.

**Design Feedback**

- Filter Order: Returns the order of the designed filter. For FIR filters, order +1 equals the number of coefficients or filter taps.
- Error Message: Contains details about errors that occur during filter creation.
- Magnitude in dB: Specifies whether the VI uses decibels or a linear scale to express the magnitude response. If a checkmark is in the checkbox, the VI converts linear magnitude response to decibels.
- Passband: Specifies the color of the lines in the magnitude plot that represent the passband response and the passband frequencies. The default is blue. Click the color box next to the parameter name to select a different color.
- Stopband: Specifies the color of the lines in the magnitude plot that represent the stopband attenuation and the stopband frequencies. The default is red. Click the color box next to the parameter name to select a different color.
- Magnitude: Contains the plot of the magnitude response. You can drag the cursors in the plot to change the specifications. The color you specify in passband represents the passband response and the passband frequencies. The color you specify in stopband represents the stopband attenuation and the stopband frequencies. The green vertical line in the graph represents the half sampling frequency, also known as the Nyquist frequency.
- Z Plane: Contains the plot of the zeroes and poles of the filter in the Z plane.

**Pole/Zero Placement Design**

The Pole: Zero Placement Design Tool allows you to interactively place and move poles and zeros on the z: plane. To do so, you can enter complex value coordinates to specify exact values or click on a graph of the complex half plane to move or place them with the mouse. The magnitude response of the resulting filter updates immediately as you place or move poles / zeros.

Illustration 2, The Pole/Zero Placement Design Interface

**Zeroes**

- Real: Specifies the real part value if coordinates are rectangular, or the radius value if coordinates are polar.
- Imag: Specifies the imaginary part value if coordinates are rectangular, or the angle value if coordinates are polar.
- Is Real?: Makes the specified pole or zero point real if you place a checkmark in the checkbox.
- Is Linear Phase Pair?: Makes the specified pole or zero a linear phase pair if you place a checkmark in the checkbox.
- On Unit Circle?: Places the pole or zero point on the unit circle if you place a checkmark in the checkbox.
- Order: Specifies the order of the pole or zero.

**Poles**

- Specifies the properties for each pole in the filter. Contains the following options:
- Real: Specifies the real part value if coordinates are rectangular, or the radius value if coordinates are polar.
- Imag: Specifies the imaginary part value if coordinates are rectangular, or the angle value if coordinates are polar.
- Is Real?: Makes the specified pole or zero point real if you place a checkmark in the checkbox.
- Is Linear Phase Pair?: Makes the specified pole or zero a linear phase pair if you place a checkmark in the checkbox.
- On Unit Circle?: Places the pole or zero point on the unit circle if you place a checkmark in the checkbox.
- Order: Specifies the order of the pole or zero.

**Filter Settings**

- Gain: Sets the gain of the filter manually. You can use this control only if you remove the checkmark from the Normalized Gain checkbox.
- Normalized Gain: Specifies whether the VI automatically adjusts the gain of the filter. The default contains a checkmark in the checkbox, in which the VI adjusts the gain so the maximum response is 1.0 (0 dB). Remove the checkmark from the checkbox to adjust the gain manually with the Gain control.
- fs [Hz]: Specifies the sampling frequency in hertz. The input must contain a value greater than zero.
- Coordinates: Specifies whether the VI displays poles and zeroes in rectangular or polar coordinates. The default is rectangular coordinates.
- Load Filter from File: Opens a file dialog you can use to select a file of a filter that loads into the Express VI.
- Zero: Specifies the color of the zeroes in the Z Plane plot. The default is blue. Click the color box next to the parameter name to select a different color.
- Pole: Specifies the color of the poles in the Z Plane plot. The default is red. Click the color box next to the parameter name to select a different color.
- Delete selected: Deletes the selected pole or zero from the filter.
- Add Zero: Adds a zero to the filter.
- Add Pole: Adds a pole to the filter.
- Z Plane: Plots the number and location of poles and zeroes.
- Magnitude: Plots the filter magnitude response.
- Magnitude in dB: Specifies whether the VI uses decibels or a linear scale in the magnitude plot. If a checkmark is in the checkbox, the VI converts linear magnitude response to decibels.

**What is LabVIEW?**

LabVIEW is a graphical programming & math environment for designing, prototyping, and deploying systems. The Digital Filter Design Utility software included on this CD was built using LabVIEW 8 and the LabVIEW Digital Filter Design Toolkit.

The Digital Filter Design Toolkit is a software add: on for LabVIEW that facilitates specification, design, analysis, and implementation of digital filters. Without prior knowledge about programming in LabVIEW, you can use the Digital Filter Design Toolkit Express VIs to interact graphically with filter specifications to design digital filters.

The Digital Filter Design Toolkit provides VIs that you can use to design a digital IIR/FIR filter, analyze the characteristics of the digital filter, change the implementation structure of the digital filter, and process data with the digital filter. Besides the floating: point support, the Digital Filter Design Toolkit provides a set of VIs that you can use to generate a fixed: point digital filter model, analyze the characteristics of the fixed: point digital filter, simulate the performance of the fixed: point digital filter, and generate integer C/LabVIEW code for a specific fixed: point target.

In addition to tools that help you create conventional digital filters, the Digital Filter Design Toolkit includes tools for multirate digital filter design.

For more information about the LabVIEW Digital Filter Design Toolkit, please visit ni.com/toolkits.

Comments:"The Digital Filter Design Utility is software that allows you to interactively specify and design floating point digital filters. This utility was created with LabVIEW and the LabVIEW Digital […]"