LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the area under the curve

Hello, 
Such as under the map, in theory, the area under the white line is 0.5 * 1 = 0.5
But integral operator out of the area is  0 , it's seems to be offset?
How can i modify my vi?

 

thanks~

 

0909.png

09091.png

 

0 Kudos
Message 1 of 6
(4,613 Views)

多多 wrote:

Such as under the map, in theory, the area under the white line is 0.5 * 1 = 0.5


No, the area under the white line is zero, because half of the white line is at -1. If you would add 1 to your data, you would get an area of 1.

 

If you want an area of 0.5, you should trim your data so it ends at time=0.5.

 

It really depends what you actually want. Please explain.

 

 

0 Kudos
Message 2 of 6
(4,610 Views)

sorry ,the describe 0.5 * 1 = 0.5 is error .

 

(1) I want the area is 0.5(the orizontal axis length) x 2(the vertical axis length) =1

     so, i have to add 1 to my data by myself ?

 

(2) Can I change the horizontal time axis coordinates at front panel  Waveform Graph

     (original 0 to 1)=>(0 to 1.4E-6) ?

 

 

THANKS~

0 Kudos
Message 3 of 6
(4,607 Views)

Take the absolute value of the signal before integrating.  This will  effectively ignore the sign of the signal. When you do this the signal in your example will be a constant at +1 for the entire duration.

 

Lynn

0 Kudos
Message 4 of 6
(4,595 Views)

@多多 wrote:

sorry ,the describe 0.5 * 1 = 0.5 is error .

 

(1) I want the area is 0.5(the orizontal axis length) x 2(the vertical axis length) =1

     so, i have to add 1 to my data by myself ?

 

(2) Can I change the horizontal time axis coordinates at front panel  Waveform Graph

     (original 0 to 1)=>(0 to 1.4E-6) ?

 

 

THANKS~



(1) According to your VI, you want a 1Hz square wave with a 50% duty cycle. If this is true, and you want the first half of your square wave to have an area of 1, then you will either have to add an offset of 1, or set the amplitude of the square wave to 2 (by default the amplitude is 1).

 

(2) Yes, you can change the time-axis coords. Left-click the number "1" on the Time-axis, then enter whatever number you want. Or, right-click the graph, select properties, switch to the "Scales" tab, then change the Maximum/Minimum values.

 

-----

Matt Kirk

Inventor of ImageJVI

0 Kudos
Message 5 of 6
(4,577 Views)

@多多 wrote:

sorry ,the describe 0.5 * 1 = 0.5 is error .

 

(1) I want the area is 0.5(the orizontal axis length) x 2(the vertical axis length) =1

     so, i have to add 1 to my data by myself ?

 

(2) Can I change the horizontal time axis coordinates at front panel  Waveform Graph

     (original 0 to 1)=>(0 to 1.4E-6) ?

 

 

THANKS~


(1)  Do you also want the second half of the waveform to be 0?  If so, set the offset of the waveform to 1.

 

(2)  The autoscaling is kicking in here.  What you want to do is increase the waveform frequency to something like 715kHz (or higher).  You may have to increase the Sampling Frequency (part of the sampling info cluster) in order to accommodate this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(4,542 Views)