11-08-2017 06:39 PM
Hi all,
I have an array that I acquired from Peak Detection that returns all elements above a threshold. I have pretty good results but (because of some noise) I have some indexes that I want to remove because they are too close together. I want the peaks to be separated by at least 200 samples. I tried using a for loop by comparing points within 200 samples and return the higher amplitude but, since I'm very new to Labview, I can't seem to figure out how to make this work. I hope this makes sense.
Regards,
Chris
11-08-2017 10:15 PM
Attach your VI. Many students and others "very new to LabVIEW" use this Forum, and some of us enjoy teaching, so will suggest how to "fix what is broken" and help you to learn.
Bob Schor
11-08-2017 10:49 PM - edited 11-08-2017 10:54 PM
Thanks Bob,
Here's my VIs and sample files for testing. I might also mention they're not elegant by any means. I tried commenting to help you through it.
11-09-2017 01:20 AM - edited 11-09-2017 01:26 AM
Hi Chris,
I want the peaks to be separated by at least 200 samples.
Which peak do you wnat to keep for result?
The first within 200 samples? The last? The average?
I tried using a for loop
That's ok.
Compare current peak position with last position to determine their distance. When distance < limit then keep the correct peak of both… (Hint: You will need a shift register in the loop.)
To give an idea:
Comments on your last post:
11-09-2017 07:07 AM - edited 11-09-2017 07:19 AM
Hi Gerd,
It was late and I didn't even think of a zip I'll be sure to do that in future posts. If I'm using Labview 2017, would I just say v17 on the zip file? As for which peak I want to keep, the one with the highest amplitude. I assume I would bring that amplitude array into the for loop and do some comparison? Last, you use a constant on the shift register, is that function similar to a count?
11-09-2017 07:41 AM
11-09-2017 07:42 AM
@SteampunkMenace wrote:
If I'm using Labview 2017, would I just say v17 on the zip file? I recommend saying "I'm using LabVIEW 2017" as the final line in your post -- pretty unambiguous.
As for which peak I want to keep, the one with the highest amplitude. I assume I would bring that amplitude array into the for loop and do some comparison? If you create a cluster of "Peak" and "Peak Index" and output an array of these clusters, you could simply use the Array Max/Min function and use the Peak Index value.
Last, you use a constant on the shift register, is that function similar to a count? It is an "initialization", set so the initial time through the loop you have something from the "previous" loop, not an "unexpected default value".
Bob Schor
11-09-2017 09:26 AM - edited 11-09-2017 09:38 AM
Thank y'all for the feedback. I'm learning a bit more each day and it makes sense to cluster the arrays. I'll keep working at it with this info.
Regards,
Chris