07-06-2011 07:33 PM
Trying, serching and reading for hours, but cant get it right: I have a waveform array going over and under zero (lets say as a sound wave). I want to separate the positive waves from the negative ones and select the longest positive to continue calculations (and discard the rest). Please can someone help me? I´ve read a lot but cant split if I don´t know at which point. A bolean IF funtion for one value >0 AND and one <0 maybe? And then the opposite? Any suggestions?
Martin
07-07-2011 12:38 AM
Hi madoc,
You may go through the attached vi to see how it can be done. I have used a sine wave simulator to explain it.
Regards,
Nitzz
(Give kudos to good Answers and Mark it as a Solution if your problem is Solved;))
07-07-2011 02:13 AM
Here's a quick draft. It probably needs a few tweaks.
It finds the largest stretch of consecutive non-negative numbers from a 1D array, then takes it as a subset for further prcessing.
(There is also a way to only keep the longest subet, without building the array pf positive subsets first. Try it. ;))
07-07-2011 03:51 AM
Thanks - I´ll dig into it and be back!
You guys are great! /M
07-07-2011 10:23 AM
I managed the sorting, but altenbachs isolation of the longest stretch really did it!
Thanks a lot! Martin