LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to measure error on peak detect?

Hello!
I'm using the vi Waveform Peak Detect to find peaks in some signals that we analyze at the lab where i work. However, i must know also what's the error on the measure. Anyone knows if there is a vi that measures peak AND the error on the values found? Or at least a mathematical way to find the error myself?
Thanks!
0 Kudos
Message 1 of 2
(2,648 Views)
This is not an simple question to answer. When you search for the peak value of a signal you have to make some assumptions about that signal. For example if your signal looks like [1, 1, -1, -1, 1, 1, -1, -1, ...], it may be difficult to define its peak value.

The first approach is, that your signal is a square wave of amplitude 1.0 and normalized frequency = 0.25. It this case the peak value is also 1.0

But the same signal could be the result of the sampling of a pure sine tone of amplitude 1.4142 (SQRT(2)). if you sample your sine tone at 45, 135, 225 and 315 degrees of phase, you get the same sequence of samples. In this case you would like your peak result to be 1.4142.

So the error can be as big a 41% (3 dB). This is of course an extreme situation, and
in most case the error is much smaller.

In general, the higher the relative bandwidth of your signal is (the ratio between the signal bandwidth and the used sample rate), the most uncertain is your result. So if you want to "stay in control" you need to make sure your signal is sampled at a rate that is high enough to give a good representation of your original analog signal.

As an option, you may want to re-sample your signal (to a higher rate) using an appropriate algorithm. The new resampling VIs offer various interpolation algorithm that you can experiment with, depending on the nature of your signal. The peak detection VI will then do the work for you.
0 Kudos
Message 2 of 2
(2,648 Views)