<< Chapter < Page Chapter >> Page >
NI LabVIEW DSP is a block diagram-based DSP development platform that allows the user to quickly set up complexDSP algorithms. The true power of LabVIEW lies in its ability to interface with external DSP devices and/or internal sound cardsthat are installed on the PC. The developed algorithms are downloaded to the DSP board, which then runs the algorithm in areal-time environment. In this lab, we will only scratch the surface regarding LabVIEW DSP’s capabilities. For starters, we willlook at how LabVIEW DSP interfaces with the A/D and D/A operations of the DSP board. Specifically, we will simply connect the A/Dconverter to the D/A converter so that the DSP system plays back audio signal sent to it.

A/d and d/a conversion

NI LabVIEW DSP is a block diagram-based DSP development platform that allows the user to quickly set up complexDSP algorithms. The true power of LabVIEW lies in its ability to interface with external DSP devices and/or internal sound cardsthat are installed on the PC. The developed algorithms are downloaded to the DSP board, which then runs the algorithm in areal-time environment. In this lab, we will only scratch the surface regarding LabVIEW DSP’s capabilities. For starters, we willlook at how LabVIEW DSP interfaces with the A/D and D/A operations of the DSP board. Specifically, we will simply connect the A/Dconverter to the D/A converter so that the DSP system plays back audio signal sent to it.

Simple sampling/reconstruction system

  • Keeping the Surround Mixer open, start LabVIEW Embedded Edition. On the startup screen from the Execution Target dropdownmenu select your hardware device. Refer to Figure 2 below for details. Execution target determines where your application willexecute when you run it.
  • Note: All the screenshots of LabVIEW windows are taken with the SPEEDY-33 selected as the execution target. However, theinstructions still apply for any other target unless otherwise specified.
Switch Execution Target to your DSP hardware device

Start with a new blank labview vi

  • Select File»New VI to start a new LabVIEW application. (Note: A LabVIEW application is called Virtual Instrument or VI). AnyLabVIEW VI consists of two windows; a Front Panel where you will design your user interface and a Block Diagram where you will addvarious block components or VIs and wire them together to design your DSP system. On starting a new VI you will see the Front Paneland Block Diagram windows for your application appear on the screen.
  • Switch over to the Block Diagram window by left clicking on it and start developing your application. You will now develop asimple VI to read in an analog input from the A/D channel and play it back using the D/A channel. From the menu select Window»ShowFunctions Palette. The Functions pallet contains functions or VIs that you will wire together to develop the application. Click onthe Elemental I/O palette and bring out the Analog Input Elemental I/O node and place it on the block diagram. This node is used toread in analog input from the A/D channel. Similarly place the Analog Output Elemental I/O node on the block diagram. Refer toFigure 3 below for details.
    Analog Input and Analog Output Elemental I/O nodes.
  • The Analog Input and Output nodes control the input/output flow of sound waves/data between the analog input channels and theDSP. The Analog Input node controls the A/D converter, which converts the analog input signal (from the microphone, functiongenerator, or any other analog sound source) to a sequence of numbers (digital data) and passes the data on to the DSP. Theanalog Output node controls the D/A converter, which takes the digital data from the DSP and converts it back to an analogsignal.
  • Now we need to configure the Analog Input and Analog Output nodes. Double click on the Analog Input node to bring up itsconfiguration dialog. In this dialog specify the following setting:
    • General Tab:
    • Resource: 2 channel multiple samples
    • Configuration Tab
    • Sample Rate in Hz: 48000
    • Framesize: 256
  • Click OK when done.
  • Double click on the Analog Output node. On its Configuration dialog specify the parameters as follows:
    • General Tab:
    • Resource: 2 channel multiple samples
    • Configuration Tab
    • Sample Rate in Hz: 48000
  • Before running any DSP algorithm, the Analog Input and Output nodes need to be wired together. Hover your mouse over the Leftchannel output of the Analog Input node, the mouse curser will change to a wire spindle. Left click and drag the wire to the Leftchannel input of the Analog Output node.
  • We will now place a While Loop so that the process can be run in a loop. Bring out a While Loop from the Functions»StructuresPalette. Place the While Loop around the two nodes by left clicking on the top left corner and dragging it to the bottom right. Thefinal application will look like Figure 4. Notice a stop button appears which is wired to the conditional terminal of the loop. Youwill also see a stop button on the front panel. Once the application is run you will press this button to stop theapplication.
    Completed Application
  • Save your VI by selecting File»Save As and storing it in the directory you created earlier. You can give the file any name youwant (such as lab1setup), but use the default extension of vi.
  • Now you need to prepare an audio input for your system. First, go to the Surround Mixer and activate the Wave/mp3 input.Place a CD in the CD player in the PC, select the Windows Media Player program, and press play. (Note: The program may automatically start when you insert the CD). You should not hearanything yet, because you haven’t compiled and downloaded the simple playback program to the DSP yet.

Run labview code on the dsp

  • You’re finally ready to run this very simple DSP system. (If using the SPEEDY-33 make sure that the Jumpers are in the Lineposition). To run the application left click on the run arrow on the toolbar as shown in Figure 4. Notice on the LabVIEW DSP ModuleStatus Monitor window comes up and displays the Status as the application is compiled and downloaded onto the DSP. The MemoryUsage bar at the bottom displays the amount of memory being used. Once Status displays Running on Target you should hear the musicthrough the headphones.
    LabVIEW DSP Module Status Monitor
  • To use the microphone input instead of the CD Audio input, simply mute the Wave input button on the Surround Mixer andactivate the Microphone input instead. Give it a try. You can very quickly toggle between (or even combine) different inputs by usingthe Surround Mixer.
  • Stop the program by pressing the Stop button on the Front Panel.
  • Effects of Sampling Frequency on Sound Quality
  • Now we’ll briefly examine the effects of sampling frequency on the sound quality of both music and voice signals.
  • Run the program again with CD audio input (using the original sampling frequency of 48000 Hz.) and note the sound quality.
  • Stop the program and change the sampling frequency (in both the Audio Input and Audio Output nodes) to 18000 Hz. Run theprogram again and listen to the sound quality. Repeat with a sampling frequency of 8000 Hz.
  • Repeat steps 1-2 but use the microphone input instead of the CD input.

Answer these questions

Describe how sampling frequency seems to affect the sound quality for both speech and music. Based on your observations, which seems to be most affected by sampling frequency, music or speech?

Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Fundamentals of digital signal processing lab. OpenStax CNX. Jan 03, 2006 Download for free at http://cnx.org/content/col10303/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Fundamentals of digital signal processing lab' conversation and receive update notifications?

Ask