LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transforming a Sine wave in a rectified sine wave

Solved!
Go to solution

Hi there!

 

I am trying to make a VI where I transform a plain sine wave into a rectified one. Can anyone tell me why this is not working?

 

 

0 Kudos
Message 1 of 8
(5,008 Views)
Solution
Accepted by topic author icamaster

You only have a single value coming out of your "less than zero?" node. That means it is making a single decision, so I think it looks at the average of the Y array and determines if it's less than zero. You really want to go on an element by element basis. So use "get waveform components" to get the Y array, put it into a For Loop, and try your logic again. Then  "build waveform" using your previous waveform and only bundling in the new Y array.

Message 2 of 8
(5,003 Views)

I think this will also do what you want:

 

Capture.PNG

Message 3 of 8
(4,999 Views)

What's wrong with the absolute value function?

 

rectify.png

0 Kudos
Message 4 of 8
(4,978 Views)

Yes, it was so obvious. This did the trick, thank you!

0 Kudos
Message 5 of 8
(4,974 Views)

@icamaster wrote:

Yes, it was so obvious. This did the trick, thank you!


Hopefully you are not really going to do whatever you marked as solution above :o.

0 Kudos
Message 6 of 8
(4,966 Views)

Your solution was fine for Full-Wave but I also want a Half-Wave, which takes only positive values. 

0 Kudos
Message 7 of 8
(4,956 Views)

That's the first time you mention half-wave. How are we supposed to guess that?

 

But even for half-wave you don't need a FOR loop.

 

halfwave.png

0 Kudos
Message 8 of 8
(4,941 Views)