Calculations

Integrate

The integral is calculated using a moving window but requires two steps. First, the following equation is used for each window of data to determine the "area under the curve":

 

 

INT - Integral for Window

Fs - Sampling Rate

S - Window Length (Points)

f(s) - Data within the Window

The results from this equation for each window are then cumulatively added to produce a Data Series that represents the integral of the original Data Series.

In the script, this calculation is performed by iterating through the data with windows, finding the sum using the built in function .sum(). The result is divided by the sampling frequency and added to a cumulative variable.  See the following code to better understand this implementation:

for (var i = 0; i < x.NumPoints; i += winLen - winOverlap)

{

     sum += x.subset(i, winLen).sum()/x.Fs;

     y[j++] = sum;

}

From this code you can see that each window is summed, then divided by the sampling frequency, and the corresponding data point in the output data series is equal to the cumulative sum of the windows prior to and including the current window.

More:

Parameters

Validation

Output