---
title: Sinusoids through LTI systems
heading: Why complex exponentials come out unchanged in shape
eyebrow: C9 · Lesson 14 · Sinusoids through LTI systems
xp: 40
---

::: hook
Feed a sine wave into any LTI system, an amplifier, a filter, a loudspeaker in a room, and a sine wave of the same frequency comes out. Its size and timing change, but never its shape. That's not true of a square wave or a pulse, which come out rounded or smeared. Complex exponentials are the signals LTI systems can't distort, the system's **eigenfunctions**, and the factor each one is multiplied by is the **frequency response**. So the way to understand what an LTI system does to any signal is to split the signal into sinusoids, scale each one, and add them back up.
:::

::: play
- A ±1 square wave, built from its first seven odd harmonics, goes through an RC low-pass. r is the ratio of the square wave's frequency to the filter's corner.
- With r small, the corner is far above every harmonic and the output looks like the input. Raise r: the high harmonics are cut and delayed more than the low ones, and the corners round off.
- At r = 1, the fundamental passes at 0.707 of its size, 45° late, but the 13th harmonic is down to 0.077 of its size. Past r = 5 what's left is nearly a sine wave: only the fundamental gets through.
:::
:::

```sim plot
view: graph
x: t = 0..2
y: v = -1.5..1.5
slider: r = 0.02..6 = 1 step 0.01 log
plot: 1.273240*sin(2*pi*1*t) + 0.424413*sin(2*pi*3*t) + 0.254648*sin(2*pi*5*t) + 0.181891*sin(2*pi*7*t) + 0.141471*sin(2*pi*9*t) + 0.115749*sin(2*pi*11*t) + 0.097942*sin(2*pi*13*t) | dashed | samples: 1500 | label: input
plot: 1.273240/sqrt(1 + (1*r)^2)*sin(2*pi*1*t - atan(1*r)) + 0.424413/sqrt(1 + (3*r)^2)*sin(2*pi*3*t - atan(3*r)) + 0.254648/sqrt(1 + (5*r)^2)*sin(2*pi*5*t - atan(5*r)) + 0.181891/sqrt(1 + (7*r)^2)*sin(2*pi*7*t - atan(7*r)) + 0.141471/sqrt(1 + (9*r)^2)*sin(2*pi*9*t - atan(9*r)) + 0.115749/sqrt(1 + (11*r)^2)*sin(2*pi*11*t - atan(11*r)) + 0.097942/sqrt(1 + (13*r)^2)*sin(2*pi*13*t - atan(13*r)) | samples: 1500 | label: output
readout: fundamental's gain = 1/sqrt(1 + r^2) | digits: 3
readout: 13th harmonic's gain = 1/sqrt(1 + (13*r)^2) | digits: 3
```

::: predict
## A ±1 V square wave at 1 kHz drives an RC low-pass with its corner at 1 kHz. How big is the 1 kHz sine wave at the output?

- [ ] 1 V
- [ ] 0.707 V
- [x] 0.90 V
- [ ] 1.27 V

::: reveal
0.90 V. A ±1 square wave's fundamental has amplitude 4/π = 1.27, and the filter passes it at $1/\sqrt2$ of that: 0.90 V, 45° late. The third harmonic, 0.42 at the input, is cut to 0.13.
:::
:::

::: nameit
## Eigenfunctions

Put $x(t) = e^{st}$ into an LTI system with impulse response h:

$$y(t) = \int h(\tau)e^{s(t - \tau)}d\tau = e^{st}\int h(\tau)e^{-s\tau}d\tau = H(s)\,e^{st}$$

The output is the input times a number, $H(s)$, the **transfer function**. On the jω axis, $H(j\omega) = \int h(t)e^{-j\omega t}dt$ is the **frequency response**, and for a real system a real sinusoid comes out as

$$A\cos(\omega t + \phi) \;\to\; A\lvert H(j\omega)\rvert\cos(\omega t + \phi + \angle H(j\omega))$$

