DSPRelated.com

Integrals

Area under the curve

If a derivative is the answer to "how fast is this changing right here?", an integral is its mirror image: "how much total signal has gone by so far?"

Geometrically, it's just the area trapped between the signal and the time axis. With one twist: area above the axis counts positive, area below counts negative.

Signed Area Under the Curve

Drag the sweep line left and right. The area between the curve and the time axis fills in: blue where the curve is above the axis, red where it's below. The lower panel plots the running total, the integral as a function of the upper limit.

The shape in the lower panel is the integral of the signal as a function of the upper limit. For sin(t), watch what happens: as the sweep crosses the positive hump, the running total climbs up. Then the curve goes negative, and the running total comes back down. After one full period, the total is back to zero.

Key Insight: An integral is signed area. The "value of the integral up to time T" is the total signed area trapped between the curve and the axis between 0 and T. Equal positive and negative areas cancel.

Switch the dropdown to sin²(t). The signal is now always non-negative (you can't have negative area when nothing's below the axis), so the running total only goes up. The average value of sin²(t) is exactly ½, so the running total climbs at a steady rate of t/2. This non-zero result is the key to why the DFT works, but more on that in two lessons.

Try it: With the signal set to sin(t), sweep across exactly one full period (0 to 2π). The running total ends right back at zero. That's why every pure sine wave has an average of zero. Now sweep across half a period. The running total ends at its maximum, area = 2.

Why This Matters for DSP

Integrals are how DSP computes anything cumulative: signal energy (∫x²dt), average power, total charge through a circuit, anything you'd ever need to add up over time.

Most importantly, the continuous Fourier transform is an integral: F(ω) = ∫ x(t)·e−jωt dt. Every spectrum analyzer, every FFT, every DFT comes from this single integral. Get comfortable with the idea of "area under a curve" and you've already grasped 70% of Fourier analysis.

Of course, in code we don't actually have continuous curves to integrate, we have samples. The next lesson is about how the integral becomes a sum, and how that sum is what we actually compute in real DSP.

Frequently Asked Questions

What is the difference between definite and indefinite integrals?

A definite integral has start and end limits and returns a single number — the signed area under the curve between those limits. An indefinite integral has no limits and returns a function (the antiderivative) plus an arbitrary constant. For DSP we almost always work with definite integrals.

What does it mean for area to be "negative"?

When the signal dips below the time axis, the area is counted as negative — same magnitude as if it were above, opposite sign. This sign-counting is essential. It is what lets a pure sine wave have an average of zero, and it is what makes orthogonality (the basis of the DFT) possible.

Why is ∫sin = -cos?

You are asking "what function has slope equal to sin(t)?" The derivative of -cos(t) is sin(t), so -cos(t) is an antiderivative of sin(t). The Fundamental Theorem of Calculus then says: the signed area under sin(t) from a to b equals -cos(b) + cos(a). The minus sign is exactly what makes the area return to zero after a full period.

Quick Check

Test your understanding of the key concepts from this lesson.