Periodicity and Waves
A periodic function repeats one shape forever, so a whole infinite wave is described by just three numbers: height, length of repeat, and shift.
Why Does This Exist?
Sound, light, seasons, heartbeats, and alternating current all repeat. Machine learning meets repetition in audio waveforms, seasonal demand, rotating machinery vibration, and the positional encodings that label word order with sinusoids. Treating each repetition as a new event would be endless; periodicity says one copy of the shape plus a repeat rule describes the entire infinite signal.
The payoff is compression of description. Three numbers, amplitude, period, and phase, pin down a pure wave completely, and sums of such waves describe everything else (the Fourier idea). This page teaches the vocabulary of repetition and the anatomy of a wave. The circular origin is in sine, cosine, tangent; the decomposition of complex signals continues in the Fourier transform.
The one idea you need first
A function is periodic with period if for every : shifting by changes nothing. Sine has period ( radians). The period is the length of one repeat, measured on the input axis.
Think of It Like This
A picket fence in fog
You stand before a long picket fence in fog, able to see only a few pickets. Every picket looks like its neighbours: same height, same spacing, same paint. Once you measure one picket and the gap to the next, you know the whole fence without walking it.
Amplitude is the picket height, period is the gap between matching edges, and phase is where you happen to be standing along the row. A wave with a dented picket is still fully described the same way, as long as every picket carries the same dent. The analogy stops at sums: real signals layer several fences at once, and separating them needs Fourier tools.
How It Actually Works
A pure wave with amplitude , period , and phase shift (phi) is:
In plain words: is the peak height above the middle line; is the input length of one full repeat; slides the whole shape left or right; is the input (time, angle, position). Frequency counts repeats per unit input, and angular frequency (omega) counts radians per unit. Higher frequency means shorter period: they are reciprocals, not synonyms.
Phase deserves care because it confuses: shifting by returns the identical wave, and a cosine is just a sine with . Phase matters only relative to another wave, where matching or opposing peaks decide interference.
Worked example
Take in degrees, so , , :
- Peak: , so . Next peak at , also 2.
- Zero crossings: , … where sine is 0.
- Trough: , so .
- Frequency: repeats per degree; angular frequency radians per degree.
Check the repeat rule: . The value at 450 degrees equals the value at 90, exactly as periodicity promises.
Watch Out For
Confusing period with frequency
Period is seconds per repeat, frequency is repeats per second, and swapping them inverts the answer: a 50 Hz hum has period 0.02 s, not 50 s. Code with the reciprocal mistake samples 2500x too slowly or generates a wave 2500x too fast.
Always carry the unit: write period_s or freq_hz in variable names, and quick-check with "more repeats per second means shorter repeats" before running anything long.
Ignoring phase when comparing two waves
Two identical waves shifted by half a period sum to zero, not to double. Averaging signals or adding a prediction to a seasonal baseline without aligning phase cancels the very pattern you wanted to keep.
Plot the sum, not just the parts, and check whether peaks line up. If cancellation appears where reinforcement was expected, the amplitudes were right and the phases disagreed.
The Quick Version
- Periodic means : one repeat describes the whole signal.
- Amplitude is the peak height, period is the repeat length, phase is the shift.
- Frequency and period are reciprocals; angular frequency is .
- peaks at 2 every 360 degrees with zeros at multiples of 180.
- Cosine is sine shifted by a quarter period, so phase is relative, not absolute.
- Name units on periods and frequencies, and align phases before adding waves.