Wednesday, October 14, 2009

Lab 3 - LabVIEW Interface to generate sound

A part of our lab experience was connecting the aruino and the motor with a LabVIEW environment. We used LabVIEW to receive a signal sent by arduino and play appropriate tone of sound. We used the detent mode to replicate the guitar string. Once the user plucks the string (goes over the detent window) a digital signal is sent to the computer. The LabVIEW VI interprets the digital signal and generates a short sound with pitch controlled by the location of a potentiometer which is connected seperately to the LabVIEW. The block diagram and front panel screenshorts are shown below.



The VI runs on an infinite loop with sampling frequency of 1 kHz. Once a digital signal is received (the digital input voltage goes from 0 to 5 V), the DAQ system sends out a True signal to the case structure. Inside the case structure is Play Waveform.vi which generates a sound with certain frequency (note) provided from somewhere else. Of course the False case doesn't do anything. The frequency (note) is determined by the voltage output from a potentiometer. We wrote the model in a way so taht the potentiometer voltage output (0 to 5 V ) is translated to the frequency range of 220 Hz and 1220 Hz.

The front panel is made to give visual feedback of the sound generation. The LED shows whether the sound is played or not while the waveform chart shows the musical frequency.

Here is the final result of the interface in action:

No comments:

Post a Comment