Labview Experiment Sound Recording, Playback and Processing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

LabVIEW Experiment

Sound Recording, Playback and Processing

Objective: The purpose of this lab is to give you a beginner’s exposure to the very
powerful and user-friendly graphical programming package LabVIEW. In particular, we are
going to look at how LabVIEW can be used for sound recording, playback, and processing.

LabVIEW

Introduction

LabVIEW is short for Laboratory Virtual Instrument Engineering Workbench. It is a


powerful software package for the programming and control of lab instruments, as well as
a flexible instrumentation and analysis software system. Programs written in LabVIEW are
known as virtual instruments (VIs). Virtual instruments have three main parts: a front
panel, a block diagram, and an icon connector. The front panel is the interactive user
interface of a VI, which resembles the front panel of an actual instrument. The front panel
contains knobs, push buttons, graphs, and other controls (user inputs) and indicators
(program outputs).

Each front panel is associated with a block diagram that can be thought of as the
LabVIEW program. LabVIEW is similar to other software development systems with one
significant difference. Other programming systems use text-based languages to create
lines of code while LabVIEW uses a graphical programming language, called G, to create
programs in block diagram form, eliminating syntactical details. In G, programs are formed
by selecting blocks from available menus, setting their parameters, then connecting them
or rewiring them.

LabVIEW uses icons and graphical symbols rather than text to describe programming
functions. LabVIEW has many libraries of functions and subroutines to accomplish almost
any programming functions. It also has specific libraries for data acquisition, serial
instrument control, data analysis, data presentation, and data storage. This includes
functions for signal generation, signal processing, filters, windows, statistics, regression,
linear algebra, and array arithmetic. Any computation possible in a conventional
programming language is possible and usually simpler using the LabVIEW virtual
instrument approach.

Panel Palette Descriptions

The palette is the row of icons on the top bar of the screen of a VI. We see these once we
start running LabVIEW. The icons we use in this lab are:
1. Run Continuously Button (Looped Arrow) -Continuously runs the VI and allows for
editing of controls while the VI is running.
2. Stop Button (Stop Signal) -Stops the VI from running.

Printing VIs

We will print out the VIs once we start with the experiments. This section might not make
sense now, but it will when we start with the experiment. Refer back to this when you are
asked to print out a VI.

1. Go to File>>Print on the front panel of the VI.


2. Highlight the VI name you want to print out from the Select VIs window. Click on
“Next>”.
3. Select “Using the panel” from the Print contents window. Click on “Print”.

The VI prints out on the printer in the left front corner of the lab. The printout shows the
front panel, and also a short description of all the buttons on the front panel, to give you a
general idea of what this VI does.

References
“Student Edition LabVIEW 6i” by Robert H. Bishop (ISBN 0-13-032550-3). This book also
comes with a CD containing the Student Edition of LabVIEW software, which can be
installed on a computer. The price is at a level where every school can afford it.

Introductory Remarks

The workstations in this room are on a local network. You need to enter a username and
password to log on to the network. The username and password are both the name of the
computer you are working on (skinner, moulder, scully). For the domain, choose
CONTROL. Make sure you log on to CONTROL, otherwise you will not be able to print,
and you might have to redo some steps in the experiment! If you have ANY questions
during the lab, please do not hesitate to ask.

Experiments
Enter your username and password (see Introductory Remarks above). Make sure that for
the domain, you choose CONTROL.

Recording Sound

