Entering Floating-Point Filter Specifications (Digital Filter Design Toolkit)

LabVIEW Digital Filter Design Toolkit

Entering Floating-Point Filter Specifications (Digital Filter Design Toolkit)

You can use the Classical Filter Design Express VI to configure a classical digital filter interactively. After you place the Express VI on the block diagram, the Configure Classical Filter Design dialog box appears, as shown in the following figure:

From the configuration dialog box, you can select the filter type and design method from the pull-down menus and then enter the filter specifications through either the numeric controls on the left side of the configuration dialog box or the graphical interface on the right side of the configuration dialog box. The results are equivalent.

Using the Numerical Controls

Classical digital filter specifications include frequency ranges and ripple constraints. You can specify the maximum allowable deviation δp from unity gain in the passband in the Passband ripple numeric control. You can specify the maximum allowable deviation δs from the zero gain in the stopband in the Stopband attenuation numeric control.

You can specify deviations in either a logarithmic or a linear scale. The Classical Filter Design Express VI uses a logarithmic scale by default. To use a linear scale, remove the checkmark from the Magnitude in dB checkbox in the configuration dialog box.

The following equations show the relationship between the logarithmic and linear scales.

passband ripple = −20log10(1−δp)

stopband ripple = −20log10(δs)

Based on the two equations above, you can convert the passband ripple to or from the decibel representation. For example, if passband ripple equals 0.01 dB, that is, 0.01 = −20log10(1−δp), then δp = 0.00115. Similarly, if stopband ripple equals 60 dB, that is 60 = −20log10(δs), then δs = 0.001.

Using the Graphical Interface

The right side of the Configure Classical Filter Design dialog box displays the magnitude response of the designed digital filter. The magnitude axis can be either a linear or a logarithmic scale. Remove the checkmark from the Magnitude in dB checkbox to use a linear scale, or keep the checkmark in the Magnitude in dB checkbox to use a logarithmic scale. The Frequency axis, in hertz, covers the range from 0 to half the sampling frequency, which is the Nyquist frequency.

The Magnitude Response graph contains a set of cursors that you can use to specify the passband and stopband. Use the passband cursor to change the passband. Under the linear scale, the distance between unity and the horizontal passband cursor specifies the maximum passband ripple. The location of the vertical passband cursor indicates the passband edge frequency. The stopband cursors work the same when defining the specifications of the stopband. The distance between the horizontal passband cursor and the horizontal stopband cursor specifies the stopband attenuation.

Guidelines for Entering Filter Specifications

As you define a filter specification, you must adhere to a set of rules to maintain valid specifications. If you do not adhere to the following rules, the Error message indicator of the Configure Classical Filter Design dialog box displays a message with suggestions for repositioning the cursors.

  • Keep horizontal cursors in the range (0, 1) in a linear scale or (−inf, 0 dB) in a logarithmic scale.
  • Keep the horizontal passband cursor above the horizontal stopband cursor.

Selecting the Design Method

After you enter the target digital filter specifications into the numeric controls or graphical interface, select a design method.

When you design a digital filter with the Classical Filter Design Express VI, the design method and the filter specifications that you specify control the shape of the frequency response. You cannot alter the phase response, even though the phase response for filters generated with the FIR methods in this VI are linear phase. If you want to specify the magnitude response and phase response, use the Advanced FIR Filter Design VIs, the Advanced IIR Filter Design VIs, or the Special Filter Design VIs.

Refer to the Lowpass_Step 1_Design Lowpass VI in the labview\examples\Digital Filter Design\Case Studies\Single-Rate Filter\ directory for an example that demonstrates how to use the Classical Filter Design Express VI to design a lowpass filter.

Open example