LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak Detector Ex VI: X-Scale?

I've been meaning to use the Peak Detector example VI in my program to calculate the X locations of the peaks. What I stupidly didn't realize until now is that the Peak Detector VI won't tell me the X location of the maximums according to my data's X-range. So if my data actually spans -100 to -20 in the X-axis, the peak detector will give me X-locations starting from 0.
 
Now I realized that the Peak Detector VI assumes evenly spaced X-values -- but although this itself isn't a problem, the lack of a subjective X-scale is.
 
I can't figure out for the life of me how to convert these values to an x-scale of my choice. Does anyone know a simple way of perhaps mapping these X-locations to X-locations that are subjected to my X-start and X-end?
 
Thank you for your suggestions,
Alex
0 Kudos
Message 1 of 3
(2,329 Views)
EDIT: Wait a minute... Say "a" is my "X-STart" (the first value in my X-scale). What if I just add "a" to each of the peak locations? Won't this work? I'm going to try it, but if I'm completely wrong, please let me know.  If I am right, excuse the thread please! 🙂
0 Kudos
Message 2 of 3
(2,325 Views)
Hi ap888,

Sounds like that should do it!  Glad we could helpSmiley Wink
Brian A.
National Instruments
Applications Engineer
0 Kudos
Message 3 of 3
(2,305 Views)