Keep only equally spaced values of the spectrum of , and they describe copies of , one every samples. Watch the copies close in as falls, until at they overlap and one period no longer reads 4, 3, 2, 1.
Fewer spectrum samples, closer copies
x = 4, 3, 2, 1 for n = 0 to 3. N samples of its spectrum describe x repeated every N samples.
N = 8: the eight spectrum samples describe x repeated every 8 samples, with 4 zeros between copies.
Describe this picture
Two stacked panels for at to 3. The upper strip is the spectrum: the size , from 0 to 11, against from 0 to , with the curve and filled dots on it. The lower panel is time, sample from to 15, with up the side. Each copy of is drawn as open-circle stems, and the copies , 0 and 1 are labelled. Their sum is drawn as filled-square stems. A hatched band labelled “overlap” marks every sample where two copies add, and a bracket labelled “one period” covers to . A key names the copies, their sum and the overlap, so nothing relies on colour.
The readouts are the number of spectrum samples and the gap between copies. The gap reads a number of samples while there are zeros between copies, “touching” when there are none, and “overlap of 1 sample” or more when copies share samples. The clip runs for 14 s. While the copies slide, the dots move to their new and the caption is blank; with reduced motion the clip steps instead.
At the start and the gap is 4 samples: copies every 8 samples, with 4 zeros between. At 4 s, and the gap is 2 samples. At 6.75 s, , the length of , and the copies touch; each period is still exactly 4, 3, 2, 1. At 14 s, and the copies overlap by 1 sample: the last sample, 1, lands on the first, 4, and one period reads 5, 3, 2, so cannot be read back. The caption calls this time-domain aliasing.
After the clip ends, a slider named “Spectrum samples N” on the time panel sets from 1 to 12: drag the end of the period, or use the arrow keys. Page Up and Page Down change by 4, and Home and End jump to 1 and 12. At other values of the caption reads, for example, “N = 2: copies every 2 samples, overlap of 2 samples.”
N numbers of a curve
The DTFT of The DTFT (12.2) is a curve: a value for every . A computer cannot hold a whole curve. It can hold numbers, so I keep equally spaced values of the curve and throw the rest away. The question for this page is what signal those numbers still describe.
The spacing between the values is . By Frequency in discrete time (12.1), frequencies apart are the same frequency, so one period of holds everything. I write the kept frequencies as
and the kept values as . The figure shows them for at , with .
The curve starts at 10, which is the sum , and falls to 2 at . The eight dots read 10, 7.25, 2.83, 2.72, 2, 2.72, 2.83 and 7.25. The dots at and match, because the size curve of a real signal is mirrored about .
What signal do N values describe?
I can rebuild a signal from the values. The DTFT (12.2) gets back with an integral of over one period. I replace that integral by an average over the kept points, and call the result :
Now put in the definition at and swap the order of the sums:
The bracket holds the whole answer. If is a multiple of , every term is , so the average is 1. If it is not, the terms are equally spaced points on the unit circle, some of them visited more than once. Equally spaced points on a circle add to 0, as in Complex numbers for signals (3.3), so the average is 0.
For and the eight points add to 0. For each term is 1 and the sum is 8, so the average is 1. Only the terms with , for whole numbers , survive:
So values of the spectrum describe repeated every samples, with the copies added where they overlap. Each term is delayed by , as in Shifting, reversing and scaling time (2.1). This is The sampling theorem (10.2) with time and frequency swapped. Sampling a signal in time put copies of its spectrum every in frequency. Sampling the spectrum puts copies of the signal every in time.
Fewer spectrum samples, closer copies
The picture at the top shows these copies for , at , 6, 4 and 3. Between copies it reads a gap of 4 samples, then 2, then none, then an overlap of 1 sample.
The gap follows from counting. The signal occupies 4 samples, to 3, and the next copy starts at . So between them there are samples of zero when is greater than 4. At the copies touch, and below 4 they share samples. At the sample lands on , and . This overlap is time-domain aliasing: samples of different copies add and cannot be separated again. A word written on a ring of paper too short for it does the same, because the end writes over the start.
After the clip ends, drag the end of the period, or use the arrow keys, to set any from 1 to 12.
The periods the instrument shows, one period of starting at , are:
Each one adds to 10, which is , the first of the kept values. Folding the samples of onto slots, as when puts and together, never changes their total.
The maths behind it · seasonal profiles
Folding a long record onto one period and adding, as does, is how a seasonal profile is built: years of monthly data are stacked onto 12 months. If the season is not really 12 months long, the folded profile smears, which is the same overlap you see here.
Keeping x intact
The rule is a count. The copies have room while is at least the length of , here 4. Then one period of is followed by zeros, and nothing is lost. For and the period is and zeros, and at it is alone. Below the length, the period no longer shows .
A signal of length therefore needs spectrum samples. A 1 s recording at 8 kHz has samples, so at least 8000 spectrum samples keep it intact.
N arrows: the discrete Fourier series
Now suppose is at least the length of , so one period of is itself. The signal repeats every samples, so it is a sum of arrows, as in Fourier series coefficients (7.2). The arrows are . Only of them are different: the arrow for turns more than the arrow for at sample , which is a whole number of turns, so it gives the same samples (Frequency in discrete time, 12.1). Taking is enough:
This is the discrete Fourier series of the period- signal , and the numbers are its coefficients. It is the series of 7.2 with the integral over a period replaced by a sum over samples. When is at least the length of , the coefficients are exactly the spectrum samples , because the only nonzero terms of the sum are to the end of . The DFT (13.2) gives these numbers their usual name.
The maths behind it · a basis of arrows
The arrow sequences are vectors of length , and every length- vector is a weighted sum of them. A set of vectors with that property is a basis. The DFT as a matrix (13.5) writes the weights as a matrix product.
Worked example
- The curve. For , is 10 at , 2.828 at and 2 at . The eight samples are 10, 7.2545, 2.8284, 2.7153, 2, 2.7153, 2.8284 and 7.2545, the same as
np.fft.fft(x, 8). - The periods. The one period of for is 4, 3, 2, 1, 0, 0, 0, 0. For it is 5, 3, 2, and for it is 6, 4. Each period adds to 10.
- Points on the circle. For and , . For it is 8.
- Practice. A 1 s recording at 8 kHz has 8000 samples, so at least 8000 spectrum samples keep it intact.
Where you’ll meet this
A computer that transforms a recording keeps spectrum values, and this page says what that choice means: the signal is treated as one period of a repeating signal. The DFT (13.2) names the values and puts them on a frequency axis in hertz. Circular vs linear convolution (13.4) uses the repeating picture to explain why the ends of a filtered block wrap around. Zero-padding and resolution (15.3) uses the rule the other way: it adds zeros to get more spectrum samples.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Spectrum samples | , , | spacing |
| What they describe | repeated every , copies added | |
| No time aliasing | length of | then one period is |
| Points on the circle | if divides , else 0 | 3.3 |
| Discrete Fourier series | arrows suffice | |
| DFS coefficients | equal to the spectrum samples when there is no aliasing | |
| The swap | sample in time: copies every ; sample in frequency: copies every | 10.2 and 13.1 |