07-12-2010 04:18 PM
I would like to take only the positive section of my waveform and discard the negative section. I would also want to calcualte the RMS value and put it in some sort of accumulator during each scan. Does any one have any ideas?
Thanks
Edward
07-12-2010 04:32 PM - edited 07-12-2010 04:34 PM
Use the Get Waveform Components to get the Y array. Wire it to a For Loop with indexing enabled. Test each data point for >=0. If true, pass it to a build array function. If false, just pass the shift register contents straight through. Rebuild the waveform using the new Y array.
For RMS, look in the palette Signal Processing - Waveform Measurements - Cycle Average and RMS
07-12-2010 04:36 PM
I will try it and see how it works.
Thanks
Edward
07-13-2010 04:17 PM
Ok, It works, but I would rather keep the time stamp the same. In other words, if you took a piece of paper and place over the negative section of the sine wave graph, then the remaining waveform is exactly what I would want to reproduce think the way it is set up right now is that it filterer the positive but compresses the data points and leaves no time in between. Is possible to use limits?
Thanks
Edward
07-13-2010 04:26 PM
07-13-2010 04:28 PM
Now you are asking for something different. Instead of discarding, you want to replace all negative values with 0. The same code can be used with a minor modification in the false case.
07-13-2010 04:35 PM
This should work for my application.
Thanks
Edward
07-13-2010 09:00 PM - edited 07-13-2010 09:01 PM
Why not put the whole array through In Range and Coerce from 0 to Inf?
07-14-2010 10:44 AM
I tested it and it works great.
Thanks
Edward
07-14-2010 11:02 AM
Smart thinking RF!