TExcelTAD
Home › Fourier Analysis & Signals › Linear Time-Invariant Systems

Linear Time-Invariant Systems

A system turns an input signal into an output signal: an amplifier, a room's acoustics, a smoothing filter, a car's suspension. Two properties, linearity and time invariance, make a system completely predictable from a single measurement and connect it to everything in this course. This is the central idea of Oppenheim and Willsky's book.

The two properties

A system SS maps xx to y=S[x]y = S[x].

  • Linear: S[ax1+bx2]=aS[x1]+bS[x2]S[a x_1 + b x_2] = a S[x_1] + b S[x_2]. Scaling and superposition pass through.
  • Time-invariant: if x(t)↦y(t)x(t) \mapsto y(t) then x(t−t0)↦y(t−t0)x(t - t_0) \mapsto y(t - t_0). The system does not care when the input arrives.

Systems with both are LTI. Examples: y[n]=12(x[n]+x[n−1])y[n] = \frac{1}{2}(x[n] + x[n - 1]) (LTI), y[n]=x[n]2y[n] = x[n]^2 (not linear), y[n]=n x[n]y[n] = n\,x[n] (not time-invariant), y[n]=x[n]+1y[n] = x[n] + 1 (not linear: zero input gives nonzero output).

python · try it yourself
import numpy as np

rng = np.random.default_rng(0)
systems = {
    "average   y = (x[n] + x[n-1])/2": lambda x: (x + np.concatenate([[0], x[:-1]])) / 2,
    "square    y = x[n]^2":            lambda x: x ** 2,
    "ramp gain y = n x[n]":            lambda x: np.arange(len(x)) * x,
    "offset    y = x[n] + 1":          lambda x: x + 1,
}

def delay(x, k):
    return np.concatenate([np.zeros(k), x[:-k]])

x1, x2 = rng.normal(size=20), rng.normal(size=20)
for name, S in systems.items():
    linear = np.allclose(S(2 * x1 + 3 * x2), 2 * S(x1) + 3 * S(x2))
    time_inv = np.allclose(S(delay(x1, 3))[3:], delay(S(x1), 3)[3:])
    print(f"{name:34s} linear: {linear!s:5s}  time-invariant: {time_inv}")
average   y = (x[n] + x[n-1])/2    linear: True   time-invariant: True
square    y = x[n]^2               linear: False  time-invariant: True
ramp gain y = n x[n]               linear: True   time-invariant: False
offset    y = x[n] + 1             linear: False  time-invariant: True

Why LTI systems are convolutions

Any discrete input is a sum of shifted, scaled impulses: x[n]=∑kx[k] δ[n−k]x[n] = \sum_k x[k]\,\delta[n - k]. Let h=S[δ]h = S[\delta], the impulse response. Time invariance gives S[δ[n−k]]=h[n−k]S[\delta[n - k]] = h[n - k], and linearity lets the sum pass through:

y[n]=∑kx[k] h[n−k]=(x∗h)[n]y[n] = \sum_k x[k]\, h[n - k] = (x * h)[n]

So an LTI system is convolution with its impulse response, and one measurement, the response to a single click, determines its response to every input.

python · try it yourself
import numpy as np

def system(x):                               # some LTI "black box": an echo plus smoothing
    y = np.zeros(len(x) + 10)
    y[:len(x)] += 0.5 * x
    y[1:len(x) + 1] += 0.3 * x
    y[6:len(x) + 6] += 0.2 * x
    return y

impulse = np.zeros(1); impulse[0] = 1
h = system(impulse)[:7]
print("impulse response h:", h.tolist())

x = np.array([1.0, -2.0, 0.5, 3.0])
print("black box output:  ", np.round(system(x)[:len(x) + 6], 4).tolist())
print("x convolved with h:", np.round(np.convolve(x, h), 4).tolist())
impulse response h: [0.5, 0.3, 0.0, 0.0, 0.0, 0.0, 0.2]
black box output:   [0.5, -0.7, -0.35, 1.65, 0.9, 0.0, 0.2, -0.4, 0.1, 0.6]
x convolved with h: [0.5, -0.7, -0.35, 1.65, 0.9, 0.0, 0.2, -0.4, 0.1, 0.6]

Eigenfunctions

Feed e2πiste^{2\pi i s t} into an LTI system with impulse response hh:

y(t)=∫h(τ)e2πis(t−τ)dτ=h^(s) e2πisty(t) = \int h(\tau) e^{2\pi i s (t - \tau)} d\tau = \hat{h}(s)\, e^{2\pi i s t}

The output is the same exponential times the number h^(s)\hat{h}(s), the frequency response. LTI systems cannot create new frequencies; they only scale and phase-shift existing ones. Nonlinear systems (a distorting guitar amplifier) do create new ones, harmonics and intermodulation products.

In software

  • scipy.signal.lti, dlti and lfilter model and simulate LTI systems; control engineers describe them by transfer functions (The z-Transform).
  • Linear differential equations with constant coefficients (circuits, springs) are LTI systems; see Differential Equations.

Exercises

Exercise 1: Classify

Is y(t)=x(2t)y(t) = x(2t) linear? Time-invariant?

Answer

Linear, but not time-invariant.

Solution

Scaling and sums pass through, so it is linear. Delaying the input by t0t_0 gives x(2t−t0)x(2t - t_0), but delaying the output gives x(2(t−t0))=x(2t−2t0)x(2(t - t_0)) = x(2t - 2t_0): different, so not time-invariant.

Exercise 2: Impulse response from the equation

Find the impulse response of y[n]=x[n]−2x[n−1]+x[n−2]y[n] = x[n] - 2x[n - 1] + x[n - 2].

Answer

h=[1,−2,1]h = [1, -2, 1].

Solution

Put x=δx = \delta: y[0]=1y[0] = 1, y[1]=−2y[1] = -2, y[2]=1y[2] = 1, and 0 afterwards. This is a second difference, a discrete second derivative.

Exercise 3: New frequencies (code)

Pass a 50 Hz tone through y=x2y = x^2 and list the frequencies in the output.

Answer

0 Hz and 100 Hz.

Solution
python · try it yourself
import numpy as np
fs = 1000
t = np.arange(0, 1, 1 / fs)
y = np.cos(2 * np.pi * 50 * t) ** 2
A = np.abs(np.fft.rfft(y)) / len(t)
print(np.fft.rfftfreq(len(t), 1 / fs)[A > 0.01].tolist())
[0.0, 100.0]

cos⁡2=12+12cos⁡(2⋅)\cos^2 = \frac{1}{2} + \frac{1}{2}\cos(2 \cdot): the squarer created a DC term and the second harmonic, which no LTI system can do.

Test yourself

Which system is LTI?

  1. y[n]=x[n]2y[n] = x[n]^2
  2. y[n]=3x[n]−x[n−2]y[n] = 3x[n] - x[n-2]
  3. y[n]=nx[n]y[n] = n x[n]
  4. y[n]=x[n]+1y[n] = x[n] + 1

The output of an LTI system with impulse response hh is…

  1. x+hx + h
  2. x⋅hx \cdot h
  3. x∗hx * h
  4. h(x)h(x)

If the input to an LTI system is a pure 100 Hz tone, the output…

  1. can contain any frequency
  2. is a 100 Hz tone with possibly different amplitude and phase
  3. is always zero
  4. is a 200 Hz tone