LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Peak Detector - fails simple test?

Solved!
Go to solution

Hi Folks -

 

I have tried two different spectra for the LabVIEW Waveform Peak Detector (LabVIEW 8.5).  One works fine, the other does not, and I am trying to figure out why.  VI and screenshot attached.  I hardcoded the arrays so you can just run the VI.  Any thoughts?

 

 

 peak-detector-test.png

 

Thanks,

 

Don

Message 1 of 9
(4,526 Views)
Solution
Accepted by topic author DonRoth

Hi Don,

 

Looks to me like the values are simply too low.  But it's odd that there is no error generated.  

 

I don't know if this solution will work for you or not.  But I tried something on a whim and it seems to work. 

 

peakdetect.png

 

The only thing I can guess is that the numbers you had were simply too small for the algorithm to work.  

 

 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
Message 2 of 9
(4,509 Views)
I think you had some wrong wireing someplace.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 3 of 9
(4,507 Views)

Hi Coq - I don't know if you opened my VI but the wiring is correct.  I ran your VI in LabVIEW 9.02f and it runs fine.  I then saved it to LabVIEW 8.5 and run into the same problem.  National Instruments must have corrected something in the Peak Detector algorithms between then and now.  It would be nice if someone would verify this.  I have a feeling that they used increased precision for the variables in the CIN to cure the problem that Pallen points out is probably because the numbers are too small with the precision used in LabVIEW 8.5.   By the way, the wavelet peak detection routine in the Advanced Signal Processing Toolkit works fine.

 

Don

0 Kudos
Message 4 of 9
(4,491 Views)
Yes you are correct. I checked this in Labview 9 and it worked. But it did not work in 8.6. This simple fix worked in Labview 8.6. I do not have 8.5


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 5 of 9
(4,471 Views)

I guess this is quite similar to Pallen's solution so we need to give him credit for the solution.

 

Thanks for taking a look.

 

Sincerely,

 

Don

Message Edited by DonRoth on 03-02-2010 11:18 AM
0 Kudos
Message 6 of 9
(4,460 Views)
Yes I see it now. But as I have shown( and I guess you are aware of) You can multiply an array with a single number or constant. The method used by Pallen is somewhat awkward then you want to multiply with a constant only


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 9
(4,447 Views)

For both suggested solutions, these are not full proof methods TO AUTOMATE the operation.  It will depend on the actual data.  Which is why I expect NI went in and changed the precision for this function in LabVIEW 2009 to correct this for all cases....

 

Don

Message Edited by DonRoth on 03-03-2010 07:21 AM
Message Edited by DonRoth on 03-03-2010 07:22 AM
Message 8 of 9
(4,414 Views)

As an aside: speaking of peak detectors, I'd like to mention a "free" one you can use by way of the "free" array you get when you use a chart's History Data. You can use the History Data property and get the Max value in the array and hold it until the number gets larger, then of course replace it with that number. Free peak detector! Yes, it is limited by the Chart History Length, but you can deal with that by storing values. I'm not saying it would work for this application, I'm not even saying it's a good idea, heck I don't call me Broken Arrow for nothing, I'm just saying.

Richard






0 Kudos
Message 9 of 9
(4,272 Views)