## Periodic inputs

A periodic signal is a sum of harmonics, $x(t) = \sum_k a_k e^{jk\omega_0 t}$ (A10's Fourier series). Each passes through on its own:

$$y(t) = \sum_k a_k\,H(jk\omega_0)\,e^{jk\omega_0 t}$$

so the output's harmonics are the input's, each scaled and shifted by the frequency response at its frequency. A ±A square wave has odd harmonics only, with sine amplitudes $4A/(\pi k)$.

## Discrete time

$z^n$ is the eigenfunction: $z^n \to H(z)z^n$ with $H(z) = \sum_n h[n]z^{-n}$, and on the unit circle $e^{j\omega n} \to H(e^{j\omega})e^{j\omega n}$, where

$$H(e^{j\omega}) = \sum_n h[n]e^{-j\omega n}$$

For example, the two-point average $h = [\tfrac12, \tfrac12]$ has $\lvert H(e^{j\omega})\rvert = \lvert\cos(\omega/2)\rvert$: 1 at ω = 0, and 0 at ω = π, where it cancels the alternating sequence completely. A periodic sequence of period N needs only N harmonics, $e^{j2\pi kn/N}$ for k = 0 to N − 1, because the others repeat them.
:::

::: example
## The ±1 square wave at 1 kHz goes through the RC low-pass with a 1 kHz corner. Find the output's first and third harmonics.

::: solution
1. **The filter.**
   $$H = 1/(1 + jf/f_c)$$
2. **Fundamental.** At $f = f_c$ the gain is $1/\sqrt2$:
   $$\begin{aligned} \frac{4}{\pi}\cdot\frac{1}{\sqrt2} &= 1.273 \times 0.707 \\ &= 0.900 \end{aligned}$$
   at −45°.
3. **Third harmonic.** At $f = 3f_c$ the gain is $1/\sqrt{10}$:
   $$\begin{aligned} \frac{4}{3\pi}\cdot\frac{1}{\sqrt{10}} &= 0.424 \times 0.316 \\ &= 0.134 \end{aligned}$$
   at $-\arctan 3 = -71.6°$.
4. **Compare.** The third harmonic falls from a third of the fundamental to under a sixth of it.

**Answer:** the fundamental comes out at 0.900 and −45°, and the third harmonic at 0.134 and −71.6°.
:::
:::

::: example
## What does $y[n] = \tfrac12(x[n] + x[n-1])$ do to $\cos(\pi n/2)$?

::: solution
1. **Frequency response.**
   $$\begin{aligned} H(e^{j\omega}) &= \tfrac12(1 + e^{-j\omega}) \\ &= e^{-j\omega/2}\cos(\omega/2) \end{aligned}$$
2. **Evaluate at ω = π/2.** The gain is $\cos(\pi/4) = 0.707$ and the phase is −45°, half a sample of delay.
3. **Output.**
   $$y[n] = 0.707\cos(\pi n/2 - \pi/4)$$

**Answer:** it scales the cosine by 0.707 and delays it half a sample: $0.707\cos(\pi n/2 - \pi/4)$.
:::
:::

::: example
## What does $y[n] = x[n] - x[n - 2]$ do to $\cos(\pi n/4)$?

::: solution
1. **Frequency response.**
   $$H(e^{j\omega}) = 1 - e^{-2j\omega}$$
2. **Evaluate at ω = π/4.** There $e^{-j\pi/2} = -j$, so
   $$H = 1 + j$$
   a gain of $\sqrt2 = 1.414$ and a phase of +45°.
3. **Output.**
   $$y[n] = 1.414\cos(\pi n/4 + \pi/4)$$
4. **The whole band.** The same filter blocks DC (H = 0 at ω = 0) and ω = π, so it passes a band in between.

**Answer:** it multiplies the cosine by 1.414 and shifts its phase by +45°: $1.414\cos(\pi n/4 + \pi/4)$.
:::
:::

::: check
kind: parts
given: A = 1 | 5; f = 100 | 1000; fc = 200 | 1000 | 3000

## $A\cos(2\pi ft)$ with A = {A} V and f = {f} Hz goes into an RC low-pass with its corner at {fc} Hz.

::: part
answer: A/sqrt(1 + (f/fc)^2)
unit: V
tolerance: 0.5%

### What is the output amplitude?

::: misses
- [A*fc/f] That's the slope far above the corner; use the full $1/\sqrt{1 + (f/f_c)^2}$.
- [any] Not yet. $A\lvert H\rvert$ with $H = 1/(1 + jf/f_c)$.
:::
:::

::: part
answer: -atan(f/fc)*180/pi
unit: °
tolerance: 0.5%

### What is its phase relative to the input, in degrees?

::: misses
- [atan(f/fc)*180/pi] A low-pass lags: the phase is negative.
- [any] Not yet. $-\arctan(f/f_c)$.
:::
:::
:::

::: check
given: A = 1 | 2.5; k = 3 | 5 | 7; r = 0.5 | 2
answer: 4*A/(pi*k)/sqrt(1 + (k*r)^2)
unit: V
tolerance: 0.5%

## A ±{A} V square wave at $f_0$ drives an RC low-pass whose corner is at $f_0/\given{r}$. What is the amplitude of the output's harmonic {k}?

::: right
Right. $4A/(\pi k)$ times $1/\sqrt{1 + (kr)^2}$ = {answer} V.
:::

::: misses
- [4*A/(pi*k)] That's the input's harmonic; the filter cuts it.
- [4*A/(pi*k)/sqrt(1 + r^2)] Use the filter at the harmonic's frequency, $kf_0$.
- [any] Not yet. Input harmonic × |H| at $kf_0$.
:::
:::

::: check
given: w = 0.5 | 1 | 2 | 2.5
answer: abs(cos(w/2))
tolerance: 0.5%

## The two-point average $y[n] = \tfrac12(x[n] + x[n-1])$ is fed $\cos(\given{w}n)$. What is its gain?

::: right
Right. $\lvert\cos(\omega/2)\rvert$ = {answer}.
:::

::: misses
- [abs(cos(w))] The half-sample delay puts ω/2 inside the cosine.
- [any] Not yet. $\lvert\tfrac12(1 + e^{-j\omega})\rvert$.
:::
:::

::: check
kind: parts
given: a = 0.5 | 0.8 | -0.6

## A system has $h[n] = (\given{a})^n u[n]$, so $H(e^{j\omega}) = 1/(1 - ae^{-j\omega})$.

::: part
answer: 1/(1 - a)
tolerance: 0.5%

### What is its gain at ω = 0?

::: misses
- [any] Set $e^{-j\omega} = 1$.
:::
:::

::: part
answer: 1/(1 + a)
tolerance: 0.5%

### What is its gain at ω = π?

::: misses
- [1/(1 - a)] At ω = π, $e^{-j\omega} = -1$.
- [any] Not yet. Set $e^{-j\omega} = -1$.
:::
:::
:::

::: check
given: s0 = 1 | 2 | 0.5; a = 3 | 5
answer: 1/(s0 + a)
tolerance: 0.5%

## $x(t) = e^{\given{s0}t}$ (for all t) goes into $h(t) = e^{-\given{a}t}u(t)$. The output is $Ke^{\given{s0}t}$. What is K?

::: right
Right. $H(s) = \int_0^\infty e^{-at}e^{-st}dt = 1/(s + a)$, at s = {s0}: {answer}.
:::

::: misses
- [1/a] Evaluate H at the input's s, not at 0.
- [1/(a - s0)] $H(s) = 1/(s + a)$.
- [any] Not yet. $H(s_0) = 1/(s_0 + a)$.
:::
:::

::: check
given: c = 0.3 | 0.5 | 2; H = 0.8 | 0.25 | 3
answer: c*H
tolerance: 0.5%

## A periodic input's harmonic at 3 kHz has size {c}. The system's |H| at 3 kHz is {H}. How big is that harmonic at the output?

::: right
Right. Each harmonic is scaled by |H| at its own frequency: {answer}.
:::

::: misses
- [any] Not yet. Multiply by |H| there.
:::
:::

::: check
kind: choice

## A 50 Hz sine wave goes into an LTI system. What can come out?

- [ ] Any periodic signal with a 50 Hz period
- [x] A 50 Hz sine wave, possibly scaled and shifted
- [ ] A sine wave at 50 Hz plus harmonics at 100, 150, … Hz
- [ ] A sine wave at a frequency set by the system

::: misses
- [1] Shapes other than a sinusoid would need harmonics the input doesn't have.
- [3] Harmonics come from nonlinear systems, like a clipping amplifier.
- [4] An LTI system can't shift frequencies; only scale and delay each one.
:::
:::

::: check
kind: parts
given: k = 1 | 3 | 5; x = 0.5 | 1 | 2

## A ±1 square wave goes through an RC low-pass whose corner is {x} times the square wave's fundamental.

::: part
answer: 4/(pi*k)/sqrt(1 + (k/x)^2)
tolerance: 0.5%

### How big is harmonic {k} at the output?

::: misses
- [4/(pi*k)] Include the filter's gain at that harmonic.
- [any] $\frac{4}{\pi k}\cdot\frac{1}{\sqrt{1 + (k f_0/f_c)^2}}$.
:::
:::

::: part
answer: -asin((k/x)/sqrt(1 + (k/x)^2))*180/pi
unit: °
tolerance: 0.5%

### What phase does the filter give it?

::: misses
- [any] $-\arctan(k f_0/f_c)$.
:::
:::
:::

::: check
kind: parts
given: w = 0.3 | 1 | 2

## $y[n] = \tfrac12(x[n] + x[n-1])$ at ω = {w} rad/sample.

::: part
answer: cos(w/2)
tolerance: 0.5%

### What is its gain?

::: misses
- [any] $\cos(\omega/2)$.
:::
:::

::: part
answer: -w/2*180/pi
unit: °
tolerance: 0.5%

### What is its phase?

::: misses
- [any] Half a sample of delay: $-\omega/2$.
:::
:::
:::

::: explain
## Why can't an LTI system create a frequency that isn't in its input?

::: model
Each complex exponential going into an LTI system comes out as the same exponential multiplied by a number, H at that frequency. A general input is a sum of exponentials, and linearity means the output is the sum of their individual outputs, so it contains exactly the input's frequencies, each scaled and phase-shifted, and nothing else. New frequencies, like harmonics from clipping or the sum and difference tones of a mixer, need a nonlinear or time-varying system.
:::
:::

::: practice

::: check
given: f = 500 | 2000; fc = 1000 | 4000
answer: 1/sqrt(1 + (f/fc)^2)
tolerance: 0.5%

## Gain of an RC low-pass with corner {fc} Hz at {f} Hz?

::: misses
- [any] $1/\sqrt{1 + (f/f_c)^2}$.
:::
:::

::: check
given: k = 3 | 9; A = 1 | 2
answer: 4*A/(pi*k)
tolerance: 0.5%

## Amplitude of harmonic {k} of a ±{A} square wave?

::: misses
- [any] $4A/(\pi k)$.
:::
:::

::: check
given: a = -0.5 | 0.2 | 0.4 | 0.6 | 0.8 | 0.9
answer: 1/(1 + a)
tolerance: 0.5%

## Gain of $h[n] = (\given{a})^nu[n]$ at ω = π?

::: misses
- [any] $1/(1 + a)$.
:::
:::
:::
