Tutorial Contents

Integrate

Contents

Integrate

To integrate data means to find the area under a section of waveform, often relative to some non-zero baseline such as the membrane potential. The integral can be positive or negative.

There are two traces. The upper shows a 4 Hz sine wave, the lower shows an 8 Hz sine wave. Both were constructed within DataView using the built-in expression parser. We will integrate the area under the first half cycle of the sine wave in the upper trace. We know exactly what the answer should be, because the integral of the first half cycle of a sine wave is:

\begin{equation*} \int_{t=0}^{t=1/(2f)} a\sin (2 \pi f t) dt\label{eq:eqDerivAlphaBetaP} \end{equation*}

where \(a\) is the amplitude (= 1), \(f\) is the frequency (= 4 Hz) and \(t\) is the time in seconds. This has the solution \(a/(\pi f)\), which for 4 Hz is 0.079577, or, if \(t\) is expressed in milliseconds, 79.577.

This is a general-purpose measurement facility that is also available through other meu commands, but it now opens with the Integral A to B option pre-selected. We need to tell the program which section of data to analyse, and the baseline value. This can be done explicitly, or by setting cursors. Initially, we will do the latter, because it is quick and flexible.

Integrate
Integrating the area under the first "hump" in a 4 Hz sine wave.

When I tried this the Measure output showed 77.0175 val.msec. This is reasonably close to the predicted analytical value, but there is still non-trivial error. The problem is that cursor time and voltage values are read from their screen locations, and these are only accurate to the nearest pixel. The problem could be minimized by expanding the view to full screen and displaying on a high-definition monitor, but it may still not be as accurate as is possible with these data. This illustrates the limitations of using the screen cursors for making precise measurements.

Now the measured value is 79.5733 val.msec, which very close to the predicted value.

The integration time now encompasses the first full cycle of the 8 Hz sine wave, and the integral is 0 val.msec, as it should be.

Real data

The cursor method may be perfectly adequate if you are measuring from real data - the innaccuracy due to pixelation may be trivial compared to that caused by inherent noise. But for greater accuracy you can set the baseline explicitly by measuring the average data value from some "silent" part of the recording outside of the perturbation whose waveform you want to integrate. And setting the time values explicitly means that the measurements are completely repeatable, whereas setting cursors "by eye" can cause variability if you measure the same data twice with different view settings and/or monitor configurations.