LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting audio signals from mydaq into discrete values

Solved!
Go to solution
Hi guys!

I am currently building a project that accepts audio signals from mydaq. I wanted to make the analog signals have it descrete peak values. Is this possible? I plan to use the discrete peak values and sum them up using a shift register instead of doing peak detection. I think it is more easy.

Any suggestions would help. Thank you very much!

.."in the end we all have false hopes"..
0 Kudos
Message 1 of 8
(3,534 Views)

Hi Hope,

 

why should it be more easy to detect "discrete peaks" on your own to "sum them up" instead of using the ready-to-use PeakDetection function?

 

Please define "make the analog signals have it descrete peak values"! What kind of algorithm you want to implement?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(3,511 Views)
Thanks for replying sir!


Well actually, i wanted to make the acquired signal have its discrete values because i will use the number of peaks of the sound to determine which sound is louder (my assumption is that, the louder the sound or the nearer the sound to the microphone. The more sound peaks can be acquired. While lesser peaks are acquired the least louder the sound).

I will acquire sound signal from the mydaq, then detect the peaks and add those peaks while it is entering the acquisition. I wanted to make it discrete so that i will be able to add the numbers and the addition will stop once the sound is no longer present. The sound im talking about is a sound burst. Or a single instant sound and is not continuous.
0 Kudos
Message 3 of 8
(3,503 Views)

@FalseHope wrote:
Well actually, i wanted to make the acquired signal have its discrete values because i will use the number of peaks of the sound to determine which sound is louder (my assumption is that, the louder the sound or the nearer the sound to the microphone. The more sound peaks can be acquired. While lesser peaks are acquired the least louder the sound).

That is wrong (unless you are dealing with Doppler Shifts, but they implies the object is moving).  Closer peaks mean that you are dealing with a higher frequency (or pitch).  Louder sounds just have higher amplitudes (larger peaks).

 

 


@FalseHope wrote:
I will acquire sound signal from the mydaq, then detect the peaks and add those peaks while it is entering the acquisition. I wanted to make it discrete so that i will be able to add the numbers and the addition will stop once the sound is no longer present. The sound im talking about is a sound burst. Or a single instant sound and is not continuous.

Just use the peak detection function.  You can then add whatever peaks it finds from the current acquisition.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(3,480 Views)

Yes sir, that's what im trying to do. the peaks I'm talking about are the amplitudes.

so louder sounds will yield higher amplitudes. The farther the sound source, the lesser the loudness, the lower the amplitudes.

 

I wanted to take those amplitudes, have its discrete values, then use a shift register to add those values. That's it.

 

I am not familiar with the peak detector VI. In the sample VI provided free in labview, the peak detector jsut detects peaks.

 

yes it detects peaks. but i cannot use the detected peaks for something else. It's just there showing me the peaks. But I wanted to use those peaks for something else then sum them up. If there's anything I can do in the detected peaks so that I can use it and sum it up, please do tell me.

 

 

Best regards, your newbie 16 years old.

Falsehope

0 Kudos
Message 5 of 8
(3,449 Views)

"Sound" is a rather complex concept.  I'm guessing that you are looking at/listening to "natural sounds" picked up by your microphone.  If you sample the signal at a sufficiently high frequency (do you know about "sampling theory", and how the frequency of the sampling influences what you can say about the frequencies present in the sound you are sampling?), you will (probably) see a signal that varies in frequency and amplitude as a function of time.

 

If you are listening to "the sound" (I've deliberately named it as "one thing"), you will probably say "Oh, there are many "sounds" in that 10 seconds -- the phone rings, someone is talking, a door slams, and the whistling teakettle starts whistling".  Have you considered how, or if, you would separate these "sounds" for analysis?  What do sound engineers mean by "loudness"?  Before you invent your own method for determining loudness, why not see what others who have thought about this topic for more than a century have tried?

 

Don't give up, but do some research on sound measurement (can you spell Google?).  I suspect you will quickly abandon using peak detection ...

 

Bob Schor

0 Kudos
Message 6 of 8
(3,432 Views)
Solution
Accepted by topic author FalseHope

FalseHope wrote:

yes it detects peaks. but i cannot use the detected peaks for something else. It's just there showing me the peaks. But I wanted to use those peaks for something else then sum them up. If there's anything I can do in the detected peaks so that I can use it and sum it up, please do tell me.


Yes, the Peak Detector tells you where the peaks are.  Now use a FOR loop to autoindex on where the peaks are to get the level at those locations.  Now you have an array to the peaks.  You can then use Add Array Elements to add them together.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(3,393 Views)
Ok sir! This is what i needed! Thank you so much!
0 Kudos
Message 8 of 8
(3,332 Views)