LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FINDING, TIME STAMPING, AND SAVING SELECTED PORTIONS OF WAV FILE

Hello Everyone,

LV 6.1

What I'm trying to do is build an app that captures, timestamps and saves peaks only in a *.wav file from the sound card. Specifically, dog barking.  My dream would be that I have a constant input from a mike into the sound card which LV will real time analyze. When a threshold is triggered (a dog bark) the app will save the bark only with a time stamp.  My case against my neighbors would be better exemplified is I were able to present them with a time-of-day graph with tic marks at each bark and a cd they could listen to of the barks only.

Explorations so far:
  The sound VI's don't have time stamp outputs
  I have searched the knowledge base and found a few apps but came to a dead end with my knowledge
  I have experimented with various waveform analysis vi's but can't find the combo that gives me what I'm looking for

I can handle the post processing of graphs / spreadsheets but the waveform analysis for capturing the bark is eluding me. If someone could just get me started I could run with it but so far I ain't smart enough.

Thank You...........
0 Kudos
Message 1 of 4
(2,874 Views)
Hi rscully,
 
I think a great starting place is the "Sound Input to File.vi" example found in the Example Finder. Since the output is waveform data, you should be able to extract the timing information from the waveform data. Try using the "Get Waveform Components" function. If that doesn't work for you, you may also want to just grab the time stamp from the system clock with the "Get Date/Time String" function.
 
To record the bark, you can perform signal processing to match the bark frequency. The first thing that comes to mind, is to record a bark, analyze the power spectrum to find the peak power at a specific frequency range. Then in your program, you can find the power spectrum for that specific frequency range, and if the peak within that range exceeds a threshold, record the bark and time-stamp. This method should be simple if you have the NI Spectral Measurements Toolkit. See this tutorial.
 
Once you have verified that a bark has occurred, you may want to record the previous bark sound data and the post bark sound data. This will ensure that the entire bark is captured in a sound file. I have edited the "Sound Input to File.vi" example to demonstrate this. Please see the attached picture. I hope this helps!
0 Kudos
Message 2 of 4
(2,855 Views)
Thank You Mike for taking the time to help me.

It looks as though your VI's are from a more advanced version of LV than my 6.1.  I do like the concept of the shift register; I see where your going.  The holiday seaon is here and my free time is limited but as soon as I can I will try your concept with shift registers with what I have available with 6.1.

Again, I appreciate very much you taking the time to get me started.

Have a wonderful holiday season,
rscully
0 Kudos
Message 3 of 4
(2,819 Views)

Hello Mike L.

I too have the same issue with wanting to monitor sound samples and time stamp.  This dog barking monitor app would work great for me also, do you have a working version VI of this I can use as my base structure? 

Thanks! 

 

0 Kudos
Message 4 of 4
(2,733 Views)