04-30-2017 01:06 AM
Hello all,
I'm a college student working on an engineering project that implements labview. My team's project is meant to sort plastic, aluminum and glass bottles. It differentiates between bottles by acquiring sound data. Basically, we drop the bottles through a chute, and record the sound at the bottom with a microphone.
Generally speaking, our approach is:
As of now, we are having trouble with step 2. We attempted to make a VI to analyze our sound data with the attached "sound-spectrum.vi". However, we need to implement our system with the myRIO-1900. So, we created a myRIO VI ("soundVI.vi") that is also attached.
We are having trouble getting useful or consistent data, so we are hoping to get any feedback on our code, or alternative methods to analyze our sound data.
Thanks!
Darren
04-30-2017 10:45 AM
I'm uncertain whether your difficulty lies with LabVIEW, with myRIO, or with acquiring and processing Sound Data. So I'll discuss each of these ...
Of the "journalism" questions I raised, above, a key one you might have overlooked is "When".
Bob Schor
04-30-2017 02:36 PM
Hello sorry if it was unclear before. I have attached a zip with my myRio project and vi. For the myRio vi I am using a 3.5mm mic input to gather sound to the myRio. I placed the read within a timed while loop with a 1MHz Clock and a Period of 75 us. This loop runs for 13333 iterations before it stops. This is done so that we may acquire sound for a second. the values are pulled out and used to create a wave form which we then put into an extract tone VI to gain an amplitude and frequency from the recorded sound wave.
The premise of our method is that we want to record sound for a second and then analyze that sound wave to see if the amplitudes or frequencies within that wave correspond to the sound of a glass, plastic or aluminum can hitting an object.
The issue we are having now is that the detected frequency reads approximately 60 regardless of the sound input. We are wondering if there is an issue with the sampling rate of sound made in the timed while loop. Or if the method we are approaching our project is wrong.
Please let me know if anything is unclear.
Darren Kong
04-30-2017 06:23 PM
Well, I can't see your data, but I know a little bit about Fourier Analysis. You've taken one second of data, and have done an FFT of these data. As I understand what you wrote, the major signal is at 60 Hz. You think that you are recording a sound (that lasts how long? occurs when during the 1-second window?), but how do you know? What do you know about the environment in which you are taking your data? What does 60 Hz bring to mind?
Bob Schor
04-30-2017 07:42 PM
The 60 Hz you are referring to is what our mic seems to be picking up from the ambient noise, but we want to analyze the sound spikes that occur from the collisions of our bottle. We know that our VI will capture it within the 1 second snip because we have it recording under a while loop. Here is an image of the waveform graph before and after we snap our fingers (which has a similar shape to when a bottle collides):
Before (ambient noise)
After (Snap)
Notice that the "amplitudes array" activates because the amplitude exceeds a threshold of .04. So there is a definitive deviation from the ambient noise. And clearly, the waveform graph does indeed detect this. However, the outputs of the Extract Single Tone VI ("detected amplitude" and "detected frequency") seem to stay relatively the same.
Now, here is an image when we play a recorded piano note, which has a longer sound pattern (the audio is attached):
As you can see, the frequency and amplitude have a noticeable change here. And this is fine, but seeing as the noise of a bottle hitting a surface will be more rapid, we need our VI to capture short, quick sound data as well.
Our theory as to why it won't work with short sounds is because it is a transient signal, which is not picked up by the Extract Single Tone's FFT. We are not sure how we would be able to solve this problem.
04-30-2017 08:49 PM
Well, as a non-engineer, I'd reason as follows:
Bob Schor