LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take only the positive section of a waveform using Labview 2009

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

0 Kudos
Message 1 of 16
(5,011 Views)

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.

 

18697i637B36B564FBAFE3

 

For RMS, look in the palette Signal Processing - Waveform Measurements - Cycle Average and RMS

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 16
(5,004 Views)

I will try it and see how it works.

 

Thanks

Edward

0 Kudos
Message 3 of 16
(5,000 Views)

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

0 Kudos
Message 4 of 16
(4,965 Views)

Like this:

 

18799iCECBC2FD77447DA2

 

VI is attached in LV2009.

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 16
(4,960 Views)

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.

0 Kudos
Message 6 of 16
(4,957 Views)

This should work for my application.

 

Thanks

Edward

0 Kudos
Message 7 of 16
(4,952 Views)

Why not put the whole array through In Range and Coerce from 0 to Inf?

 

Message 8 of 16
(4,939 Views)

I tested it and it works great.

 

Thanks

Edward

0 Kudos
Message 9 of 16
(4,911 Views)

Smart thinking RF!

- tbob

Inventor of the WORM Global
0 Kudos
Message 10 of 16
(4,901 Views)