Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound Level from calibrated WAV files

Dear users,
I am trying to scan the WAV files and compute the sound level parameters based on the recorded calibration signal. My question regards the blosk size of samples used to analyze longer files. While the linearly averaged values do not vary depending on the block size, the exponentialy averaged values do, and so do parameters calculated based on exponentialy averaged sound level. What would be more appropriate, analyzing the files in longer blocks (22050, 44100) or smaller ones (8192).
Another thing, while obtaining the Leq values, 0 values sometimes occurs, how can I avoid this? Does anybody know how to calculate the Ln percentile levels used for traffic noise?
Thanks
0 Kudos
Message 1 of 11
(6,525 Views)
Hi monotone,

That is very interesting behavior.  I would expect that for a constant calibration tone, your sound level would be constant at any block size regardless of whether you are performing exponential or linear averaging.  Furthermore, if you signal is varying, I would expect the sound level to vary with block size regardless of what type of averaging you are doing.

What programming language and functions are you performing these measurements with?  Are you working with the Sound and Vibration Toolkit in LabVIEW?  If so, go ahead and post the code you are using and describe the behavior you are seeing in a little more depth.

Have a great day!
Travis W
0 Kudos
Message 2 of 11
(6,511 Views)
Hello Travis,
Thank you for your reply. I solved the problems I noted in my previous post, and also the ones regarding the statistics. However, the VI that I built in Sound and Vibration toolkit allows me only to read smaller wav files (up to maybe 2-3 minutes) without freezing up. If larger files are loaded, the VI takes forever to scan the file first and then starts processing it. While reading through this forum I became aware of the concept of analyzing the file in chunks, and even found some VIs that perform this action. However, the output of these VIs does not seem to be suitable for wiring to the scaling VI and other Sound and Vibration toolkit VIs. I can't figure out how to convert the data to the appropriate form. I am attaching the two examples of VIs that I found on the forum for chunking data. Do you think you can help with this? Again, I need the data in the form ready for S^V toolkit processing. Thanks again!

Download All
0 Kudos
Message 3 of 11
(6,500 Views)
Hi monotone,

From looking at the attached VIs, it looks like you need a way of converting an I16 array into a DBL precision wavefrom.  Below is a picture of the LabVIEW code that should help out with this.  Give this a try and let me know how it goes.



Have a great day!
Travis W

Message Edited by Travis W on 01-29-2007 08:11 PM

Message 4 of 11
(6,486 Views)
Thanks Travis!
It works after wiring it in the proposed manner. I tried with conversion to dbl, but it didn't occur to me to take the reciprocal of 44100. You helped out a lot!
I'm still kind of stuck on Ln perecntile noise levels. I figured out the histogram and cumulative distribution, but cannot get the values for L10 or L90. Of course, I can read them off the cumulative distribution graph, but would like to calculate it automatically. I tried with the percentile VI with input array coming from exponentially averaged sound level, but I get strange results and very small variations between the most extreme percentile levels (L1 and L99).
Thanks again for putting me back on track.
Milan
0 Kudos
Message 5 of 11
(6,479 Views)
Ok, I started celebrating a little too soon. Now that I have configured the VI as you suggested, the spectrum stopped showing linearly averaged results. I guess it shows the average for each chunk analyzed, but not for the whole file. Attached is a sample VI of what I would like to be able to do with longer wav files. If you have suggestion how to achieve that with the streaming wav VI please help. Sorry to bother you so much, I am spending a lot of time trying things out, and I guess I am missing something fundamental regarding the loops. Thanks


0 Kudos
Message 6 of 11
(6,470 Views)
Hi monotone,

If you are using the "Percentiles.vi" in LabVIEW as show below, it will have a different functionality than how Ln - Percentile Levels is defined here.



The difference is that LabVIEW takes the lowest n percent of the data and returns a number that is greater than that n percent.  As per the definition in the linked article, Percentile Sound Level takes the loudest n percent of the data and returns a number that is lower than that n percent.  No worries, though, these operations are easily interchangable.  Simply use (100 - p) as the input to the "Percentiles.vi" and this should clear up the problem.

In regards to receiving L1 and L99 as similar values, is it possible that your signal is not very dynamic?  If you are performing these measurements on a constant calibration tone, then I would expect the values to be similar.

Have a great day!
Travis W

Message Edited by Travis W on 01-30-2007 11:55 PM

0 Kudos
Message 7 of 11
(6,469 Views)
Hi monotone,

In regards to the issue with only seeing the Leq for the most recent dataset, it looks like your code is using the "Leq Sound Level" output instead of the "running Leq Sound Level" of the Sound Level VI.  Does your data look closer to what you'd expect when you use the "running" version?

Have a great day!
Travis W
0 Kudos
Message 8 of 11
(6,465 Views)
Hi Travis,
I've been playing around with the streaming VI for the past couple of days. Still have some doubts. The Leq time histories are working fine,  regardless of the use of regular Leq VI or the running Leq VI. However I still have problems with computing the linearly averaged 1/3 octave spectrum and histogram. Both are working fine with the old VI I posted but not with chunked data. It all comes down to exponential averaging VI which I am using to wire the data to the histogram, as I can't figure out how to wire the instantaneous pressure values. As you mentioned in an earlier post, the calibration tone should not vary depending on the type of averaging performed, but it does on the streaming VI, and it gives me a 3 dB smaller value, leading me to the conclusion that the Leq VIs are using the peak value for calculation, and the exp avg is using the rms value.
For the histogram, do you propose to use the running Leq VI and set the integration time to a smaller value (like 0.1 seconds, which is usually the sampling interval for Ln parameters)?
As for the octave analysis, the only values excepted are directly from the scaling VI (or weighting VI if used) and I suppose I should use some sort of summation to compute the lin average of all of the chunked data. When I position the octave analysis VI outside the loop, in the end of the process it gives me an overlay of many different spectra.
I also made a modification to the convert vI16 array into a DBL precision waveform you proposed in order to normalize the values, and it gave more meaningful readouts.
Thanks again for your time.
Milan
0 Kudos
Message 9 of 11
(6,440 Views)
Hi Milan,

Can you post the most recent version of your code so that we can give it a try?  It sounds like for the most part things are working OK, but you are getting values that are slightly off.  Good comments on the front panel and block diagram that highlight the areas of concern will be greatly appreciated Smiley Wink

I definitely want to make sure this gets answered, so I'll take a look at the code as soon as its here.  Also, in order to get input from a wider audience, I recommned posting a link to this thread on the DSA forum.

Have a great day!
Travis W

Message Edited by Travis W on 02-02-2007 03:32 PM

0 Kudos
Message 10 of 11
(6,422 Views)