Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 38 ยท Discrete Signals

LTI Systems and Convolution

Understand linear time-invariant systems, impulse response and discrete convolution. Implement convolution from scratch, check it with NumPy and learn its properties.

A system takes an input signal x[n] and produces an output y[n]. A filter, an amplifier, a room that adds echo, and a moving average are all systems. Most of DSP rests on one family: linear time-invariant (LTI) systems. For them there is a single formula, convolution, that gives the output for any input once you know the response to one impulse.

Linearity and time invariance

A system is linear if it obeys superposition: the response to a*x1 + b*x2 is a*y1 + b*y2. Doubling the input doubles the output; the sum of two inputs gives the sum of their outputs.

A system is time-invariant if delaying the input just delays the output: input x[n-k] gives y[n-k]. The system does not change its behaviour over time.

Examples: y[n] = 3x[n] + x[n-1] is LTI. y[n] = x[n]^2 is not linear. y[n] = n*x[n] is linear but not time-invariant (the gain depends on n). y[n] = x[n] + 1 is not linear (a constant is added).

Python Testing linearity and time invariance numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The impulse response

Feed the unit impulse d[n] into an LTI system and record the output. That output is the impulse response h[n]. It fully describes the system.

Why? Any input is a sum of scaled, shifted impulses (see Sequences). By linearity each scaled impulse produces a scaled copy of h, and by time invariance a shift of the impulse shifts the copy. Adding all copies gives the output.

The convolution sum

y[n] = sum over k of x[k] * h[n - k], written y = x * h.

flowchart LR
    X["input x[n]"] --> S["LTI system<br/>impulse response h[n]"]
    S --> Y["output y = x * h"]

The output is the convolution of the input with the impulse response.

Two readings of the same formula help:

  1. Superposition of copies: each input sample x[k] launches a copy of h, scaled by x[k] and starting at n = k; add all copies.
  2. Flip and slide: to get y[n], flip h, slide it so it ends at n, multiply with x and add up.

If x has length L and h has length M, y has length L + M - 1.

Python Convolution from scratch

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Both versions agree with NumPy. Real code uses np.convolve or scipy.signal.convolve, which also switch to FFT-based methods for long signals (Fast Convolution).

Algebra of convolution

  • Commutative: x * h = h * x.
  • Associative: (x * h1) * h2 = x * (h1 * h2): two filters in a chain are one filter whose impulse response is h1 * h2.
  • Distributive: x * (h1 + h2) = x*h1 + x*h2: filters in parallel add their impulse responses.
  • Identity: x * d = x; convolving with a delayed impulse d[n-k] just delays the signal.
Python Cascade and parallel filters

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Causality and stability

  • Causal: the output does not depend on future inputs, so h[n] = 0 for n < 0. Real-time systems must be causal.
  • BIBO stable: every bounded input gives a bounded output. For an LTI system this holds exactly when the impulse response is absolutely summable: sum of |h[n]| < infinity.
  • FIR (finite impulse response) systems have a finite h and are always stable. IIR systems have an infinite h (from feedback) and need a check.
Python Absolute summability and stability

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For a = 0.9 the total settles near 1/(1-0.9) = 10; for a >= 1 it keeps growing.

Frequency view in one sentence

Convolution in time becomes multiplication in frequency: if H is the Fourier transform of h, then Y = X * H at each frequency. That is why a filter is described by its frequency response and why the FFT makes long convolutions fast.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which system is NOT linear?

    The constant offset breaks superposition: the response to zero input is 2, not 0.
  2. 2. x has 10 samples and h has 4 samples. How long is x * h?

    Length L + M - 1 = 10 + 4 - 1 = 13.
  3. 3. What fully characterizes an LTI system?

    Any input is a sum of shifted impulses, so h determines the output for all inputs.
  4. 4. Two filters with impulse responses h1 and h2 are connected in cascade. The overall impulse response is:

    Cascading means convolving the impulse responses (and, in frequency, multiplying the responses).

Summary

  • LTI systems obey superposition and do not change with time.
  • The impulse response h[n] is the output for an impulse input and describes the system completely.
  • The output is the convolution y[n] = sum x[k] h[n-k], of length L + M - 1.
  • Convolution is commutative, associative and distributive; cascades convolve their responses.
  • A system is causal if h[n] = 0 for n < 0 and stable if h is absolutely summable.

Next: Difference Equations and Impulse Response