LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Integration without dynamic addition of values (LabVIEW Basics)

Hello,

 

I'm trying to perform integration on some signals. I'm not posting my complete VI details here. But a solution to the simple problem stated here will solve my issue. I've tried various integration VI functions and none of them could serve the purpose.

 

Details:

 

When I integrate a square wave generated from Square Waveform vi using Integral (Sum[Xdt]) (Time Domain Integrator), I got a triangular pattern which is absolutely fine. But when I set offset of the square wave to 1 (whose amplitude is also 1) and perform intergration, the previous values are dynamically added.

 

My requirement is to get

kt when amplitude = k (constant)

0 when amplitude = 0

 

As per the requirement mentioned above I should get a train of ramp pulses. Please checkout the VI and picture attached, which will clearly explain the problem. Looking forward for suggestions.

 

Thanks,

Avinash.

Download All
0 Kudos
Message 1 of 3
(2,690 Views)

Avinaash,

 

The signal you get when you integrate the entire input is exactly what you would expect to get from integration.

 

So, you need to do something different.  As you noticed, integrating the value when k <> 0 gives you the ramp you want. However, during the times the signals is zero, you and to reset the output to zero rather than holding the value at the end of the previous ramp segment.

 

Two suggestions:

1. The signals source in your VI does not produce the square wave your requirements statement describes.  It switches between +1 and -1.  You may need to do some calculations on the Amplitude and Offset inputs to get the Square Waveform.vi to generate the signal you want.

2. Extract segments of the waveform where the output is non-zero and integrate each separately.

 

Note: Searching for values exactly equal to zero may work for this simulation but with real signals you will have some noise or other non-idealities which make the "low" part of the signal close to zero but not exaclty, mathematically equal to zero.  Learn to use the In Range and Coerce function for "approximately equal to zero" comparisons.

 

Lynn

0 Kudos
Message 2 of 3
(2,677 Views)

Hey johnsold,

 

Thanks for your suggestions, I think I should explain a bit about my task. Well, I actually want to carry out frequency modulation on a sinusoid with different message signals using basic equation.

 

15d5be30682.gif

 

According to the equation, I need to perform integration on message signal m(t). Message signal can be anything, a square wave or a pulse train or a random signal. So I cannot play with the message signal parameters or always perform segment wise operations in case of a random signal (check out the attached image). I can only get the waveform components.

 

How to stop the integrator from holding the previous values at the end of each segment?

 

Thanks,

Avinash.

0 Kudos
Message 3 of 3
(2,665 Views)