Tuesday, April 22, 2008

RESPIRATORY SOUND ANALYSIS USING MICROPHONE

The following LabVIEW program will be helpful to analyse RESPIRATORY SOUND USING MICROPHONE.

FRONT PANEL OF PROGRAM

RESPIRATORY SOUND ANALYSIS USING MICROPHONE - FRONT PANEL

BLOCK DIAGRAM OF PROGRAM

RESPIRATORY SOUND ANALYSIS USING MICROPHONE - BLOCK DIAGRAM

SOUND RECORDING, PLAYING & PROCESSING USING LabVIEW

Recording Sound

In this experiment, we record sound in LabVIEW. In the next experiment, we play back thesounds 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 theRecord 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 thelittle 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. Thebutton changes appearance to indicate that the VI is running. The palette, the rowof icons on the top bar of the screen, also changes as the VI switches from the editmode to the run mode. Notice also that the stop button appears in the panelpalette.

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 themicrophone close to your mouth to get the best recording. Notice your voice on thecorresponding graph (8-bit mono and stereo, 16-bit mono and stereo) as you arespeaking into the microphone.

8. Click the Stop button to stop recording. A window appears, asking for the name youwant to save the recorded wav file as. Save it in the LabVIEW Sounds folder as8bitMono. If you are not already in the LabVIEW Sounds folder, search for it on theDesktop.

9. Stop the VI by clicking on the red stop button next to the looped arrow used to startrunning 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 orstereo), and Bits Per Sample (8 or 16) before running the VI. Save theserecordings as 16bitMono, 8bitStereo, and 16bitStereo respectively.

11. Examine the block diagram of the VI by selecting Show Diagram from the Windowmenu. Observe the different objects in the diagram window. Each front panel hasan 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 wiredtogether 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 fromthe Window menu.

Playback Sound

In this experiment, we play back the sounds we have recorded, and listen to thedifferences in the types of recordings. In particular we look at the differences between the8 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 thePlayback 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 arenot 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 thecorresponding graph. The text box above the Record, Play and Stop buttons alsoshows the channel (mono or stereo), the sampling rate, and the bits per sample (8or16) 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 startrunning the VI on the panel palette.

9. Examine the block diagram of the VI by selecting Show Diagram from the Windowmenu. Observe the different objects in the diagram window.

10. To change back to the front panel of the Playback Sound VI, select Show Panelfrom 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 unfilteredsound.

1. Run the Playback Sound VI by clicking on the looped arrow button in the top left ofthe window.

2. Click on the File button as before, and select the 16bitMono wav file by doubleclicking on it.

3. By clicking on the Filter On/Off button you enable or disable the filter. Turn the filteroff, and click on the Play button. Click the Stop button to stop playback. Now turnthe 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 arecommon filters that are used in electrical engineering. We will not go into detailabout the different types of filters, as it is beyond the scope of this lab, but onlynotice how they change the sound.

5. Play around with the different filters, and see how they compare, and also how theycompare with the unfiltered sound (by enabling and/or disabling the filter). Makesure 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 playaround with them, again making sure to click the Stop button before clicking on thePlay button. NOTE: only wav files with 16-bit mono sound formats can be filtered inthis experiment!

7. Stop the VI by clicking on the red stop button next to the looped arrow used to startrunning 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 fromthe diagram will close the diagram only, not the entire VI. Do not save any changes. Clickon “EXIT” in the LabVIEW window.

LabVIEW BASICS- FRONT PANEL & BLOCK DIAGRAM


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.

FRONT PANEL OF LabVIEW PROGRAM

BLOCK DIAGRAM OF LabVIEW PROGRAM



ICON CONNECTOR

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".