LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with using SV Time-Varying Loudness.vi

Solved!
Go to solution

Hi,

  I am rather new to Labview and am having issues getting my Time-Varying Loudness calcuations to come out correctly. Attached is my current VI and a .csv file of a set of my data (calibrated in Pa. Sample rate = 50kHz for 5 seconds). When i run the VI it does not output what I would expect. Here are my questions:

 

Time-Varying Loudness:

1) What are there so many signals? There are hundreds of lines, but I only expected one.

2) Why is my x-axis not a range of 1 to 24 like Barks should be?

 

1/3 Octave Band Analsysis:

1) Why does it look incorrect? Their shouldnt be a linear increase as a function of frequency...

 

The data is of a part being squeezed and making a squeek. So it is a transient noise that happens around 2 seconds. Additionaly, how would I go about making a waterfall (Time(s),Frequency(Hz),Amplidtude(sones)) of this signal? Is there any easy way? or do I have to make all three signals and add them to make one plot?

 

Thank you for your help! Let me know if you need more infromation,

-Troy

 

p.s. i included a picture of the results as well.

0 Kudos
Message 1 of 10
(3,477 Views)

All,

I am pretty sure I am just using the VI incorrectly. Does anyone have an example where they use this VI? The only example NI has is with using DAQmx. I'd like to just see a file import and run with the time-varying calcuation.

 

 

Thanks fo your time,

Troy

0 Kudos
Message 2 of 10
(3,459 Views)

Hi Troy,

 

After looking at your VI and the spreadsheet you provided, it seems like you are using the Sound & Vibration VIs correctly, but there may be a problem with the way you are reading your data from file.  I made the following changes, which resulted in what I believe to be is the output you are looking for (image attached)

 

1) Delete the format and delimiter string inputs from the "Read From Spreadsheet File"- the table you are reading from is technically comma-separated-value format, but since there is only one column, there is no need to set a delimiter.  The "." you have set as a delimiter is the reason that you are returning two rows, one of zeroes, and one of your values, sans decimal- the VI is interpreting your data as two columns of integers separated by a decimal.

 

2) Use the "First Row" output of Read From Spreadsheet File.VI, rather than "All Rows"- this simplifies things a bit since you only have one column of inputs. 

 

3) Delete the "Delete From Array" function, using the "First Row" output should serve the same purpose.

 

4) Delete the multiplier you have implemented at the beginning of the second frame, getting rid of the decimal delimiter should fix the issue.

 

Let me know how that works, and thanks for letting us know that an example or how-to would be useful- feedback like that is where a lot of our new content originates!

Tom L.
0 Kudos
Message 3 of 10
(3,445 Views)

Tom,

   That looks significantly better! I was able to replicate exactly what you had. Here is what I still don't understand:

 

1) Why are their multiple colors on the specific loudness plot? Shouldn't it just be 1 white line representing "the one signal" loudness as a function of time?

2) Why is the x-axis not 1-24 barks like it should be for the specific loudness plot? Also, why does it increment for every run? It should always be 1-24

2) Any idea why the 1/3 octave plot Y axis is negative (i.e. not in decibels?)

3) How would i go about making a waterfall (3D) of the specific loudness? i.e. x-axis=time, y-axis=frequency, z-axis=loudness(sones)

 

Sorry for such specific questions. i am just trying to figure out how to implemenet what I know Labview should be able to do, but I just am learning the sytnax. Thanks,

-Troy

0 Kudos
Message 4 of 10
(3,438 Views)

Tom,

  After reading my first two questions I realized there is some confusion as to what the x-axis should be (units). I am expecting Barks not time. So a plot of sone/bark versus barks. Thanks

 

-Troy

0 Kudos
Message 5 of 10
(3,433 Views)
Solution
Accepted by tmbouman

Hi Troy,

 

1) The SV Specific Loudness VI "chunks" data into 2 ms blocks, and then returns these as individual Specific Loudness vs. Sone plots.  The colored lines you are seeing on your graph are representative of the 2,500 2 ms time periods within your five-second acquisition.  Each of these plots contains 241 points, however they should occur in ten sample "steps", one for each sone.  The digital filter's buffer takes a bit to fill and kick in properly, however, so you may want to give your first few rows( 0-.02 seconds or so) a closer look before using them- you may see a number of unexpected zeroes around the lowest sones.

 

2) Since you are using a chart, the x-axis will increment with every subsequent run (the previous data is retained.)  If you only want to display the most recent data, I would recommend switching to a graph, which can also be found in the graph controls palette.  Also, see above (#1) for why the x-axis is longer than 24 points.

 

3) Remember that dB is a unitless measure, and can only be used in reference to another value. A typical reference for sound is 20 uPa, however you will likely need to equalize your input data and determine/set a dB reference.  You may want to take a look at SVL Scale voltage to EU.vi (EU stands for equalized units) and SVL Set dB reference.vi.  In your case, I believe the Octave plot is showing your dB relative to a default value of 1.  The values should be accurate with respect to one another, but you will need to provide a reference value to calibrate the scale.

 

4) I think that this VI serves as a good example of how to go about creating a waterfall plot:

 

Waterfall Display for Octave (DAQmx)

http://zone.ni.com/devzone/cda/epd/p/id/5562

 

You will need to break up your waveform into chunks, much like the specific loudness VI, but the basic concept is roughly the same (take waveform chunk, take octave measurement of chunk, append octave measurement output cluster to array of clusters, repeat for remainder of waveform, display)

 

 

Phew!  That was quite a bit of information.  Let me know if that makes sense, and don't be intimidated by the detail and/or unfamiliar functions or methods  - you're definitely on the right track, or at the very least asking the right questions.

Tom L.
0 Kudos
Message 6 of 10
(3,414 Views)

Tom,

  That explained a lot. Thank you very much. I have one last question for you:

 

1) Why won't my colormap come out correctly? I based it off another example (SVXMPL_Tranisent Analysis (Simlated).vi). I am trying to use a color map solely because I don't understand Labview syntax enough to make a 3D plot on my own. So this is the best thing I thought i could figure out. Also, a colormap would work great for what I want. Basically all I am trying to do it take the "specific loudness" plot that is there and add a third dimension into the screen of time. I can see that all of the data is there and i feel like it would be a simple process, but i am struggling to figure out how to break up the "spectral map" type wire into what the waterfall/colormap wants.

 

Thank you for your help. Attached are my lastest files,

Troy

0 Kudos
Message 7 of 10
(3,399 Views)

Tom,

  Okay so I really don't understand what Labview wants for 3D plots...Attached is my best try. My colormap and waterfall don't work at all and my intensity plot works, but the axis values are off by a factor. Any feedback regarding these three items would be helpful. Thanks

 

-Troy

0 Kudos
Message 8 of 10
(3,389 Views)

You're just about there!

 

To get the Colormap to work as I think you want it to, you should do the following:

 

-Change the "dB on" boolean input to True, since that is the scale our waveform is in- this will plot your intensity using the same values as your frequency chart.

-Turn on autoscaling on the Y-axis

-Turn off autoscaling for the Z-axis (spectrum bar).  Set it to something that will give you a reasonable dynamic range, such as 1 to 50 dB.

 

As for the Waterfall plot, I suggest you reference the VI I linked in my second post to get a better idea of how to configure the components of the input cluster. 

Tom L.
0 Kudos
Message 9 of 10
(3,383 Views)

Perfect. Looks great. Thanks!

 

-Troy

0 Kudos
Message 10 of 10
(3,377 Views)