From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

An efficient peak detector

Hi,

 

My program requires getting DATA from a DAQ in 16 channels and perform peak detection on all the channels...I used the peak detector vi ...I have that vi. Attached here.It contains only the peak detector vi.

 

This peak detector seems to consume too much memory and time ..Can anyone suggest a better and efficient alternative to this>?

 

Thank you

0 Kudos
Message 1 of 4
(4,029 Views)

You will need to provide more information.

 

You say that the peak detector consumes too much memory and time.  How much memory and time?  Why is it too much?

 

How much data do you have? How fast is it sampled? How many peaks do you expect in each data set?  Can you post the entire VI with some typical data saved as default? What are your doing with the raw data and the peak information?

 

I ran a quick test with an array of random numbers as input and default settings on the peak detector.  With 100000 data points it found >29000 peaks in 13.5 ms.  Adjusting the threshold so that only a few peaks are found drops the time to 8-9 ms.

 

Lynn

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

Thank You for replying..I was out of town , so coudnt respond on time. please dont mind.

 

attached is the vi which i use, the raw data is obtained from a DAQ device(6251), there are 16 chanels, the first channel will be having 100 peaks, while the rest of them will have 25 each....

 

i need to filter certain peaks, these peaks will appear as sinusoidally varying in amplitude, so i hve to filter the ones in the middle.

 

the problem is , as i am obtaining data from a DAQ, i have to finish the operations before the next set is available at the DAQ, otherwise it displays an error saying not enough memory.

 

i would be using only the locations and amplitudes and #peaks detected by the peak detector. is there a way by which i can make this peak detection process much more efficient. 

 

Thank You

0 Kudos
Message 3 of 4
(3,998 Views)

Can you post your acquisition code as well?  Are you using continuous mode acquisition?

 

I'm not sure I understand this part:

"i need to filter certain peaks, these peaks will appear as sinusoidally varying in amplitude, so i hve to filter the ones in the middle."

Can you explain it a bit more?

 

"the problem is , as i am obtaining data from a DAQ, i have to finish the operations before the next set is available at the DAQ, otherwise it displays an error saying not enough memory."

Does the error say that the DAQ buffer is out of memory or are you getting a general LabVIEW out of memory error?

 

Your consumer program looks ok except you're probably only seeing the last data set since your indicators are inside of your for loop.  Are you calling programPD as a subVI?  If so you should wire up the connector pane and pass out the data that you intend to use.

0 Kudos
Message 4 of 4
(3,981 Views)