δδ[n]x[−3]0x[−2]0x[−1]1x[0]3x[1]2x[2]−1x[3]0x[4]01import numpy as np2n = np.arange(-1, 3)3x = np.array([1, 3, 2, -1])4E = np.sum(x**2) # 15n11111
-4-20246-10123nvaluex[n] AND ITS BUILDING BLOCKSx[n]δ[n]u[n]x[n − 2]-304812-1-0.500.51nvalueEXPONENTIAL AND SINUSOID0.8ⁿ·u[n]cos(πn/4)+ cos(7πt/4)
Coloured parts: what the current step is about; everything else rests in whiteBlocks: the impulse maker δ, eight memory cells holding x[n] for n = −3 to 4, and a Python code cardPlots: stem plots, one stem per whole nTokens carry values into and along the list; the pointer n walks itThe list x[n] = 1, 3, 2, −1 (n = −1 .. 2), the unit impulse and step, the delay x[n − 2], x[n] as a sum of impulses, 0.8ⁿ·u[n], cos(πn/4) and cos(7πn/4), and the energy E = 15. Python's x[-1] means "the last item" (here −1, which is the maths x[2]), not the maths x[−1]. Keep an index array n beside the values to avoid that trap.

Signals as lists

  1. A discrete-time signal x[n] is a list of numbers, one for each whole number n. Ours is x[−1] = 1, x[0] = 3, x[1] = 2, x[2] = −1, and 0 everywhere else. Note that n can be negative.

Two building blocks

Moving and building

Exponentials and sinusoids

Measuring and coding

The working

# step 1/11 · sequence

x[n] = a sequence: one number per whole n

n      ... −3  −2  −1   0   1   2   3   4 ...
x[n]   ...  0   0   1   3   2  −1   0   0 ...

n = 0 is just a chosen origin;
n = −1, −2 ... are as real as n = 1, 2

plot: one stem per n (a stem plot),
never a joined-up curve

The list 1, 3, 2, −1 is a made-up example; a = 0.8 and ω₀ = π/4 are chosen values. Every value, stem and sum in the figure is computed from this model. The memory row only has room for n = −3 to 4. The signals go on in both directions: u[n] stays 1 and 0.8ⁿ keeps shrinking past n = 4.