Here is a lopsided signal. Switch View between Original and Split it, and watch two tidier parts add back up to it.
Splitting a signal in half
Split the signal into a mirror half and a flip half, and watch them add back to the original.
Describe this picture
Plots against sample number, and two “View” buttons; it starts on Split it. Original shows one lopsided trace , with a small early bump, a sharp spike just after the origin and a slow fade, not a mirror image of itself about . Split it stacks three panels: the “even part ”, its own mirror image about ; the “odd part ”, a flipped mirror image; and the “sum ”, drawn over the faint original.
Taking a signal apart
So far I’ve been building new signals: shifting and scaling one, adding two together, capping the peaks off a third. Here I turn that around. Given one signal, can I break it down into simpler pieces that add back up to it exactly?
This page shows four ways to do this, and each is useful later for a different reason. The pieces can mirror each other. They can be silent except at a single instant. They can switch on and stay on. Or they can be smooth, endlessly repeating waves.
Splitting into a mirror half and a flip half
Picture a lopsided signal: a sharp rise, then a slow fade that doesn’t match the rise at all. In Kinds of signals (1.2), I picked a moment and called it the origin, then asked whether folding the trace in half at that origin landed the two halves on top of each other (an even signal) or as exact opposites (an odd signal). Almost nothing in real life is purely one or the other. But here is the useful fact: any signal, however lopsided, is the sum of an even part and an odd part, and adding those two parts back together reproduces the original exactly.
The even part is built by averaging the signal with its own mirror image, and the odd part by averaging the signal with the negative of its mirror image:
Here is the signal’s value at sample , is its value at the mirror sample on the other side of the origin, is the even part, and is the odd part. Add them and the terms cancel, leaving .
Go back to the lopsided signal at the top of the page and choose Split it. Notice the even part is its own mirror image about , and the odd part is a flipped mirror image. The bottom panel draws the two parts added sample by sample, and it lands on the faint original at every sample.
In Complex numbers for signals (3.3) you’ll meet signals that carry two numbers at every instant instead of one, and they also split into two matching parts.
Rebuilding from spikes
An hourly rainfall log is really a stack of single-hour bars: each bar reports how much rain fell during its own hour and says nothing about any other hour. Stack all the bars up, one per hour, and you’ve rebuilt the whole day’s log.
A discrete signal can be rebuilt the same way, from spikes: a piece that has one sample’s own height at its own instant, and is exactly zero everywhere else. Add one spike per sample, each scaled to that sample’s height and placed at that sample’s instant, and the sum reproduces the whole sequence.
Here is the sequence’s value at sample , and is a spike that equals at and at every other . Scaling that spike by and adding one such term for every rebuilds exactly. (This spike gets a formal name, the unit impulse, in Impulse, step and ramp (3.1).)
Drag Pieces built up to its maximum, one step at a time, and watch the sum grow toward the target.
Rebuilding from spikes
Each spike is that one sample's own height, and silent everywhere else. Step through to add them one at a time.
Describe this picture
Two panels against sample number. The top one, “one spike”, shows the spike just added, and the readout “Spike just added” gives its height. The bottom one, “sum so far”, shows the sum of the spikes so far over the faint target . The “Pieces built” slider adds the spikes one at a time, from none to one per sample.
Once every sample has its spike added in, the overlay lands on the target sequence, point for point.
Rebuilding from switches
Now picture a machine that reports a gear number, one integer per second. It doesn’t relabel every past second when the gear changes. It changes at the instant of the shift and holds that new number afterward, until the next shift. You could rebuild the whole gear-number trace from a handful of “shift by this much, starting here” events, one per gear change.
That’s a switch: a piece that turns on at one instant and stays on at every instant after that. Unlike a spike, a switch keeps contributing at every later sample too, so the size you add at each instant can’t be the sample’s own value; it has to be the change since the instant before, the first difference from Operations on amplitude (2.2).
Here is the first difference at sample , and is a switch that equals before and from on. (Like the spike, this switch gets a formal name, the unit step, in Impulse, step and ramp (3.1).)
Drag Pieces built up one step at a time, and read the size of each switch as it goes in.
Rebuilding from switches
Each switch turns on at one sample and stays on after that, sized by the change from the sample before it.
Describe this picture
Two panels against sample number. The top one, “one switch”, draws the switch just added, on from its sample onward, and the readout “Switch just added” gives its size. The bottom one, “sum so far”, shows the sum of the switches so far over the faint target , the same sequence as before. The “Pieces built” slider opens at 3 pieces.
The sum again reaches the target once every switch is in. But the sizes it needed were the first differences, not the sample values, because each switch keeps adding in at every later sample.
Rebuilding from pure tones
A buzzy, square-ish wave sounds harsh because it isn’t smooth: it jumps sharply between two levels instead of curving between them. You can get close to that sharp shape by adding together a handful of smooth, endlessly repeating waves, called pure tones, each at a different pitch and size.
Here is where the pitches come from, in plain words before any notation. If the target shape repeats once per second, the first tone does too. The second tone repeats twice per second, the third three times, and so on. These repeat rates (one times, two times, three times the target’s own repeat rate) are called harmonics. Add enough of them together, each scaled correctly, and the sharp-cornered target shape starts to emerge from the sum of smooth curves.
The square-ish wave below needs only the odd harmonics (1×, 3×, 5×, 7× its repeat rate). This shape has no even harmonics (their sizes are zero), so the instrument skips them and each step adds the next odd one.
Each tone brings two settings: how big it is and how fast it repeats (its harmonic). All of them start together at zero, which suits this shape. Sinusoids (3.2) gives these smooth waves their proper name and notation. For now, notice that summing more of them brings the sum closer to the target shape without your ever having to go back and change the tones already added. This is a preview. Signals as sums of sinusoids (7.1) tells you which sizes to use.
Drag Harmonics from “just the 1st” up to “up to the 7th” and watch the sum close in on the target.
Rebuilding from pure tones
Adding a few smooth waves together can approximate a sharper repeating shape.
The root-mean-square difference between the sum and the target, over one repeat.
Describe this picture
Two panels against time from 0 to 2 s. The upper one draws the tones added so far, labelled “1× tone”, “3× tone”, “5× tone” and “7× tone”, all starting together at zero; the newest is drawn at full strength and the older ones faded. The lower one shows the sum of the tones over the faint “target (repeats every 1 s)”, so you see two repeats of the target. The “Harmonics” slider runs from “just the 1st” to “up to the 7th” and starts at “up to the 3rd”. A readout shows “Gap from the target”.
Watch Gap from the target too: the root-mean-square size (see How big is a signal (1.3)) of the difference between the sum and the target, over one repeat. With one tone the sum is a smooth, rounded wave, and each additional harmonic moves the sum closer to the sharper target shape, shrinking the gap readout as it goes.
The maths behind it · bases
If you list a signal’s samples as one long column of numbers, rebuilding it from spikes is the same as writing that column as “this much of the first sample, plus this much of the second, and so on”. Linear algebra calls those building blocks a basis, and starts from exactly this idea.
Worked example
Take the sequence for (zero elsewhere), folded about the origin .
Even and odd parts. gives for , and gives . Check: , which is again.
Now take a second sequence, for (zero elsewhere).
Sum of spikes. , where is at and elsewhere.
Sum of switches. With , the first differences are for (the last one because the signal falls back to : ), so . Check at : , which matches . Check at : , which matches .
Where you’ll meet this
The even/odd split is a shortcut you’ll use whenever a problem has a mirror symmetry in it.
Writing a signal as a sum of spikes is the idea behind how a certain kind of system responds to every input (The impulse response (5.1)): know the response to a single spike, and you know the response to everything. Writing a signal as a sum of switches shows up wherever something moves in sudden steps and holds, like a thermostat setting or a motor told to move to a new position and stay there. And building a shape from a handful of tones is a first look at what a synthesizer does.
Reference card
| Decomposition | Formula | Notes |
|---|---|---|
| Even / odd parts | , , | even mirrors; odd mirrors and flips sign |
| Sum of spikes | : at , elsewhere (the unit impulse, Impulse, step and ramp (3.1)) | |
| Sum of switches | , | : before , from on (the unit step, Impulse, step and ramp (3.1)); is the first difference |
| Sum of pure tones | smooth repeating waves at 1×, 2×, 3× … the repeat rate | more harmonics → closer match; explained in Signals as sums of sinusoids (7.1) |