Skip to content

Frequency in discrete time

See digital frequency as a turn per sample, why the frequency axis closes into a circle, and how to convert among its four common scales.

Before this10.2 · 5 more
Chapter 12 · Lesson 1 of 4

First, the picture

An arrow that turns by Ω\Omega each sample, marked once per sample. Watch the samples slow down again once Ω\Omega passes π\pi.

One turn per sample, on a wheel

Marks show where the arrow e^{jΩn} points at samples n = 0 to 7. The stems are their horizontal positions, cos(Ωn).

Ω = 0: the arrow does not turn. Every mark sits at 1, and every sample is 1.

Ω
0 rad/sample
same as, in (−π, π]
0 rad/sample
0.00 / 15.00 s
Describe this picture

Two panels. The first is a wheel, a unit circle with eight numbered dots that mark where the arrow ejΩne^{j\Omega n} points at samples n=0n=0 to 7, an arrow to dot 1, and an arc from dot 0 to dot 1 labelled Ω\Omega. When several marks sit on one spot, they share one label beside it, such as “0, 2, 4, 6”, or “0 to 7” when all eight meet. The second panel holds the stems x[n]=cos⁡(Ωn)x[n]=\cos(\Omega n), the horizontal positions of the dots. The readouts are Ω\Omega and the same frequency in (−π,π](-\pi,\pi].

The clip lasts 15 s and holds at five values of Ω\Omega, 0, 0.25π0.25\pi, π\pi, 1.5π1.5\pi and 2π2\pi, with a caption at each and none between. At 1.5π1.5\pi the second readout shows −0.50π-0.50\pi while the first shows 1.50π1.50\pi. When the clip ends, mark 1 becomes a handle: dragging it round the wheel, or the arrow keys, sets Ω\Omega from 0 to 2π2\pi, and the caption shows only at the five held values.

An arrow, looked at once per sample

Sinusoids (3.2) gave you the digital frequency Ω=2πf/fs\Omega=2\pi f/f_s in rad/sample, and showed that Ω\Omega and Ω+2π\Omega+2\pi give the same samples. Sampling & aliasing (10.1) used that to find where a tone lands in hertz. This page makes Ω\Omega an axis, and the axis turns out to be a circle.

Start from the arrow of Complex exponentials & phasors (3.4). Look at it once per sample, at n=0,1,2,…n=0,1,2,\dots:

ejΩn=cos⁡(Ωn)+jsin⁡(Ωn).e^{j\Omega n}=\cos(\Omega n)+j\sin(\Omega n).

Each sample number, the arrow has turned Ω\Omega further. Its horizontal position is the sample, x[n]=cos⁡(Ωn)x[n]=\cos(\Omega n), which is the reading you used in Fourier series coefficients (7.2). So Ω\Omega is not mysterious: it is the turn per sample, in radians.

One turn per sample, on a wheel

The picture at the top of the page draws this arrow on a wheel, once per sample. At Ω=0\Omega=0 the arrow does not turn: every mark sits at 1, and every sample is 1. At 0.25π0.25\pi rad/sample it turns an eighth of a turn per sample. Eight samples make one full turn, and the stems trace one cycle every 8 samples.

At π\pi it turns half a turn per sample. The marks alternate between 1 and −1, and so do the samples: nothing sampled can change faster. Watch the stems here. They flip between the top and the bottom of their range at every sample, which is the fastest a sequence can move.

Then Ω\Omega keeps growing, and the stems slow down again. At 1.5π1.5\pi, three quarters of a turn forward lands where a quarter turn back would. The samples are those of −0.5π-0.5\pi, and cos makes them the same as 0.5π0.5\pi. At 2π2\pi a whole turn per sample looks like no turn. Marks and samples are back where Ω=0\Omega=0 put them: the frequency axis is a circle.

A clock’s hand photographed once an hour makes the same point. Eleven hours forward looks like one hour back.

When the clip ends, mark 1 becomes a handle. Drag it round the wheel, or use the arrow keys, to set Ω\Omega from 0 to 2π2\pi. The angle keeps counting past π\pi, so you can follow the arrow all the way round. Try Ω=0.75π\Omega=0.75\pi and then 1.25π1.25\pi. Notice that the stems are identical, even though the marks are at mirrored places on the wheel.

Why the axis is a circle

Put the observation into symbols. Adding 2π2\pi to Ω\Omega adds a whole turn per sample, and a whole turn changes nothing:

ej(Ω+2π)n=ejΩn ej2πn=ejΩn,e^{j(\Omega+2\pi)n}=e^{j\Omega n}\,e^{j2\pi n}=e^{j\Omega n},

