LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure the rate of a signal in real time using Peak detector vi

Hi, 

I have a question about how to get frequency rate of an analog signal using peak detector in real time. As i know, to get the frequency rate we have to measure peak to peak time inteval, but the peak detector VI just gives the index of each peak. so to have its time, we need a formula between position and time intervals.

I appreciate your help with any suggestion , an idea or explanation on how to do it.

best regards 

thanks

0 Kudos
Message 1 of 4
(2,360 Views)

FSTS wrote:

I have a question about how to get frequency rate of an analog signal using peak detector in real time. As i know, to get the frequency rate we have to measure peak to peak time inteval, but the peak detector VI just gives the index of each peak. so to have its time, we need a formula between position and time intervals. 


The index x dT + T0 will give you the peak time relative to T0. Or index / f +T0.

 

It depends or your signal, but there are probably point by point (PtByPt in quick drop) functions that do this out of the box.

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

Hi, 

Thanks for your quick response, for me i want to get the rate in time domain, from an accelerometer's analog signal, so i used what you said by trying with PtByPt;but have you an idea about how to choose dt and T0.

Thanks again.

0 Kudos
Message 3 of 4
(2,304 Views)

FSTS wrote:

Thanks for your quick response


I actually replied because your question was open for awhile! But you're welcome.

 


@FSTS wrote:

for me i want to get the rate in time domain, from an accelerometer's analog signal, so i used what you said by trying with PtByPt;


At this point it might be a good idea of post your code. There will be a discrepancy between your code, and what I think you have...

 


@FSTS wrote:

But have you an idea about how to choose dt and T0.


T0 will probably be cancelled out, but in a loop it will be an accumulating value, based on the previous time. It depends on the code that you have. Since all those times will be subtracted to get intervals again, it could be redundant.

 

dT would be your sampling rate, the delta time between samples. Or 1/frequency.

 

Your code would help us to help you. Also, an image of the signal will help. A sine wave, block wave, or an arbitrary noise would require very different approaches.

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