Audio and .wav Files

Project 4: Waveform Generator

Audio and .wav Files

Project 4: Waveform Generator

Introduction

In this experiment, we will use our Analog Discovery™ to play back .wav files through the speaker included in the analog parts kit. The arbitrary waveform generator (AWG) instrument has the capability of importing data in several formats—.wav files are one of these formats.

The Analog Discovery can only import relatively small .wav files. A few files which meet the Analog Discovery's requirements can be found at the link to the right.

Before you begin, you should:
  • Be able to use the Analog Discovery waveform generator to apply Sinusoids and Swept Signals to a circuit.
  • Define the sampling rate and sampling frequency of a signal.
After you're done, you should:
  • Use the Analog Discovery waveform generator to play audio files in .wav format.

Inventory:

Qty Description Typical Image Schematic Symbol Breadboard Image
1 Buzzer/Speaker
The Buzzer/Speaker in the analog parts kit has two terminals. If a time-varying voltage is applied between the terminals a film in the speaker vibrates, converting the voltage waveform to a pressure waveform with a similar “shape”. Note: The speaker in your parts kit may have different markings than the one pictured.

Procedures

Shortcut!

If you have completed the Sinusoids and Swept Signals project and your circuit is still intact, feel free to skip to Step 2 of this exercise.

Step 1: Understanding the Circuit

A. Circuit Schematic

  1. Connect one terminal of the speaker to the W1 terminal of your Analog Discovery.

  2. Connect the other terminal of the speaker to a ground terminal on your Analog Discovery.

B. Create Circuit

  1. Insert the terminals of the speaker into your breadboard so that they are in different rows.

  2. Connect W1 (the yellow wire) to one terminal of the speaker.

  3. Connect ground (, the black wire) to the other speaker terminal.

Step 2: Set up Instruments

A. Open WaveGen Instrument

  1. Open WaveForms™ to view the main window.

  2. Click on the WaveGen icon to open the waveform generator.

Step 3: Experiment

A. Import and Play a .wav File in WaveGen

The images above are screenshots of Digilent WaveForms running on Microsoft Windows 7.
  1. Click on Run AWG1 or Run All. You should hear a sound from your speaker which corresponds to the sound on the .wav file you imported. (To check whether the sound is appropriate, you can double-click on the file name in Windows Explorer. Microsoft will play the file for you automatically. Microsoft won't, however, allow you to filter or otherwise modify the audio file. The Analog Discovery will let you process the signal, as we will see later.)

Test Your Knowledge!

  1. Try changing the playback frequency of the file. For example, change the Frequency to half or double the sampling rate of the file.
    • Do the results agree with what you might expect?

  • Other product and company names mentioned herein are trademarks or trade names of their respective companies. © 2014 Digilent Inc. All rights reserved.
  • Circuit and breadboard images were created using Fritzing.