Saturday, September 25, 2010

labview Sound Recorder

Summary: Various types of filters can be used to improve the quality of an audio signal. In the Sound Recorder Lab, experimenters use a Low Cost National Instruments USB Data Acquisition device to acquire sound data from a microphone element. LabVIEW software is then used to implement a band-pass filter that can act to clarify the audio signal. The Sound Recorder Lab is designed as a labratory or at-home experiment.

Sound Recorder Using National Instruments Low Cost Data Acquisition

Introduction

Any signal, including a sound wave, can be thought of as the sum of different frequency sine waves (where each frequency wave has a specific amplitude and phase angle). In addition to the frequencies we expect to see in a signal, some undesirable frequencies may also be present.
Filters allow us to select which frequencies we care about, and discard certain frequencies that are undesirable (such as noise). Various types of filters exist including low-pass, high-pass, band-pass, etc. There are also many different ways of constructing each filter type with each filter implementation having its own specific characteristics. More information on filters will be provided in the theory section.
In this exercise, the experimenters will use a microphone element to convert a sound wave into an electrical signal. This signal will then be digitized using a Low Cost USB DAQ device. Finally, a LabVIEW application will be constructed to filter undesired frequencies from the signal and play the clarified signal back.

Pre-Lab Assignment

1) In your own words, describe what an ideal band-pass filter transfer function would look like. You may research this by searching for “ideal band pass filter” in google, or using a textbook.
2) When filtering an audio signal, what frequencies must be preserved? Do some research to determine the frequency range produced by the human voice, and the audible range of the human ear.
3) Elaborate on some possible sources of undesirable frequencies in a signal. Where does signal noise come from?
4) Become familiar with the National Instruments USB 6008 and 6009 data acquisition devices. These datasheets are available at www.ni.com.

Theory

Electret Microphone Elements

One way to convert sound pressure waves into an electrical signal is using an electret microphone element. A picture of such an element is shown below:
Figure 1: Electret Microphone Element
Figure 1 (Graphic1.png)
Inside the electret microphone element, a dielectric material is made to hold a permanent charge. When the element vibrates, the internal capacitance changes and an electrical signal is produced. A variety of additional components complete the microphone element circuitry by adding a small amplifier to the output.

Band Pass Filters

The Fourier Transform tells us that it is possible to think of any signal as being composed of various frequency sine waves (with each frequency having an associated amplitude and phase angle)
Imagine that you have just used a microphone to convert a sound wave into an electrical signal. If the sound wave consisted only of a human voice, then only the frequencies that human vocal chords can produce should be present. Therefore, the overall signal should roughly be composed of frequencies between 80 Hz and 1.2 kHz.
Unfortunately, when playing back your audio signal, you may find that it does not sound very good! Perhaps the lights in your room added some 60 Hz electrical noise to the signal that shouldn’t have been there. Maybe the wind was blowing on your microphone, causing the signal acquired to be fuzzy-sounding. There are an enormous number of factors that could affect your sound signal.
Using a filter can help clarify the signal so that it sounds clear once again. Since you know that any frequencies outside of the 80 Hz – 1.2 kHz range are obviously noise, you can attempt to attenuate these frequencies as much as possible. Specifically, a band-pass filter can be used to accomplish this objective.
An ideal band-pass filter will completely attenuate any signals outside of a desired range (known as the passband). In the real world, it is impossible to construct an ideal filter, but with a large enough circuit or complex digital filtering it is possible to obtain a fairly sharp cutoff.
Remember, all filtering is essentially “frequency selection”. By filtering a signal, we are attempting to “choose” which frequency components can pass through and which we want to discard.

Hardware and Software Required

1. 10 Ohm resistor
2. 4.7 uF capacitor
3. Electret microphone element
4. National Instruments Low Cost USB DAQ
5. LabVIEW 8.2 software (LabVIEW 8.0 will work as well)

Laboratory Exercise

During this exercise, the experimenter will acquire a sound signal from an electret microphone element. This sound signal will then be run through an optional band-pass filter and played back using speakers.
When completed, the completed sound recorder front panel will resemble the following:
Figure 2: Completed Sound Recorder Front Panel in LabVIEW
Figure 2 (Graphic2.png)
1) Connect the following circuit to the Low Cost USB DAQ as shown. The microphone element can be purchased cheaply at Radio Shack, etc. Note that the +5V power supply can be obtained directly from the National Instruments USB 6008 or 6009 devices.
Figure 3: Electret Microphone Circuit
Figure 3 (Graphic3.png)
2) Using an event structure in LabVIEW, replicate the following block diagram for the “playback” event. Note that the “Bandpass Filter” Boolean control allows the user to play back the filtered or original signal.
Figure 4: Sound Recorder Block Diagram Showing Playback Event
Figure 4 (Graphic4.png)
3) Using the DAQ Assistant Express VI, complete the block diagram for the “record” event as indicated below:
Figure 5: Sound Recorder Block Diagram Showing Record Event
Figure 5 (Graphic5.png)
4) Experiment with the sound recorder VI by recording a simple voice message. Attempt to play back both the original and filtered signals. Modify the filter cut-off frequencies and see how narrow you can make the passband before the played back signal is difficult to decipher.

Post-Lab Questions

1) What sample rate did you use when recording your sound signal? Explain why you chose this rate and what issues could occur with too low or high of a sample rate.
2) Could you have used any other filter types to clarify the sound signal? Would a low-pass, high-pass, or other filter have accomplished the same objective?
3) How can you tell if high frequency noise is present in your sound signal without playing it back? Before filtering the signal, how could you have determined what frequencies the signal contained?

Content actions

GIVE FEEDBACK:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Popular Projects

My Blog List

Give support

Give support
Encourage Me through Comments & Followers

Followers