04-07-2019 10:11 AM
Hello, I would like to develop a software to detect peak. I've tried the peak detector but the peak amplitude and the location is not accurate, and the accuracy is a very important info for me. Therefore, i compile a code using Array Max & Min but there is a few problem:
1. It can only detect 2 peaks amplitudes and locations for now where in my case i may want to detect up to 5 peaks
2. The first peak must be higher than the second peak in order to get detected, but that is not necessary in my case.
I've attach my VI and saved my result as the default, hope u guys can help me out, thank you in advance.
Solved! Go to Solution.
04-07-2019 11:54 AM - edited 04-07-2019 11:54 AM
Hi newuser,
I've tried the peak detector but the peak amplitude and the location is not accurate, and the accuracy is a very important info for me. Therefore, i compile a code using Array Max & Min but there is a few problem:
Why is the location of PeakAmplitude not accurate?
With ArrayMinMax you will get exactly ONE (1) peak in your array data: when you need more peaks you need to use a loop to search for more ArrayMax values. (Don't forget to replace the already found maxima by -Inf to avoid finding the same peak again and again…)
Some notes:
When attaching RT/FPGA VIs you really should attach the project file too.
Are you sure about using that PtByPt-Mean with a sample length of 1023?
04-08-2019 04:53 AM
1. The location seems to be correct but the amplitude is abit inaccurate, and the peak interested is the highest point only(for each fluctuation), but if peak detector were used, it will find all the peak detected.
2. How to find the next max by using loops as you mentioned?
3. i set to 1023 is because the number of elements i set is 2046 and divide by 2, and this is the block size isn't it?? if it wasn't, what number should i put for the sample length of mean?
I can't post my project file, how to post it? Thank you in advance.
04-08-2019 05:41 AM
04-08-2019 08:57 AM - edited 04-08-2019 09:26 AM
Read the help for peak detection to learn how it work (fitting a square function)
one possible way:
do a peak detection with a reasonable peak point width
with the resulting array enter a for loop to find the single point max value in that range (again about the same width choosen before)
going for a single value peak is always prone to noise ...
here is something to play 🙂
Q&D 🙂
04-17-2019 08:09 AM
04-17-2019 08:14 AM
GerdW, this is the zip file of my whole project, please take a look and see if there is any other mistake that i could change, thank you