Example Code

Sound Level Meter without Sound and Vibration Toolkit

Code and Documents

Attachment

Overview

I've created a basic Sound Pressure Level Meter that does NOT need Sound and Vibration Toolkit. I've checked against some IEC-61672-1 test signals and looks ok (LAF continous tone and LAF&LAS 4kHz bursts).

Description

I'ts a crude work, It will only work with 51,2ksps data. I only need to use 51,2ksps that's why. I need to implement bilinear transformation to calculate the filters for other data rates. It will work with data that is not at 51,2ksps but the time will be incorrect and the filters will give an incorrect result. I've used Christophe Couvreur's Octave Matlab code to generate the A and C filters coefficients.

 

The RMS is calculated in 25ms intervals (40Hz) as some standards for noise measurements demands for 30ms max.

 

I'm in the process of implementing 1/3rd octave visualization instead of the frequency spectrum, I have code working but I'm not shure if it's working ok. Do you know of some ready code to do this?

 

I should buy SVT in the future, but I'm not sure when, it can take a year or more, this is why I did it.

Hardware and Software Requirements

Labview 2015 Full development system

Steps to Implement or Execute Code

1. Open and run it with simulated signal, or point to a test signal (tdms file).

Additional Information or References

Does anybody found another example as mine? I've looked but I didn't find any in Labview (not using Matlab script).

Can someone with SVT compare results?

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
TommyDunkz
NI Employee (retired)
on

Hi fardissone,

 

Thank you for taking the time to share this example code with the community! I've reviewed it and have some recommendations for it, so that it can meet the Community Example style guidelines. Most of these are minor stylistic changes that we ask for in order to keep the user experience consistent for Community Examples, and to ensure that the code can be implemented seamlessly into larger applications.

 

Once the following changes have been made, I'll go ahead and push the example live for all users of the community:

  • TestFreqBinsGenerator.vi should be renamed with full words, and spaces between the words. This VI should also include comments explaining its purpose.
  • When documenting software requirements in both the top-level VI's front panel comment and in the description of the example on this page, please clarify that the example will work with LabVIEW 2015 or compatible LabVIEW versions (e.g. "Requirements: LabVIEW 2015 Full Development System or compatible").
  • For all included VIs, size the front panel to fit the entire toolbar (i.e., enough to show the search bar), and save it in the upper-left corner of the screen.
  • Show the labels of all controls and indicators on the panel, unless you have a good reason not to do so.
  • Set clusters to “Arrange Vertically”.
  • For Sound Level Meter - LV2015, use an Event Structure to monitor UI interaction. Do not poll front panel buttons or other controls when “Value Changed” events in an Event Structure would be more appropriate. If there is a “Value Changed” event configured for a control, ensure the control terminal resides in the Value Changed event case.
  • Ensure that Auto Error Handling is disabled for all VIs. The error wire should be connected through all diagram nodes, and the diagram should end with a call to Simple Error Handler.vi.
  • Select the “View Cluster as Icon” option for all cluster constants that contain default values for the cluster contents.
  • For subVIs (or top-level VIs that do not have loops), ensure control terminals are on the far left, and indicator terminals are on the far right, of the block diagram. Ensure all control and indicator terminals reside on the top level diagram.
  • Use Subdiagram Labels to document the functionality of subdiagrams in your code.
  • Some subVIs e.g. RMS Exponential Time Weighting (Wfm).vi can have their error case structures removed, since they consist of just a single subVI call which already handles the error wire.
  • There are unnecessary constants in the 'error' cases of A weighing filter.vi and C weighing filter.vi.
  • The error case of consumer loop in top-level VI has an unnecessarily long wire.
  • LabVIEW Version should also be included in the name of the .zip file.

 

Best Regards,

Tom D.
Staff Software Engineer
NI