because ej2πn=1e^{j2\pi n}=1 for every whole nn. So Ω\Omega and Ω+2π\Omega+2\pi are one frequency. Move forward by 2π2\pi and you are where you began, which is what a circle does. I call the stretch from −π-\pi to π\pi the principal interval. It holds every distinct frequency once, half-open at the bottom: Ω∈(−π,π]\Omega\in(-\pi,\pi], the same convention as the angle of a complex number.

Why is π\pi the fastest? A forward turn of Ω\Omega between π\pi and 2π2\pi lands where a backward turn of 2π−Ω2\pi-\Omega, shorter than π\pi, would land. The largest turn that is not better described as a shorter one the other way is half a turn, Ω=π\Omega=\pi, where ejπn=(−1)ne^{j\pi n}=(-1)^n. At the other end, Ω=0\Omega=0 is no turn, so x[n]=1x[n]=1 for every nn. Low frequencies sit near 0 and high ones near ±π\pm\pi.

For the real signal cos⁡(Ωn)\cos(\Omega n) there is one more step. Cosine is even, so Ω\Omega and −Ω-\Omega give the same samples, which is why the 1.5π clip frame matches 0.5π.

Every function of Ω\Omega that is built from samples repeats every 2π2\pi, so a page draws one turn, (−π,π](-\pi,\pi], and that shows all of it. Here is the same fact in the terms of The sampling theorem (10.2). A shift by fsf_s hertz is a shift by 2π2\pi in Ω\Omega, since Ω=2πf/fs\Omega=2\pi f/f_s. The copies of a sampled spectrum, which sit every fsf_s in hertz, therefore sit every 2π2\pi in rad/sample.

k = 0k = ±1k = ±1−3π−2π−π0π2π3πthe part we draw: (−π, π]Ω (rad/sample)
Fig. 10.2’s copies, measured in rad/sample: the signal reaches 0.8π, and its copies sit every 2π. Every spectrum of samples repeats like this, so drawing −π to π shows all of it.

Four rulers for one frequency

A frequency has four names in common use, and only one of them needs the sample rate. You have two already: Ω\Omega in rad/sample, and ff in hertz. The other two are rescalings of Ω\Omega.

The first is cycles per sample, ν=Ω/2π=f/fs\nu=\Omega/2\pi=f/f_s. The fastest sequence turns half a cycle per sample, so ν\nu runs from 0 to 0.5. The second is the normalised frequency of SciPy and MATLAB, Ω/π=2f/fs\Omega/\pi=2f/f_s, which runs from 0 to 1 and puts 1 at the Nyquist frequency of 10.1. It is the same quantity as Ω\Omega written in units of π\pi rad/sample. Hertz needs fsf_s: f=Ωfs/2πf=\Omega f_s/2\pi.

The normalised scale is the one that trips people up. In SciPy, butter(4, 0.25) asks for a cutoff of 0.25π0.25\pi rad/sample, not 0.25 cycles per sample.

The next picture stacks the four scales, with one marker across them all. Watch which ruler changes when the sample rate does.

One frequency, four scales

Only the hertz ruler depends on the sample rate f_s.

0.25π rad/sample is 0.125 cycles per sample, 0.25 on SciPy's scale, and 1000 Hz when f_s = 8 kHz.

Ω
0.25π rad/sample
ν
0.125
normalised
0.250
f
1000 Hz
0.00 / 14.00 s
Describe this picture

Four stacked rulers, each with its own title: Ω\Omega in rad/sample, ν\nu in cycles/sample, the SciPy/MATLAB scale in units of π\pi rad/sample, and ff in Hz at fs=8f_s=8 kHz. A vertical marker with a downward triangle on top crosses all four. Four readouts name the same frequency as Ω\Omega, ν\nu, normalised and ff.

The clip is 14 s long, with a caption at each hold and none between. The marker holds at 0.25π0.25\pi, 0.5π0.5\pi and π\pi with fs=8f_s=8 kHz. Then it returns to 0.25π0.25\pi while fsf_s eases from 8 kHz to 48 kHz: the hertz labels and the hertz ruler’s title change in place, and the last caption reads “The same 0.25π rad/sample at f_s = 48 kHz is 6000 Hz. The first three scales did not move; only hertz needs f_s.” When the clip ends, the marker becomes a handle: dragging it, or the arrow keys, chooses a frequency from 0 to π\pi at fs=48f_s=48 kHz, and the caption stays blank except at 0.25π0.25\pi.

The clip begins with the marker at 0.25π0.25\pi and fs=8f_s=8 kHz: 0.125 cycles per sample, 0.25 on SciPy’s scale, and 1000 Hz. The marker then moves to 0.5π0.5\pi, a quarter cycle per sample, 0.5 on SciPy’s scale and 2000 Hz at 8 kHz. Then it moves to π\pi, the fastest: half a cycle per sample, 1 on SciPy’s scale, and fs/2=4000f_s/2=4000 Hz, the Nyquist frequency of 10.1.

