Learn LabVIEW DSP in 3 Hours - Example 5: Design and Implement Digital Filters
LabVIEW DSP has new features like LabVIEW Project
To learn more about this feature follow the link below for step-by-step instructions.
Using the LabVIEW Project with LabView DSP Module
The Digital Filter Design (DFD) Toolkit is available as an add-on toolkit for LabVIEW 7.1. LabVIEW 7.1 Embedded Edition is a specialized version of LabVIEW that has been designed specifically for running on embedded targets. Thus, in order to design your filter, you will first need to close LabVIEW 7.1 Embedded Edition and launch LabVIEW 7.1. If you do not have access to the Digital Filter Design Toolkit for LabVIEW, proceed to the next example.
Download and launch PlayWaveWithSine.exe from "Learn LabVIEW DSP in 3 Hours - Solutions to Examples" document linked below. This application reads and plays the specified wav file adding a sine wave to it at a given frequency. In this exercise you will acquire the sound generated by this application in LabVIEW DSP and remove the sine wave disturbance from the signal using a Bandstop filter.
Complete the following steps to design a Bandstop filter in DFD Toolkit.
Create a blank VI in LabVIEW 7.1 and design the block diagram as follows.

Figure 1. Bandstop Filter
- Place the DFD Classical Filter Design Express VI located at All Functions»DFD»Filter Design palette. Configure the VI as shown in the following figure

[+] Enlarge Image
Figure 2. Configuration Window for DFD Classical Filter Design Express VI
- Place the DFD Save to File VI located at All Functions»DFD»Utilities palette. Wire the filter out output from the Express VI to the filter in input of this function.
- Place the Simple Error Handler to handle any run-time errors.
- Save the VI as Bandstop File.vi.
- Run the VI and save the created filter as Bandstop Filter.fds.
- Launch LabVIEW Embedded Edition and target it to SPEEDY33. Open Example 3.vi in LabVIEW Embedded Edition and save it as Example 5.vi.
- Modify the block diagram as shown in the following figure.

Figure 3. Block Diagram of Example 5.vi
- Right click on the Filter Express VI and replace it with the DFD Filter Express VI located at Functions»Signal Processing»Filters palette. Double click on DFD Filter and select a filter to use by giving a path to the Bandstop Filter.fds you created earlier. The configuration dialog box should look similar to the following figure.

[+] Enlarge Image
Figure 4. Configuration Window for DFD Filter Express VI.
- Right click on the Filter Express VI and replace it with the DFD Filter Express VI located at Functions»Signal Processing»Filters palette. Double click on DFD Filter and select a filter to use by giving a path to the Bandstop Filter.fds you created earlier. The configuration dialog box should look similar to the following figure.
- Save the VI.
- Using the audio cable connect the sound output of your computer to the Analog Input jack of the board. Note that the Input Level jumper setting on the board should be on Line.
- Run Example 5.vi.
- Run the PlayWaveWithSine.exe by supplying about 1300Hz (default value) for the Frequency input.
- Toggle the on-board DIP switch to enable or disable the Bandstop filter.
Complete the following steps to run the VI on TI DSK 6713 target.
- If TI DSK 6713 is not already powered on, plug the AC power cord into the power supply and AC source. Then plug the power cable into the board.
- Disconnect the USB cable from NI SPEEDY-33 and connect it into the TI DSK 6713.
- Target the LabVIEW DSP Module to TI DSK 6713 by selecting Operate»Switch Execution Target»DSK6713 from the menu.
- Open the block diagram of Example 5.vi. Notice that the Elemental I/O nodes have been switched to their default settings. Leave them as they are since the default settings are equivalent to what we have been using.
- Using the audio cable connect the sound output of your computer to the MIC IN jack of the board. Connect your headphone to the HEADPHONE jack of the board.
- In the configuration switch block SW3 on the board make sure the switch 3 is ON and all other switches are turned OFF.
- Run Example 5.vi. In the LabVIEW DSP Module Status Monitor check the Disconnect Front Panel option.
- Run the PlayWaveWithSine.exe in core LabVIEW by supplying about 1300Hz (default value) for the Frequency input.
- Toggle the on-board DIP switch 0 to enable or disable the Bandstop filter.
To get the solution VIs for this example refer to Learn LabVIEW DSP in 3 Hours - Solutions To Examples document linked below.
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
