LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh Rate of Sound Analyzer

Solved!
Go to solution

Hello, I am a high school sudent and I am doing a project where I need to analyze sound from a microphone. I was able to listen to the microphone, and make the waveform update through time as the microphone released sound. My problem is that the analyzer was not rel time, but would instead take a sample and display it as a graph, wait 2 seconds, take 1/2 second sample, display as a graph. This was giving me 2 problems, first is that I could miss ound if it passed by and the timing was off and I need to analyze the amplitude of the sound, so that wouldnot work either because I had such a limited sample. I created an indicator for the amplitude in the signal processor and this would also only update every 2 seconds. I tried changing the settings of the graph so that it was a Synchronous display, but that did not work either.

 

If you would like, I can post the VI.

 

Any ideas as to why this slow refresh is happening?

0 Kudos
Message 1 of 5
(3,334 Views)
Solution
Accepted by topic author The Bulgarian

Why the delay?

 

Do the math:

You are acquiring 24000 samples at a 12000 rate. If you are going to be getting 12000 samples every second, how many seconds will it take to get 24000?

 

Your code basically looks pretty good. A couple recommendations: First, look into the "Producer/Consumer" design pattern. Part of you problem is that you are trying to do too much processing in the acquisition loop. You need to break out the data analysis operations into a parallel loop. Second, if you can figure out how to do the required analysis without them, lose the express VIs. Express VIs get you up an running fast but they can be very inefficient. Third, what is the frequency range that you are interested in? A 12kHz sample rate will accuratly represent data up to 6kHz. If that is beyond the frequency range of the mic you are using you can save acquisition and processing time by slowing the sample rate. Get online and Google "Nyquist Frequency".

 

Mike...

 

PS: What year of High School are you in? What sort of project are you working on? How is it that you are using LV for the project?


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 5
(3,320 Views)

So are you saying to take out the Filter, the Tone Measurements or the Input, and then put in my own VIs? What else can I actually move outside of the while loop, do I not have to contiuously be reading the microphone's sound input? The frequency which we are interested in is the 2400 Hz range. We are interested in frrequencies which are not common in daily life, i.e., 99% of the time, the amplitude at that frequecy is very low.

 

I am A Sophmore in High School and I have been programming in Java/C/C++, etc. and this year I was tkaen on as Head programmer for our FIRST Robotics Team. This eposed me to Labview a lot, because I was the only programmer who was actually programming, everyone else just sat around. We are also using Labview for a physics project of ours which made it to the final stages of the Lemelson-MIT Grant for 10,000$. As for the actual physics project, I would rather not disclose the idea, because of its ingenuity and it has never been done before. I was afraid to even post on here because someone might gleam information from our code, so I had to dumb down the code. If you would like, I can share the topic of our project with you in a Private PM (Do they have that on this forum?)

 

Thank You,

 

Delian Asparouhov

0 Kudos
Message 3 of 5
(3,303 Views)

Hello Delian,

 

I would suggest you using a producer/consumer design pattern.

 

This template is available by going to File»New... and expand the from template folder. You can use this template when you need to execute a process, such as data analysis, when a data source, such as a triggered acquisition, produces data at an uneven rate and you need to execute the process when the data becomes available.

 

Regards,

Juan Galindo
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,264 Views)

Aha, Now I understand, thank you very much Mr. Galindo, I was wondering what he had meant by producer/consumer design pattern.

 

Thank You,

 

-Delian Asparouhov

0 Kudos
Message 5 of 5
(3,258 Views)