Discover what a nonlinear curve does to a sine, then move to music and aliasing.
01 · Understand
Ordinary gain multiplies every value by the same number. Saturation changes shape: different amplitude regions receive different changes. Peaks may grow less than quieter parts. This can alter timbre and create additional frequency components.
Here a curve maps input to output. Input is horizontal; output is vertical. A straight line through zero is constant gain; a changing slope is nonlinear. is gain before the curve. Start low with a sine. Compare at similar listening levels: louder does not by itself mean better. This memoryless model uses only the input at the current instant.
Terms within reach
Dotted terms offer a definition on hover, keyboard focus or tap. Click to keep it open; Escape or an outside click closes it. All definitions are also available here.
drive
Gain feeding the nonlinear curve. Increasing it can reach other parts of the curve and change distortion.
Delta
The difference between processed and original signals. It includes gain changes in existing components, not only new components.
oversampling
Processing at a higher sample rate with filtering when changing rates. It can reduce aliasing; filter quality still matters.
02 · Play & discover
Choose sine 220, tanh, zero bias and full mix. Raise drive, then add bias. Watch odd and even components.
Predict → change one control → compare → explain the result.
Experiment 01
Compare a sine and loop with identical settings. Curve and loop plots show the static operation; DC filtering and additionally affect audio.
This analyses a unit sine through the static model, not the selected recording.
Harmonic growth vs drive - tanh
computed, not drawn
Experiment 03
Move pitch slowly and watch products fold into the audible band. This graph uses 48 kHz and ideal spectral filtering for oversampling; audio uses finite FIR filters at the device rate.
Aliasing - drag the pitch and watch the ghost
-
real harmonicsaliased ghostsfundamental
9th harmonic lands at-
Worst ghost-
Check your understanding
Does curve normalization guarantee equal perceived loudness?
Normalization is derived from the curve at input ±1, not from the recording or a loudness measurement.03 · Go deeper
An odd curve satisfies . With a half-wave-symmetric periodic input, its output has no DC or even harmonics. Biasing a sine usually breaks that symmetry and can generate both. Curve symmetry alone does not guarantee this for arbitrary inputs.
Above a positive clip level C, a parallel blend is . Linear slope is 1−m, but local dB slope is . Thus 50% mix is not a constant 2:1 compression ratio. The derivative still changes at the threshold; the knee is not smooth.
An x³ term applied to two sines generates products including 2f₁±f₂ and 2f₂±f₁. Some can coincide with harmonics for related frequencies. Linear EQ cannot generally invert nonlinear processing for arbitrary signals. Oversampling reduces aliasing, but finite filters and high generated frequencies prevent a guarantee of zero folded products.
The mathematics in words
Odd symmetry
f(−x) = −f(x)
Reversing input sign reverses output sign without changing its magnitude. With a half-wave-symmetric periodic input, this curve generates neither DC nor even harmonics.
Mixing above a positive clip threshold
y = (1−m)x + mC
x is the dry input, C the clip threshold and m the wet fraction from 0 to 1. Above the threshold the wet component stays at C while dry input keeps changing. Thus a 50% blend is not a constant 2:1 compression ratio in dB.
Local dB slope in a clipping blend
(1−m)x/y
Above the positive clip threshold, multiply dry fraction 1−m by input/output ratio x/y. This is the local slope of output dB against input dB. It varies with x and therefore does not give a fixed compression ratio. x and y are positive.
Third-order intermodulation products
2f₁±f₂; 2f₂±f₁
Double one frequency, then add or subtract the other. A cubic processing term can generate these products from two sines. For 100 and 150 Hz, the first expression gives 50 and 350 Hz. Products can coincide with other components.
Numerical challenge: try before revealing the solution
01 · For a 50% dry/50% hard-clipped blend above positive threshold C, y = 0.5x + 0.5C. At x = 2C, what is the local input-dB/output-dB compression ratio?
Hint
Local output-dB/input-dB slope is (x/y)·dy/dx. Take its reciprocal.
Solution & assumptions
y = 1.5C and dy/dx = 0.5, so the dB slope is (2C/1.5C) × 0.5 = 2/3. The local ratio is 3/2 = 1.5:1. As x grows far above C, the local ratio approaches 1:1; this is not a fixed 2:1 compressor.
02 · An unfiltered nonlinear process generates a component at 29 kHz in a 48 kHz system. At which positive frequency does that component alias?
Hint
For this frequency, reflect around Nyquist: fs − f.
Solution & assumptions
48 − 29 = 19 kHz. For arbitrary generated frequencies use the nearest equivalent frequency in [0, fs/2], not a single subtraction in every case. Oversampling needs filtering before returning to the base sample rate.