LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

audio power level with sound card

i'd like to measure the dB power spectrum from acquired sound signal.I take the signal from the sound card.The LV VI SI read extract the sound form,but how is possible to separe that's in the frequency domain?.
Bytelabs.it
0 Kudos
Message 1 of 9
(4,817 Views)
Nicola,

It is definatelly possible to create such anapplication in LabVIEW, however there are some things to take into consideration:

+The scaling of data can a big problem: the sound card will read 16 bits per sample at best, the data you read is the raw value of those 16 bits. Mapping this to real life voltage will be very tricky; it will depend on the sound card and depending on the quality of your sound card this mapping will not be very constant.

+The second thing to take into account is the accuracy of the saound card. Over time they have the tendency to drift the masurements and clip the signal before it gets to the max digital value.

In attaching an example here. It uses the Power spectrum VI; then converts the power spectrum to RMS vo
ltage in dB. I nomilize the time signal to be in the 0 to 1 range; there is the part where you would need to figure out the necessary scaling.

I hope this helps.

Let me know if you have other questions.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 9
(4,817 Views)
thanks, its intervention has helped me, I have used the low-end functions, because the read waveform.vi in a continuous loop, produces an error.
I'm sorry but i don't understand because /32767 for normalize the max value.
Also i don't understand the 22050 base for the dF.
I have attached the program that I have gotten with your help
Thanks still for your help,
Kind regards
Nicola
Bytelabs.it
0 Kudos
Message 3 of 9
(4,817 Views)
Nicola,

When you are reading 16-bit samples from your soundcard the minimum posible value is -32768 and the maximum value is 32767. When applying some DSP algorithms to a siganl it is a good practice to normailize the values; that is making sure that the values fall within a known value. By dividing by 32767 we are making sure that the values of the signal will be from -1 to 1. This way when you see some of the results you can compare within a known range.

For the frequency axis the FFT or power spectrum will range from 0 (DC component) to half the sampling rate. Since the acquisition is configured for sampling at 44100, I am making sure that the x axis reflects real frequency units.

Good luck with your project.

Juan Carlos
0 Kudos
Message 4 of 9
(4,817 Views)
Thanks Juan,
Now i understand,i have see that the x axis is half of
the sampling rate.
I'm trying with generating tone at specified frequency by using the sound write waveform vi.
When i sound a tone of 440Hz, the frequency in the x axis of the power spectrum have a peak at 420Hz.
I don't know this.
I've attached the new vi with tone generation.
I not sure,but i believe the power spectrum in db ref V0 , not a Watt.Is possible to create a real audio scale intensity?
Thanks for your answer.
Nicola
Bytelabs.it
0 Kudos
Message 5 of 9
(4,818 Views)
Hi Juan Carlos and Nicola. Im working on develop a cheap sound intensity probe. I alredy builded the probe, now im working on develop the acquiring software. Not shure about wich componet use becouse there is 5 or 6 components related with cross spectrum. I also want to do 1/3 octave filtering but it doesnt work because the conections between cross spectrum components and 1/3 octave components are not compatible. Need some help please. Im using an external professional audio interfase as signal capturer.
0 Kudos
Message 6 of 9
(4,402 Views)
Forgot to tell that this is my final work to get my degree and that the probe is for educational use.
0 Kudos
Message 7 of 9
(4,397 Views)
duende,
 
To get started with some simple sound input / analysis I would look in the LabVIEW example finder (Help->Find Examples).  In the example finder if you look at the "Hardware Input and Output->Sound" section you will find a couple of examples that will show you how to do some simple sound acquisition from your sound card.  Also, I would reccommend creating a new thread for this question in the future because this thread has been inactive for 2 years and not many people come accross it anymore.
 
I hope this helps,
Justin D.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(4,382 Views)
Ok Justin thanks a lot, would you just read my new thread please?
Thanks again.
0 Kudos
Message 9 of 9
(4,342 Views)