MATHEMATICS OF SOUND · AN INTERACTIVE EXAMPLE

Move the samples. Watch the estimate change.

The waveform stays fixed. Slide a 25-point measurement grid across one sample interval. Its smallest recorded value changes markedly, while its RMS stays the same.

Drag the slider or use the arrow keys. A full step returns to the same grid.

Sample minimum

−0.500000

Smallest of 25 values

Grid depth Kgrid

0.500000

−min(samples), without clamping

Sample RMS

2.449490

Numerical evaluation

Continuous depth reference

≈ 3.23010

Fixed numerical reference

At offset 0, the sample minimum is minus 0.5, grid depth is 0.5, and sample RMS is approximately 2.449490.

First four sample intervals

A closer look at the first negative trough

−40481200.040.080.120.16Common phase x / (2π)Amplitude

One complete period

All 25 sample points, wrapped around the period

−40481200.250.500.751Common phase x / (2π)Amplitude
Known analytic waveformCurrent sample valuesFixed witness at x = 3π/25

Exact RMS: √6, for every offset. The turquoise witness has value approximately −3.16836. It proves the waveform goes at least that low; the exact minimum is not asserted to occur at that point.

What is being measured?

We add twelve cosine waves with equal unit amplitudes and zero initial phases. The variable x is a common phase in radians; the horizontal axis displays x/(2π). Amplitudes are dimensionless.

f(x) = cos x + cos 2x + ⋯ + cos 12x xj = 2π(j + δ)/25,   j = 0,…,24

The displayed grid depth is exactly the operation −minj f(xj), evaluated numerically. It measures only the selected sample points.

Why does RMS stay fixed?

Squaring this degree-12 trigonometric polynomial produces frequencies no higher than 24. Every nonconstant term averages to zero on a 25-point evenly spaced grid, whatever its offset.

(1/25) ∑j=024 f(xj)² = 6

The grid therefore gives the exact mean square, although its smallest recorded value can miss the continuous minimum. These 25 samples also determine the whole polynomial: reconstruction followed by controlled minimization is a separate computation.

Formulas, numerical reference, and source

The identity 1 + 2f(x) = sin(25x/2)/sin(x/2) gives the unshifted grid values and the witness. At removable singularities, use the limit. The interactive code evaluates the twelve cosines directly, which also handles those points.

The continuous-depth reference K ≈ 3.230103875479012 was cross-checked using scalar minimization and by comparing the endpoints and all eleven real derivative roots of the polynomial ∑n=112 Tn(t) on −1 ≤ t ≤ 1, where t = cos x. One minimizing phase is approximately 0.35966509533 radians.

Decimal readouts and drawn curves use ordinary floating-point arithmetic. The reference is a numerical check, not an outward-rounded interval-arithmetic certificate. The RMS and root-of-unity identities are exact mathematical statements.

Source: the accompanying “Mathematics of Sound” exposition and mathematical appendix. This standalone file contains the full plotting and measurement code; it loads no external libraries, fonts, images, or data.

An exploratory mathematical illustration for the Bass Plus Mathematics of Sound article. No autoplay: each change follows your slider input.