Skip to content Skip to navigation

Connexions

You are here: Home » Content » DSP Laboratory: Analog to Digital and Digital to Analog Conversion

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • NSF Partnership display tagshide tags

    This module is included inLens: NSF Partnership in Signal Processing
    By: Sidney BurrusAs a part of collection: "Fundamentals of Digital Signal Processing Lab"

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • National Instruments display tagshide tags

    This module is included in aLens by: National InstrumentsAs a part of collection: "Fundamentals of Digital Signal Processing Lab"

    Comments:

    "The purpose of this course, EE 453 at Penn State University, is to familiarize students with DSP development by examining sampling, analysis, and reconstruction of continuous-time signals. […]"

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

  • NI Signal Processing display tagshide tags

    This module is included inLens: Digital Signal Processing with NI LabVIEW and the National Instruments Platform
    By: Sam ShearmanAs a part of collection: "Fundamentals of Digital Signal Processing Lab"

    Comments:

    "Lab material that explores signal processing concepts using National Instruments LabVIEW DSP."

    Click the "NI Signal Processing" link to see all content selected in this lens.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

DSP Laboratory: Analog to Digital and Digital to Analog Conversion

Module by: Erik Luther. E-mail the author

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

Simple Sampling/Reconstruction System

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

Start With a New Blank LabVIEW VI

  1. Select File»New VI to start a new LabVIEW application. (Note: A LabVIEW application is called Virtual Instrument or VI). Any LabVIEW VI consists of two windows; a Front Panel where you will design your user interface and a Block Diagram where you will add various block components or VIs and wire them together to design your DSP system. On starting a new VI you will see the Front Panel and Block Diagram windows for your application appear on the screen.
  2. Switch over to the Block Diagram window by left clicking on it and start developing your application. You will now develop a simple 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»Show Functions Palette. The Functions pallet contains functions or VIs that you will wire together to develop the application. Click on the 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 to read in analog input from the A/D channel. Similarly place the Analog Output Elemental I/O node on the block diagram. Refer to Figure 3 below for details.
    Figure 2: Analog Input and Analog Output Elemental I/O nodes.
    Figure 2 (Graphic2)
  3. The Analog Input and Output nodes control the input/output flow of sound waves/data between the analog input channels and the DSP. The Analog Input node controls the A/D converter, which converts the analog input signal (from the microphone, function generator, or any other analog sound source) to a sequence of numbers (digital data) and passes the data on to the DSP. The analog Output node controls the D/A converter, which takes the digital data from the DSP and converts it back to an analog signal.
  4. Now we need to configure the Analog Input and Analog Output nodes. Double click on the Analog Input node to bring up its configuration dialog. In this dialog specify the following setting:
    • General Tab:
    • Resource: 2 channel multiple samples
    • Configuration Tab
    • Sample Rate in Hz: 48000
    • Framesize: 256
  5. Click OK when done.
    Figure 3
    Figure 3 (Graphic3)
  6. 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
    Figure 4
    Figure 4 (Graphic4)
  7. Before running any DSP algorithm, the Analog Input and Output nodes need to be wired together. Hover your mouse over the Left channel output of the Analog Input node, the mouse curser will change to a wire spindle. Left click and drag the wire to the Left channel input of the Analog Output node.
  8. 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»Structures Palette. Place the While Loop around the two nodes by left clicking on the top left corner and dragging it to the bottom right. The final application will look like Figure 4. Notice a stop button appears which is wired to the conditional terminal of the loop. You will also see a stop button on the front panel. Once the application is run you will press this button to stop the application.
    Figure 5: Completed Application
    Figure 5 (Graphic5)
  9. Save your VI by selecting File»Save As and storing it in the directory you created earlier. You can give the file any name you want (such as lab1setup), but use the default extension of vi.
  10. 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 hear anything yet, because you haven’t compiled and downloaded the simple playback program to the DSP yet.

Run LabVIEW Code On The DSP

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

Answer These Questions

Exercise 1

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?

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks