Sonic Labs Technical Note — No. 001

The Intuition-First Guide to Digital Frequency, Sampling, and the FFT

A conversation-driven refresher for engineers re-learning DSP

SonicLabs.co.za · August 2026

1. Digital Frequency: How Much of the Signal's Cycle Did We Miss — And Why Should We Care?

Digital frequency is the fractional travel a signal makes in-between sampling instants (i.e. phase advance or phase stride), expressed as a fraction of its wavelength (360°).

Picture this: While we were not looking — while the sampler was off doing something else — the analogue signal kept moving. When the ADC finally returns for its next sample, the signal has advanced by some slice of its own full cycle. That slice, that fraction, is the digital frequency.

Your running example: a 10 kHz tone sampled at 100 kHz. The signal's period is 100 µs; the sampler (ADC) pays our signal a visit every 10 µs to take sample. Each sample catches the sine one-tenth of a cycle further down as measured from the most recent sampling instant. The digital frequency is therefore 0.1 cycles per sample — or 36° per sample, or π/5 radians per sample. Same thing, different clothes. It takes the instrument or engineer 10% of the complete signal cycle to come back for another measurement - we don't care what the signal's frequency is, all we know is every 10% of it's cycle we are back measuring, again and again until our buffer is full

At Sonic Labs, wherever/whenever possible, we try build the intuition (the feel), before we compress all that in math. The formula, derived from intuition rather than decreed from above:

Tsampler / Tsignal = (1/fs) / (1/f0) = f0 / fs

This ratio quantifies, or signals to us, how tightly we are tracking the signal's transitions.

The Sonic Labs framing: "The lazier the sampler, the wider the digital frequency - the sampler is too casual, giving the signal more time to advance inbetween the sparsely positioned sampling instant. The more rapid the sampler, the tighter the visits back to the signal to sample it— you're basically stalking the signal - giving it little chance to move significantly before you sample it again and again."
Sampler "laziness" fs Digital freq What it looks like
Lazy (barely Nyquist) 20 kHz 0.5 Hop 180° every sample — bounce between two points
Moderate (your plot) 100 kHz 0.1 Hop 36° every sample — 10 hops to complete the circle
Greedy (oversampling) 1 MHz 0.01 Hop 3.6° — barely any advance, stalking the signal

2. The Unit Circle as the Stage

Here is the central insight: the sine wave is merely the shadow of a dot traveling around a circle. The circle is the true signal. The sine wave is the side-view projection. The angle at any instant is the phase.

Sampling as strobe photography

Your ADC is a strobe light flashing at f_s. Every flash freezes the dot at some angle. You write down the shadow height (the sample value) and wait for the next flash.

What the angle means

When we say "the signal advanced 36° since the last sample," we are literally saying "the dot hopped one-tenth of the way around the circle."

Why the unit circle specifically?

Any circle would do, but radius = 1 makes the shadow heights exactly your sine and cosine values. The complex exponential e^(jθ) is that dot on the unit circle. Euler simply gave us a way to carry both shadows in one number.

3. The FFT: How Many Hops to Get Back Home?

The FFT's fundamental question: "How many complete signal laps did the sampler acquire inside my N-sample window?"

From Section 1, the digital frequency of our 10 kHz signal sampled at 100 kHz is 0.1 cycles per sample — the signal advances one-tenth of a lap between each visit from the sampler. Across N samples, the total laps accumulated are:

Total signal laps in window = (digital frequency) × N = 0.1 × N

If that product has a fractional part, the signal does not land cleanly on an FFT bin. The last sample catches the signal mid-lap, and when the record wraps around to repeat, there is a jump — a discontinuity the FFT reads as extra frequency content. That is leakage.

FFT bin k asks: "Does this signal contain exactly k complete cycles?"

For N = 1000: 100 complete cycles → bin 100 is hot → that is your 10 kHz tone.

For N = 1024: 102.4 cycles → not an integer → energy smears across bins 102 and 103. That is leakage — your signal did not fit neatly into the record.

The Sonic Labs framing: "The FFT carries a bag of tuning forks spaced fs/N apart. It holds each one up to your signal and asks, 'Do you sing my note?' When your signal matches one of these forks exactly, it sings back loud and clear. When it's off-pitch, a few neighboring forks rattle instead."

4. Coherent Sampling: The Integer Cycle Condition

Definition: the signal completes an integer number of full cycles inside your sample record.

fsignal / fs = M / N

where M = integer number of cycles and N = total samples.

This is not "fs is an integer multiple of fsignal." That is a special case, not the definition.

Your example (the easy case)

f0 = 10 kHz, fs = 100 kHz, N = 1000. M = 100 complete cycles → coherent → clean spike at bin 100. Here fs = 10 × f0, so the integer-multiple condition happens to hold.

Counterexample (where the "integer multiple" definition breaks)

f0 = 10 kHz, N = 1024 (a power of two, which FFTs love). For M = 100 cycles:

fs = (10,000 × 1024) / 100 = 102,400 Hz

fs = 102.4 kHz — not an integer multiple of 10 kHz. Yet it is perfectly coherent: 100 complete cycles in 1024 samples. The FFT sees a seamless loop and gives a clean spike.

The Sonic Labs framing: "Coherent sampling isn't about the strobe rate being a neat multiple of the car's lap time. It's about the car crossing the finish line exactly as you close your photo album."

5. Hardware Efficiency: Don't Let Your ADC Run Laps on the Same Tarmac

Here is the hardware engineer's gut punch, straight from the math above:

The denominator of your reduced digital-frequency fraction is your unique phase budget. That is how many distinct angles around the unit circle your sampler will ever see. Everything beyond that is a repeat — same phase, same information, wasted memory.

Digital frequency = M / Nreduced  ⇒  Nreduced unique phases
Digital freq Reduced fraction Unique phases Hardware reality
0.1 1 / 10 10 Buffer of 1000 = 990 wasted slots (same 10 angles, 100× over)
0.5 1 / 2 2 Buffer of 1024 = 1022 wasted slots
0.25 1 / 4 4 Buffer of 1024 = 1020 wasted slots
0.09765625 25 / 256 256 Buffer of 1024 = each phase repeated 4×

The engineering trade-off

You have three levers:

  1. Pick fs so the fraction is "tight" (small denominator) → tiny buffer, all unique phases, cheap hardware.
  2. Pick N equal to the denominator → minimal buffer for full phase coverage, then stop. Go to the beer garden.
  3. Overspend on buffer → redundant phase samples, but you buy finer FFT bins (frequency resolution).

The FFT wants N samples to give you N/2 frequency bins. But the signal itself only needs denominator-many unique phases to be fully characterised. Everything else is the tax you pay for spectral resolution.

The Sonic Labs framing: "Don't let your ADC run laps around the same patch of tarmac. If the signal's phase map repeats after 10 samples, kill the buffer at 10. Or accept that you're buying frequency resolution with redundant hardware."

6. Windowing: The Hann Window

Why window?

The FFT assumes your N-sample record repeats forever. If you cut off mid-cycle, the join between end and beginning is a sharp discontinuity. The FFT sees that as high-frequency junk — sidelobes.

What the Hann window does

Gentle fade-in and fade-out at the edges. It forces the signal to zero at the boundaries, so when the record repeats, there is no discontinuity.

The trade-off

Fading the edges throws away some information → broader peak (wider main lobe). But you kill the sharp discontinuity → sidelobes drop way down.

Your plot, re-read

Hann window properties

Property Hann Rectangular (for contrast)
Coherent gain ≈ 0.5 1.0
First sidelobe ≈ −31 dB ≈ −13 dB
Main lobe width ≈ 2× rectangular Baseline

Magnitude scaling to recover true amplitude

A = (4 × |X[k]|) / N

The factor of 4 comes from: 2 for the energy split between positive and negative frequencies, and 2 for the Hann window's 0.5 coherent gain.

7. Nyquist: The Cliff Edge, Not the Design Target

The theorem: fs > 2 × fmax (strictly greater than).

Why sample a 10 kHz signal at 100 kHz? You are oversampling (5×). The practical reasons:

Reason What it buys you
Anti-aliasing filter A gentle, cheap analog filter instead of an impossible brick-wall
Processing gain / SNR ~3 dB SNR improvement per octave of oversampling
Time resolution 10 µs vs. 50 µs at bare Nyquist
Spectral leakage mitigation More samples = finer bins = easier coherent sampling
The mental model: Nyquist is the cliff edge. You sample at 100 kHz so you can stand way back from the edge with a cheap filter, not teeter on the edge with an expensive one.

About that 90 kHz image

For a real-valued signal, sampling creates spectral replicas (images) at every integer multiple of fs. The negative frequency at −10 kHz gets shifted up by fs and lands at 90 kHz. Had you sampled at 20 kHz, that image would appear at 10 kHz — right on top of your signal.

8. The Two-Sided Spectrum

Your plot shows 0 → fs (all N bins). This makes the conjugate symmetry obvious:

For a single-sided spectrum (0 → fs/2):

9. The Dot Product — Our Secret to Visualizing Sampled Data Spectral Analysis

Imagine two side-by-side discs rotating at different speeds. There will be relative motion between them. As the two disc speeds approach each other, the relative motion will decrease until it's zero when they are synchronized — think your clutch/flywheel scenario as you take off in your spirited GTi. Imagine we now draw a radial line on each disc. At lockup, the angle those lines subtend is constant — ideally zero. This is the mechanical analog of the phasor alignment the DFT hunts for to tell if the signal does have a component at that frequency.

The mechanical picture

Your signal is Disc A, spinning at its own rate. The FFT's reference tone for bin k is Disc B, spinning at frequency k · fs/N. The DFT places them side by side and asks: "Do these two spin at the same rate?"

The clutch engagement

As you release the clutch, engine speed and wheel speed converge. The shudder you feel is beating — the periodic reinforcement and cancellation as the two speeds slip past each other. In spectral terms, this is leakage: two close frequencies creating an interference pattern. At lockup, the relative phase is frozen. The vibration stops. The DFT sees a single, clean spike.

The mathematical lockup

The DFT is a bank of dot products. For each bin k:

X[k] = Σn=0N−1 x[n] · e−j2πkn/N

The result is a complex number. Its magnitude tells you how much of frequency k is present. Its angle tells you the phase offset between signal and reference at lockup.

Why orthogonality matters

When the signal and reference frequencies are different, the product x[n] · e−j2πkn/N traces a closed polygon in the complex plane. The vector sum closes on itself → net zero. This is the orthogonality of the DFT basis: distinct frequencies are geometrically perpendicular in N-dimensional complex space.

When frequencies match, the product traces a straight line in the same direction → the vectors stack head-to-tail → maximum length.

The signal has a phase-advance rate. Each DFT bin sends a chaser through the same samples at a particular phase-advance rate. The bin that stays in step with the signal's phase advance accumulates coherently.

The Two Equations Behind the FFT

The radix-2 FFT begins by separating the DFT into contributions from the even-indexed and odd-indexed samples.

Equation
X[k] = E[k] + WNk O[k]

For the first half of the frequency bins, the frequency hunter combines the contribution from the even samples with the phase-rotated contribution from the odd samples.

Sonic Labs interpretation:
The hunter has already accumulated the even throws and the odd throws separately. It now rotates the odd pile by the required phase and adds the two piles at the frequency destination.
Equation
X[k + N/2] = E[k] - WNk O[k]

The corresponding second-half frequency bin uses exactly the same even and odd intermediate results, but the odd contribution arrives with a 180° phase reversal.

Sonic Labs interpretation:
Same two piles. Same back-thrower. But the second destination sees the odd pile after a 180° reversal — so the summer becomes a subtraction.

Why the Pair Works

The key identity is:

WNk + N/2 = WNk WNN/2

Since

WNN/2 = e-jπ = -1

therefore:

WNk + N/2 = -WNk
THE SONIC LABS AHA:

We do not perform the throwing work twice.

The same intermediate even and odd accumulations feed two frequency destinations. One destination adds them; the other subtracts them.

That is the butterfly.
The Sonic Labs framing: "The DFT is not magic. It is simply a mechanic holding a strobe light to two discs, checking whether they lock up. If they do, he writes down how big the alignment is and what angle the timing marks sit at. That's your magnitude and phase."

The Hann window revisited

Remember the Hann window fades the edges to zero? In the gear picture, it's like gently engaging the clutch instead of dumping it. The abrupt edge discontinuity (rectangular window) is a violent clutch dump — high-frequency shudder everywhere. The Hann window smooths the engagement, letting the discs settle into lockup without the mechanical shock.