Learn LabVIEW DSP in 3 Hours - Example 3: Acquire, Analyze and Generate Sound in Real Time
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
Complete the following steps to change the VI from a previous exercise to acquire sound through the microphone on the NI SPEEDY-33 board and to play back the filtered one.
- Open Example 2.vi that you built in previous example and save it as Example 3.vi.
- Place a Push Button from Controls»Boolean palette and label it as Filtered?.
- Modify the block diagram as shown in the following figure.

Figure 1. Block diagram of Example 3.vi (step 1)
- Place a Select Function from Functions»Comparison palette and wire the Filtered? terminal to its condition input. If the Filtered? button is ON, the filtered signal will be sent to the sound output. Otherwise the unfiltered signal will be played. Wire the Filtered Signal output from Filter Express VI to the true case of the Select function and wire the Sine output of the Simulate Signal VI to the false input of the Select function.
- Place the Analog Output node from Functions»Elemental I/O palette. By default it is configured to output a single sample to a single channel. Double click on the node and select 1 channel multiple samples on the General tab, and choose the sample rate of 8000Hz under Configuration tab. Wire the output of the Select function to Analog Output node.
- Connect your headphone to the Analog Output jack of the NI SPEEDY-33 board (labeled Output on the board).
- Check the Input Level jumper settings on the board and make sure Mic (Microphone Level) is selected.
Jumper Microphone Level Line Level JP1 (Left Channel) JP1-2 to JP1-1 JP1-2 to JP1-3 JP2 (Right Channel)
JP2-2 to JP2-1 JP2-2 to JP2-3 - Run the VI and listen to the filtered and unfiltered sine wave. Adjust the Frequency slide to change the pitch and Amplitude slide to change the volume as needed.
- Go to the block diagram and replace the Simulate Signal VI with Analog Input node located on Functions»Elemental I/O palette. Remove the Amplitude and Frequency sliders and the broken wires. Double click on the Analog Input node and select 1 channel multiple samples under General tab and keep the default values under Configuration. Note that these settings are also the default settings for Analog Input. The input signal will now be acquired through the left microphone.

Figure 2. Block Diagram of Example 3.vi (step 2)
- Run the VI. Whistle into the left microphone on the board (labeled MicL) and observe the graphs on the front panel while listening to the sound output generated. Alternatively, using the audio cable you can connect the sound output of your computer to the Analog Input jack of the board and play a sound file on your computer. In this case, remember to change the Input Level jumper settings on the board from Mic (Microphone Level) to Line (Line Level).
To get a solution VI 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/).