Then the marker returns to 0.25π0.25\pi and fsf_s eases from 8 kHz to 48 kHz. Watch the rulers. The hertz labels and the hertz ruler’s title change in place, and nothing else moves: the same 0.25π0.25\pi rad/sample is now 6000 Hz.

When the clip ends, drag the marker, or use the arrow keys, to choose a frequency from 0 to π\pi at fs=48f_s=48 kHz.

In SciPy, freqz(b, a) returns Ω\Omega from 0 to π\pi, while freqz(b, a, fs=8000) returns hertz from 0 to 4000. Some analysers draw 0 to fsf_s instead, which is one full turn with the top half holding the negative frequencies. Check which one a plot uses before you read a number off it.

Worked example

  1. Concert A. 440 Hz at fs=8f_s=8 kHz: Ω=2π⋅440/8000=0.3456\Omega=2\pi\cdot440/8000=0.3456 rad/sample =0.110π=0.110\pi. Then ν=0.0550\nu=0.0550 and the normalised value is 0.110. Since ν=11/200\nu=11/200, the samples repeat every 200 samples, as 3.2 found.
  2. 1 kHz. At 8 kHz: Ω=0.25π=0.7854\Omega=0.25\pi=0.7854 rad/sample, ν=0.125\nu=0.125, normalised 0.25. At 48 kHz: Ω=0.1309\Omega=0.1309 rad/sample =0.0417π=0.0417\pi, ν=0.02083\nu=0.02083, normalised 0.04167. And 0.25π0.25\pi at 48 kHz is 6000 Hz.
  3. Past π\pi. 7 kHz at 8 kHz is Ω=1.75π\Omega=1.75\pi, the same samples as −0.25π-0.25\pi and, since cosine is even, as 0.25π0.25\pi: 1 kHz, the fold of 10.1.
  4. Samples. cos⁡(πn)=1,−1,1,−1,…\cos(\pi n)=1,-1,1,-1,\dots, and cos⁡(1.5πn)=cos⁡(0.5πn)=1,0,−1,0,…\cos(1.5\pi n)=\cos(0.5\pi n)=1,0,-1,0,\dots
  5. SciPy. butter(4, 0.25) and butter(4, 1000, fs=8000) return identical coefficients.
  6. Copies. The signal of 10.2, reaching 4 kHz, sampled at fs=10f_s=10 kHz reaches 2π⋅4/10=0.8π2\pi\cdot4/10=0.8\pi, with copies centred at ±2π\pm2\pi.

Where you’ll meet this

Every spectrum in the next chapters is drawn against Ω\Omega on (−π,π](-\pi,\pi]. The DTFT (12.2) builds the spectrum of a sequence on this axis. The DFT (13.2) samples it at 2πk/N2\pi k/N. Filter specifications (18.1) give cutoffs in the normalised scale, so the 0.25π0.25\pi trap above comes back there.

The maths behind it · rotation matrices

Turning a point by Ω\Omega is multiplying it by a 2×2 rotation matrix. Doing it nn times is the matrix to the power nn, a turn by nΩn\Omega. A turn by Ω+2π\Omega+2\pi is the same matrix, which is the wheel’s whole story.

The maths behind it · circular statistics

Data on a circle, such as wind directions or times of day, need circular statistics: the average of 359° and 1° is 0°, not 180°. Digital frequency is circular data.

Reference card

QuantityFormulaNotes
Digital frequencyΩ=ωTs=2πf/fs\Omega=\omega T_s=2\pi f/f_srad/sample (3.2)
One arrow per sampleejΩne^{j\Omega n}; x[n]=cos⁡(Ωn)x[n]=\cos(\Omega n) is its horizontal positionturns Ω\Omega each sample
Same samplesΩ\Omega and Ω+2πm\Omega+2\pi m, mm wholethe axis is a circle
Principal intervalΩ∈(−π,π]\Omega\in(-\pi,\pi]half-open at the bottom
Slowest, fastestΩ=0\Omega=0: constant; Ω=π\Omega=\pi: x[n]=(−1)nx[n]=(-1)^nhigh frequencies sit near ±π\pm\pi
Cycles per sampleν=Ω/2π=f/fs\nu=\Omega/2\pi=f/f_sfastest 0.5
SciPy/MATLAB normalisedΩ/π=2f/fs\Omega/\pi=2f/f_s1 is Nyquist; with fs= SciPy uses hertz
Hertzf=Ωfs/2πf=\Omega f_s/2\pithe only scale that needs fsf_s
Spectra of samplesrepeat every 2π2\pi in Ω\Omegaevery fsf_s in hertz (10.2)

End of lesson 12.1

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look