DSPRelated.com

Derivatives

Slope and rate of change

How fast is your heart beating right now? Not over the last minute, right now, at this instant. That number, the rate of change at a single moment in time, is what mathematicians call a derivative. It turns out to be one of the most useful tools in DSP, and much simpler than its reputation suggests.

Forget the formulas for a moment. Let's start with a slope.

Slope at a Point

Below is a smooth signal. Drag the orange dot left and right. The blue line is the tangent, the line that just barely kisses the curve at that point. Its slope is the derivative of the signal at that point. Watch the panel below: as you drag, the slope value gets plotted, tracing out the derivative curve.

That curve appearing in the lower panel is the derivative of the signal above. It's the slope of the tangent line at every point.

Key Insight: A derivative answers one question: if I nudge t by a tiny amount, how much does the signal change? That ratio, change in signal divided by change in time, is the slope of the tangent line at that point. The derivative is just that slope, computed at every point.

For the sine wave (the default), the derivative is cosine. That isn't a coincidence: d/dt sin(t) = cos(t) is one of the two most-used facts in all of signal processing. Switch the dropdown to t²/10 and you'll see the derivative is a straight line (the slope of a parabola grows linearly). Try the damped cosine to see a more complex derivative.

Try it: Drag the orange dot to the peak of the sine wave. The tangent should go flat, slope zero. Now drag it to the steepest upward part (the zero crossing going up). The tangent is steeply positive, and you'll see the slope-trace below hit its highest value there. The whole shape of the slope trace, traced out, is the cosine wave.

Why This Matters for DSP

Derivatives show up everywhere in DSP. The slope of a signal at a sample tells you how fast it's changing, useful for edge detection in images, velocity estimation in radar, and the "D" term of a PID controller.

More importantly, derivatives are how we describe change, and signal processing is mostly the study of changing signals. Frequency itself is the derivative of phase. The bandwidth of a signal is related to how steep its derivative can be.

Real DSP signals aren't smooth curves, though, they're lists of samples. So in the next lesson we'll meet the finite difference, the discrete cousin of the derivative. The intuition is identical; the formula just gets simpler.

Frequently Asked Questions

Is the derivative the same thing as the slope?

Yes. The derivative of a signal at a point is exactly the slope of the line that just kisses the curve there (the tangent line). The word "derivative" is used because that slope is *derived* from the original function. Slope is a number at one point; the derivative is a function that gives you that slope at every point.

Do I need to know how to compute derivatives by hand to do DSP?

Mostly no. Knowing d/dt sin(t) = cos(t) and d/dt cos(t) = -sin(t) covers the vast majority of derivatives that show up in DSP analysis. The intuition (it is just slope) matters far more than the formal rules of differentiation.

Where do derivatives show up in real DSP?

Many places: instantaneous frequency (the derivative of phase), velocity estimation from position samples, edge detection in image processing, slope of a filter's frequency response, the "D" term in PID controllers, and the relationship between a signal's peak rate of change and its bandwidth.

Quick Check

Test your understanding of the key concepts from this lesson.