LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure the frequency of a peak using Peak detector.vi or Array Max & Min.vi

Hello, I guess this question is a little bit easy but I have no head now to solve it. I have a repeated signal every 1.5 seconds. It has a repeated peak of voltage and I'd like to have an indicator showing the frequency of that peak. I don't know what's best to use Peak detector.vi or Array Max & Min. By now I have an Invoke Method FIFO inside a while loop giving me the DATA. After that what VI could I use if I know the Number of elements coming from the Invoke Node. The repeated signal is less, equal and greater than zero. Thanks in advance for your ideas. As an extra info, I've reviewed the examples with peak detection but no one measures or takes into account the frequency of the max peaks.

Impossible is nothing
0 Kudos
Message 1 of 8
(5,379 Views)

Hello bebin,

 

It sounds like you're running this code on an RT or Windows computer to process data received from an FPGA, is that correct?

 

I'd suggest taking a look at the Extract Tone or Extract Multiple Tones VIs in the Signal Processing>>Waveform Measurements palette.  Extract Tone will give you the frequency of the tone with the greatest magnitude, and Extract Multiple Tones will give you the frequency of each tone detected in the signal, sorted in order of decreasing amplitude. It sounds like you're looking for the fundamental frequency of the signal, so Extract Tone is probably all you need.

 

Regards,

Tom L.
0 Kudos
Message 2 of 8
(5,370 Views)

Hello 0utlaw, exactly, that's what I'm doing. I'll prove your suggestion tomorrow and I'll post a complete answer.

Impossible is nothing
0 Kudos
Message 3 of 8
(5,352 Views)

Hi 0utlaw,

 

 I've been using Tone Measurements.vi and it works correctly. However, it works correctly only for controled signals for example sine or cosine signals. The repeated signal I'm using has several peaks with different amplitudes. I'd like to measure the frequency of the highest peak that is repeated every 1.5 seconds or less. How could I set the Tone Measurements.vi in order to achieve this objective? Should I use another VI as the Extract Multiple Tones.vi?

Impossible is nothing
0 Kudos
Message 4 of 8
(5,313 Views)

Please post your data so we can see exactly what your signal looks like. With a complicated periodic signal the Tone Measurements.vi may not work well. It uses FFT internally but I do not recall how it processes the spectral data to measure the tone. You can open the block diagram and take a look for yourself.

 

Do your peaks of different amplitudes also have different frequencies? How much noise is on your signal? How close together are the frequencies? Do the frequencies vary together or with respect to each other? How many different (fundamental) frequencies are present in your composite signal?

 

Lynn

0 Kudos
Message 5 of 8
(5,299 Views)

Hello and thanks for your answer. In few words I'm working with an ECG signal. I guess that if I measure the frequency of the higher peaks I will be measuring the frequency of the electrical pulses generated in the hearth. There's an example that shows well a signal and some measurements but it hasn't the option to measure the frequency of the signal, or the rythm of the heart. Thank you so much for extra ideas.

Impossible is nothing
0 Kudos
Message 6 of 8
(5,279 Views)

Hello bebin,

For this application I recommend you to download the biomedical toolkit which already has specialized VIs to analyze signals such ECG.

I Share a link where you can see the processing capabilities of this toolkit...

 

http://www.ni.com/white-paper/6349/en

 

Hope this information helps you.

Regards,

Omar I.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(5,260 Views)

Thanks for your suggestion about the LabVIEW for ECG Signal Processing. The fact is that I already filter the signal in the FPGA. The filtered signal data is sent through a FIFO memory block to the Real Time Processor and is here where I want to measure the frequency of the voltage peaks. Is there an easy way to reach this objective? I reviewed some Examples and there's a VI which measure different features of an ECG signal and I was wondering if I could use some VI that gives the frequency of certain peak from a specifical voltage range or trigger. Thanks in advance and I really hope for you to don't get confused with my explanations.

Impossible is nothing
0 Kudos
Message 8 of 8
(5,242 Views)