In this experiment, we record sound in LabVIEW. In the next experiment, we play back the
sounds we have recorded, and listen to the differences in the types of recordings.
1. On the Desktop double click on the LabVIEW Sounds folder. Double click on the
Record Sound icon. The front panel of the sound recorder opens up.
2. Print out the VI as described in the Printing VIs section above.
3. On the front panel, find the Sound Quality and Bits Per Sample. If you click on the
little arrows next to it, you can change the Sound Quality between mono and stereo,
and the Bits Per Sample between 8 and 16.
4. Select 8-bit mono.
5. Run the VI by clicking on the looped arrow button in the top left of the window. The
button changes appearance to indicate that the VI is running. The palette, the row
of icons on the top bar of the screen, also changes as the VI switches from the edit
mode to the run mode. Notice also that the stop button appears in the panel
palette.
6. We start recording. Make sure your microphone and speakers are turned on.
7. Click on the Record button, and start speaking into the microphone. Hold the
microphone close to your mouth to get the best recording. Notice your voice on the
corresponding graph (8-bit mono and stereo, 16-bit mono and stereo) as you are
speaking into the microphone.
8. Click the Stop button to stop recording. A window appears, asking for the name you
want to save the recorded wav file as. Save it in the LabVIEW Sounds folder as
8bitMono. If you are not already in the LabVIEW Sounds folder, search for it on the
Desktop.
9. Stop the VI by clicking on the red stop button next to the looped arrow used to start
running the VI on the panel palette.
10. Follow the previous steps 3 through 9 to get recordings for 16-bit mono, 8-bit stereo,
and 16-bit stereo. Make sure to select the appropriate Sound Quality (mono or
stereo), and Bits Per Sample (8 or 16) before running the VI. Save these
recordings as 16bitMono, 8bitStereo, and 16bitStereo respectively.
11. Examine the block diagram of the VI by selecting Show Diagram from the Window
menu. Observe the different objects in the diagram window. Each front panel has
an accompanying block diagram, which is the VI equivalent of a program. The
block diagram is constructed using the graphical programming language G, as
mentioned before. Notice how the components of the block diagram are wired
together to show the flow of data within the block diagram.
12. To change back to the front panel of the Record Sound VI, select Show Panel from
the Window menu.

Playback Sound

In this experiment, we play back the sounds we have recorded, and listen to the
differences in the types of recordings. In particular we look at the differences between the
8 and 16-bit mono vs. the 8 and 16-bit stereo.

1. On the Desktop double click on the LabVIEW Sounds folder. Double click on the
Playback Sound icon. The front panel of the sound recorder opens up.
2. Print out the VI as described in the Printing VIs section above.
3. Run the VI by clicking on the looped arrow button in the top left of the window.
4. Click on the File button. A window appears asking you to select a wav file to play.
Select 8bitMono in the LabVIEW Sounds folder by double clicking on it. If you are
not already in the LabVIEW Sounds folder, search for it on the Desktop.
5. Click on the Play button. The wav file you have selected plays, and appears on the
corresponding graph. The text box above the Record, Play and Stop buttons also
shows the channel (mono or stereo), the sampling rate, and the bits per sample (8
or16) of the wav file being played.
6. Click the Stop button to stop playback.
7. Repeat steps 4 through 6 to listen to the other recordings (16bitMono, 8bitStereo,
and 16bitStereo).
8. Stop the VI by clicking on the red stop button next to the looped arrow used to start
running the VI on the panel palette.
9. Examine the block diagram of the VI by selecting Show Diagram from the Window
menu. Observe the different objects in the diagram window.
10. To change back to the front panel of the Playback Sound VI, select Show Panel
from the Window menu.

Filter Sound
In this experiment, we play back the sounds we have recorded, but send it through a filter,
which alters the sound, and listen to the difference between the filtered and unfiltered
sound.

1. Run the Playback Sound VI by clicking on the looped arrow button in the top left of
the window.
2. Click on the File button as before, and select the 16bitMono wav file by double
clicking on it.
3. By clicking on the Filter On/Off button you enable or disable the filter. Turn the filter
off, and click on the Play button. Click the Stop button to stop playback. Now turn
the filter on, and click on the Play button again. Notice the difference in sound.
Also notice how the sound waveform changes on the far right graph.
4. By clicking on the Filter Type, you can change the type of filter used. These are
common filters that are used in electrical engineering. We will not go into detail
about the different types of filters, as it is beyond the scope of this lab, but only
notice how they change the sound.
5. Play around with the different filters, and see how they compare, and also how they
compare with the unfiltered sound (by enabling and/or disabling the filter). Make
sure to click the Stop button before clicking on the Play button.
6. Also open some other wav files located in the LabVIEW Sounds folder and play
around with them, again making sure to click the Stop button before clicking on the
Play button. NOTE: only wav files with 16-bit mono sound formats can be filtered in
this experiment!
7. Stop the VI by clicking on the red stop button next to the looped arrow used to start
running the VI on the panel palette.
8. Print out the VI as described in the Printing VIs section above.

Close all VIs by selecting Close from the File menu of the front panel. Closing the VI from
the diagram will close the diagram only, not the entire VI. Do not save any changes. Click
on “EXIT” in the LabVIEW window.

Report
Give a brief description of an experiment using LabVIEW and design a lesson plan for it.
The lesson plan should (i) be developed using the 5E model, and (ii) include a section for
the instructor relating the experiment to the National Science Educational Standards.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy