Skip to content
OneKitly

Two Hertz and Six Hertz Leave Identical Samples

Published 12/4/2026 · 3 min read · Developer tools

Daniel Okonkwo

Daniel Okonkwo — Front-end developer and tech writer at OneKitly

Web performance · File formats

Checked against 2 sources

View profile →
In short

The eight samples 0, 1, 0, −1, 0, 1, 0, −1 taken at 8 Hz are exactly what a 2 Hz sine produces. They are also exactly what a 6 Hz sine produces once its sign is flipped — checked term by term, the two sequences agree to the last digit. The transform of those samples puts magnitude 4 in bin 2 and magnitude 4 in bin 6 and nothing anywhere else, which is the honest report: the data are consistent with both, and the sample rate contains no information that could separate them. Everything above half the sample rate folds back below it, so 6 Hz at 8 Hz sampling appears as 2 Hz, and a filter before the converter is the only thing that prevents it.

Advertisement

Sampled eight times a second, a 2 Hz sine and an inverted 6 Hz sine give the same eight numbers. The transform reports both bins at magnitude 4, and neither is wrong.

Why the fast transform is fast

The direct definition asks for a sum of N terms for each of N outputs, which is N² multiplications: 1 048 576 for a thousand-point signal and a trillion for a million-point one. Cooley and Tukey's method splits the sequence into its even and odd samples, transforms each half, and combines them, so the cost obeys T(N) = 2T(N/2) + N and lands at N log₂N — about 10 000 operations for a thousand points and twenty million for a million. That is the difference between a spectrogram that updates while you speak and one that does not, and it is why sizes that are powers of two are worth padding to.

The windowing option is not decoration

The transform assumes the block of samples repeats forever. When a signal's period does not divide the block length, the last sample does not join smoothly to the first, and that discontinuity spreads energy across every bin — the effect known as spectral leakage, which can bury a small nearby tone under the skirt of a large one. A window tapers the block to zero at both ends so the seam vanishes; the price is a slightly wider main lobe, meaning two close frequencies become harder to resolve. The eight samples here need no window at all, because 2 Hz fits exactly twice into the block and the seam is already smooth.

Eight samples at 8 Hz, transformed
BinFrequencyMagnitude
22 Hz4.0000
66 Hz, the mirror of 24.0000
0, 1, 3, 4, 5, 7everything else0
Nyquist limit4 Hzhalf the sample rate
Fast Fourier Transform (FFT) CalculatorRadix-2 Cooley–Tukey FFT of real or complex samples (3+4i, −2i): magnitude, phase, frequency bins and a bar plot, with Hann, Hamming and Blackman windows corrected for coherent gain and one-sided bins correctly doubled except DC and Nyquist.Try the tool →
Advertisement

Frequently asked questions

Why is the magnitude 4 rather than 1?
Because the unnormalised transform sums N terms without dividing by anything, and the energy of a real sine is split between its positive and negative frequency, so a unit-amplitude sine over N samples produces N/2 in each of two bins — here 8/2 = 4. Different libraries normalise differently: some divide by N on the forward pass, some by √N on both, some by nothing at all. Comparing a magnitude between two tools without checking the convention is the most common way a spectrum ends up off by a factor of N.
Is 44.1 kHz chosen because of this?
Partly. Half of 44 100 is 22 050, comfortably above the roughly 20 kHz upper limit of young hearing, and the margin exists so the anti-aliasing filter has room to roll off — a filter that had to fall from full response to nothing between 20 and 20.05 kHz would be unbuildable. The odd exact figure comes from elsewhere: early digital audio was stored on video tape, and 44 100 is what fits three samples per line into both the American and European video formats.

Articles you may find interesting

All guides →
ExplainerOver 111 Kilometres, the Curve and the Straight Line Differ by 1.4 MetresOne degree of latitude spans an arc of 111.195 km and a chord of 111.194 km. The Earth is big enough that a degree of it is almost flat.ExplainerBeing One Degree Off Costs You Nothing, Until It Costs You Everythingcos 1° = 0.99985, so a degree of misalignment loses 0.015 % of a force. At 89°, the same degree of error changes the answer by 100 %.ExplainerThe Twelfth Root of Two Is Why a Piano Is Slightly Out of Tune1.0594631 is the ratio between adjacent piano keys. Seven of them give 1.498307, not the 1.5 a perfect fifth wants — a deliberate compromise two cents wide.ExplainerThe Number 0.866 Turns Up Everywhere Hexagons DoAn equilateral triangle of side 1 stands 0.866 tall. The same figure sets the row spacing in a stack of oranges, the pitch of a hex grid and the sine of 60°.ExplainerSixty Thousand Divided by the Tempo, and Everything Else Is a FractionAt 120 BPM a quarter note lasts 500 ms, an eighth 250 and a dotted eighth 375. One division produces the whole table, and the dotted eighth is the one that changed how delay pedals are used.ExplainerFrame Rates, Timecode, and the Drop-Frame That Drops NothingFrames = duration × rate is trivial until the rate is 29.97. Non-drop timecode then drifts exactly 3.6 seconds an hour. Drop-frame corrects it by skipping 108 frame numbers — the same 108 — but the correction is not perfect: counting every frame shows a residual of 3.6 milliseconds per hour.

Related tools

Sources

Spotted a mistake in this article?