LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

real time feature extraction

Hi all. I'm working on a project and I've a problem that don't know how to solve. My application should acquire sound from the PC's sound card (I've this part already done) and should detect in real time sound events based on a threshold. Once the program detect an event, it must extract the information from it for later feature extraction and classification. The thing is that I don´t know how to implement a solution that extract the information of the signal when an event is detected. Any idea?
Thanks in advance.

0 Kudos
Message 1 of 6
(2,917 Views)

To start, please clearly define some of the terms you are using. Thse amy have different meanings to different people.

 

"real time" This usually means that an action must occur within a deterministic time. The value of that time limit may be milliseconds, nanoseconds, or a few seconds, depending on the project. What is your time limit? What are the consequences of failing to complete the task within the limit?

 

"event" LV uses the term "event" in specific ways which are likely somewhat different from what you mean.  Are your "events" referring to the instant at which the signal crosses the threshold or a time interval or signal segment which starts at or near the threshold crossing and has a duration before or after? What are those time intervals, segment sizes, or durations?

 

"extract information" "feature extraction" What kind of information? What kind of features? Do you have algorithms or procedures for the extraction?

 

What is the format or data type of the data you acquire from the sound card? Arrays, waveforms, Dynamic Data type?

 

Lynn

0 Kudos
Message 2 of 6
(2,893 Views)

With real time I'm refering to a system that start audio acquisition and stops when user desire. In this lapse of time it should register every sound. There is not an specific time limit. I think that I can better clarify the situation with an example:

Once I've pressed the start button the program start monitoring the audio input signal waiting for a sound event. A sound event can be a glass breakage for instance. That noise consist on a signal segment that starts with a threshold excess and have a certain duration, then we have a sound event that we must clasify. I want to acquire from the waveform I'm monitoring the samples that corresponds to the event. With this samples I will later extract some features like MFCC to make a classification. What I want to get now is a way to take from the input waveform the samples that corresponds to a singular event.

 

I don't know if I've clarified the problem or just the opposite! 🙂

0 Kudos
Message 3 of 6
(2,880 Views)

OK. That helps. I won't say everything is perfectly clear, but I think I have a pretty good idea now of what you are trying to do.

 

This is not what most people call "real time." It would probably be called a user-interactive continuous acquisition with postprocessing.

 

It appears that this can be separated into several largely independent tasks. The sound acquisition you apparently have accomplished already. Next you have the sound event detection. That requires two conditions: Level exceeds threshold and the first condition is maintained for a specific duration. Segment extraction. Analysis and classification.

 

Sound event detection: Threshold condition: Convert the data to an array. The way to do this depends on the data format at the output of the acquisition VI. Then use Threshold 1D Array from the Array palette or Greater than? from the  
Comparison palette to find where the data crosses the threshold. Duration condition: Using a loop continue through the array and find all the places in the array where the signal is above threshold. (Note that not all SAMPLES will be above threshold because you have an AC signal which will go through zero.) Then find the largest gap between samples above threshold. If that gap is less than the duration condition, all the samples are part of the sound event segment. When a gap becomes greater than duration, anything after that may belong to the next event.  Depending on how clean your signals are, this might be straightforward or rather complicated.

 

Segment Extraction: Record the first and last indexes in the array of the points which meet the sound event detection criteria. Use that information and Array Subset to get the data from that event. You can reconstruct Waveform datatypes if desired for the analysis.  I recommend avoiding the Dynamic Data type generated by many Express VIs because it obscures the structure and content of the data.

 

Lynn

0 Kudos
Message 4 of 6
(2,866 Views)

Thank you very much for your ideas, i will put them on practice. Sorry for my messy questions, I'm new at LabView and I don´t have clear enough all concepts!

0 Kudos
Message 5 of 6
(2,846 Views)

If you have not taken any training courses on LabVIEW, spend some time with the on-line tutorials.They are a good way to get started with the basics of LV.

 

Lynn

0 Kudos
Message 6 of 6
(2,814 Views)