Finding area of a wave
Show older comments
Hi Assume that, an output of a function(in simulink) is random sine-wave. That random sine-wave is originating at 0 (zero). how can i find out area for the wave above and below origin (Zero). Any logic?
... . . .
. . . . .
. . . . .
. Area1 . . Area3 . .
0________._____._________._____._______
.Area2. . .
. . ...
...
Answers (1)
Image Analyst
on 27 Feb 2012
I don't have Simulink so I'm not sure, but do you have the signal as an array? If so can't you just do
positiveSum = sum(signal(signal>0));
negativeSum = -sum(signal(signal<0));
If you need the areas in each half-cycle, then you'll have to find the zero crossings first.
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!