Designing a Floating-Point Filter Part 3: Using a Digital Filter (Digital Filter Design Toolkit)

Digital Filter Design Toolkit

Designing a Floating-Point Filter Part 3: Using a Digital Filter (Digital Filter Design Toolkit)

In Part 2 of this tutorial, you learned how to analyze the filter you designed in Part 1. In Part 3 of this tutorial, you use the filter to process an input signal.

Note  If you did not complete Part 2 of this tutorial, refer to labview\examples\Digital Filter Design\Getting Started\Tutorials\Designing a Floating-Point Filter\Designing a Floating-Point Filter Part 2.vi for a completed version of the digital filter from that part.

Adding and Configuring an Input Signal

Complete the following steps to add and configure an input signal.

  1. If you do not see the Functions palette, select View»Functions Palette to display this palette.
  2. On this palette, select Express»Input to display the Input Express VIs.
  3. Click the Simulate Signal Express VI and place it on the block diagram.

    The Configure Simulate Signal dialog box appears. Make sure Sine is selected from the Signal type pull-down menu.
  4. Enter 100 in the Frequency (Hz) text box.
  5. Place a checkmark in the Add noise checkbox. Make sure Uniform White Noise is selected from the Noise type pull-down menu.
  6. Click the OK button to close the dialog box and return to the block diagram.
  7. On the Functions palette, select Express»Signal Manipulation to display the Signal Manipulation Express VIs.
  8. Click the Convert from Dynamic Data Express VI and place it on the block diagram. You use this Express VI to convert the input signal into the 1D array data type.

    The Configure Convert from Dynamic Data dialog box appears. Make sure 1D array of scalars - automatic is selected from the Resulting data type list.
  9. Click the OK button to close the dialog box and return to the block diagram.
  10. Wire the Sine with Uniform Noise output of the Simulate Signal Express VI to the Dynamic Data Type input of the Convert from Dynamic Data Express VI.

Processing an Input Signal

Complete the following steps to process an input signal with the floating-point filter by using the DFD Filtering VI.

  1. Place the DFD Filtering VI on the block diagram.

    Place  Find

  2. Wire the Array output of the Convert from Dynamic Data Express VI to the signal in input of the DFD Filtering VI.
  3. Wire the filter out output of the Classical Filter Design Express VI to the filter in input of the DFD Filtering VI.

    The block diagram now resembles the following figure.

  4. On the Functions palette, select Programming»Array to display the Array functions.
  5. Click the Build Array function and place it on the block diagram. The Build Array function concatenates the original input signal and the filtered signal so that you can analyze the effectiveness of the floating-point filter.
  6. Move the cursor over the Build Array function. When a double-headed arrow appears, click and drag the border of the Build Array function to add one more element terminal.
  7. Wire the Array output of the Convert from Dynamic Data Express VI to the first element input of the Build Array function.
  8. Wire the signal out output of the DFD Filtering VI to the second element input of the Build Array function.
  9. Display the front panel window. If you do not see the Controls palette, select View»Controls Palette to display this palette.
  10. On this palette, select Modern»Graph to display the Graph indicators.
  11. Click the Waveform Graph indicator and add it to the front panel. A Waveform Graph indicator also appears on the block diagram.
  12. Display the block diagram and move the Waveform Graph indicator to the right of the Build Array function.
  13. Wire the appended array output of the Build Array function to the input of the waveform graph.

    The block diagram now resembles the following figure.

  14. Display the front panel window and move the cursor over the plot legend on the waveform graph. When a double-headed arrow appears, click and drag the border of the plot legend to add one item to the legend. When you release the mouse button, the second plot name appears.
  15. Click the Run button to run the VI. The following figure displays the waveform graph of the original input signal and the filtered signal.

    Note  You can customize the graph by clicking the plot legend and configuring the plot labels, display, and colors.
  16. Select File»Save to save the VI.

The infinite impulse response (IIR) floating-point filter you designed in this tutorial is a lowpass Butterworth filter. This filter passes frequencies below 100 Hz with a maximum ripple of 0.1 dB and attenuates frequencies above 200 Hz with a minimum attenuation of 60 dB. This filter is suitable for filtering electrocardiograph (ECG) signals.

Note  Refer to labview\examples\Digital Filter Design\Getting Started\Tutorials\Designing a Floating-Point Filter\Designing a Floating-Point Filter Part 3.vi for a completed version of the digital filter from this part of the tutorial.
Previous: Analyzing the Digital Filter Design