LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak detector.vi is not able to detect peaks.

Hello

I am having an issue when using peak detector.vi for finding peaks from mass spectrum (atomic masses vs intensity).

When I wrote code first time i just used two rows from the actual file to test. once testing was done, i used the actual file where the file structure is bit different.

I am attaching my vi with two csv files. file 1 is just two rows, manually created from a file, same as file 2. file 2 is what the actual file would be.

the peak detection works for file 1 but not for file 2!

I am unable to find the difference between the two files, but surely something i am overlooking. 

PS: please keep all these three files in same folder, when you test this on your end.

Download All
0 Kudos
Message 1 of 8
(2,134 Views)

I suggest you back-save (Save as Previous...) to LabVIEW 2018 or so if you want more help.  Many of us have locked in at earlier versions to avoid the new subscription plans.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 8
(2,124 Views)

Hello NIquist

Thank you for the suggestion. I saved to the LabVIEW 2018 version and reposting it.

Download All
0 Kudos
Message 3 of 8
(2,093 Views)

Wow, now I wish I hadn't said anything! 😲  I have looked at the raw data in Excel as well as your VI where I added a bunch of probes and extra indicators and I can't see why the peak detector VI is having trouble with the real data.  I thought you might have shifted the locations later in your math but nope.  There is only that one extraneous peak point even though the detector should find many.

 

I don't have time to delve deeper this afternoon but I will try to look at it later.  Hopefully one of the brainiacs here will chime in and make us both look stupid. 😜

 

EDIT:  BTW, try to avoid hiding indicators as it makes troubleshooting more difficult.  Just move them out of the way or to an unused tab.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 8
(2,016 Views)

Hi Jpdas,

 

I added some artificial scaling to the Y data:

(I also set logarithmic scaling for Y axis and included some code simplifications…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(1,996 Views)

Hello NIquist,

Thank you for looking into it. Your assesment confirms that i am not completly losing my mind! 

 

I hope someone finds out what is going on...

0 Kudos
Message 6 of 8
(1,987 Views)

Hello GerdW

Thank you for looking into this.

So does it mean that Peak Detector is failing due to low thresold value?

However, the file 1 and file 2 data collected on same mass spectrometer and the background intensity is in similar range. 

I think it is to do something with excel saving, though both are saved as CSV file. 

One experiement I did is, through excel, I reogranized file2 as file1 (like just two rows), that also doesn't work. 

This is interesting that when you scale up the values (by 100M), you could find the peak for file2!

0 Kudos
Message 7 of 8
(1,927 Views)

Hi Jpdas,

 

some algorithms don't "like" values that are different be several orders of magnitude - like yours.

Then it might help to scale them into similar ranges…

 

(Your last message seems to be temporarily suspended into spam prevention so this answer might make more sense once it reappears…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(1,964 Views)