LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

impulse trigger to create a time delay of x ms to perform an action for y ms

Hello all,

Here is what i'm trying to do:

I'm measuring an audio signal when a sound level is above a certain value Y (controllable) i need to wait a few ms (around 900ms) to get pass the main sound compound. Yhen i need to filter the next few ms (around 500ms) of data and do a FFT of that part of the filtered data only once until Y is reached again.

I can do all this with saved data but i'm struggling to do it as it occurs without saving the data.

I have everything in place i just need to know in general how to use an impulse trigger to a create time delay of x ms to perform an action for y ms.

Do you have any ideas how i can achieve this?

Thank you in advance,

Frederic.

 

 

 

0 Kudos
Message 1 of 5
(2,797 Views)

I've managed to do the above it's not pretty but it's working then i realised that i also need to create a FFT of x sec of data. Does anyone know how to do so please? 

0 Kudos
Message 2 of 5
(2,769 Views)

I think i've managed to do it all BUT it's very badly done as my PC is struggling. I know there are way too many loops but i dont know how to do it better.

Could someone please have a look and let me know what to do.

Thank you in advance 

Frederic.

0 Kudos
Message 3 of 5
(2,766 Views)

Sorry i forgot to mention how to use the VI.

select the tab called test where the graph are.

enter a value for max intensity acceptable 2 under the graph bottom right

enter value for millisec to wait (time before acquisition start) and millisec to wait 2 (acquisition length) at the right of the graph

start VI

Thank you.

Frederic

0 Kudos
Message 4 of 5
(2,763 Views)

Hi Frederic,

 

I've looked at your program and I have a few questions. What is the purpose of the Two While Loops that simply have a Case Structure that nothing in the false case and a Wait (ms) function in the true case? As it stands if these loops go into the false case then there is nothing to slow down the execution so the will try to run as fast as possible and not give the processor any time for other tasks which may explain why your computer goes so slow whilst this is running. This also applies to the While Loop where the false case says "If its not time to write the measurement file, do nothing."

 

I believe that what you want to look at is a Producer/Consumer(data) Pattern, where you have one loop that generates your data (producer), in this case reads in the sound data, and then a processing loop (consumer) that will do the Fat's and log data to a file etc.

 

More information about this can be found here: http://zone.ni.com/devzone/cda/tut/p/id/3023

 

Hopefully this helps you a bit. Let me know any questions you have.

 

James W
Controls Systems Engineer
STFC
0 Kudos
Message 5 of 5
(2,739 Views)