DSP Toolbox · Page 41

Memoryless vs Stateful Nonlinearity

A waveshaper can bend every sample with a nonlinear function. But real analogue devices can also remember what just happened. Their response may depend on level, frequency, stored energy, feedback and previous samples.

MEMORYLESS: y[n] = f(x[n]) STATEFUL: y[n] = f(x[n], x[n−1], STATE ...)
Here comes an old friend: z⁻¹ / STORE. Nonlinearity gives us the bend. Memory gives the bend a history.

1. Same input value — must it always give the same output?

With a simple memoryless waveshaper, yes. If the input is +0.5, the function gives the same answer every time. A stateful system can give a different answer because its internal state has changed.

Model
14.0 dB
88%
58%

Transfer behaviour

Memoryless: one fixed input→output curve. Stateful: the path can differ depending on recent history.

Signal through time

Blue = input. Purple = processed output. Amber = internal state.

Input now—
Output now—
Stored state0.000
Ruley=f(x)

2. Watch the state build and recover

Use a burst rather than an endless sine. The signal excites the model, then stops. In the stateful version the internal condition does not necessarily vanish instantly.

Excitation
220 Hz
CURRENT SAMPLE ↓ NONLINEAR f(x) ───────────────→ OUTPUT ↑ │ STORED STATE ↑ z⁻¹ ↑ previous behaviour

This is deliberately a simplified teaching model, not a circuit model of any particular valve, transformer or tape machine. The point is the architecture: the present can depend on the past.

A simple physical analogy

3. State can change while the signal is running

State does not have to mean “remember one old sample”. It can be a value that builds up and leaks away over time. Imagine a fictional component we call HEAT — or think of charge building and leaking away in a capacitor.

LOUD SIGNAL → state builds up QUIET / SILENCE → state gradually recovers new state = old state + what the signal does now − recovery

We can model that behaviour with numbers. The changing state can then alter another part of the processor:

AUDIO
→
MEASURE
→
DYNAMIC STATE
“HEAT”
→
CHANGE
DRIVE / BIAS / FILTER
The physical thing and the mathematical model are not the same object. But if we understand how the physical behaviour evolves, we can design equations and stored state that reproduce useful aspects of that behaviour.

This is already familiar: an envelope follower is a dynamic state. Its value rises and falls according to the recent signal, and we use that changing value to control something else.

4. Why a static waveshaper is not automatically “a valve”

Static waveshaper

x[n] → f(x) → y[n]

Fast, useful and capable of excellent saturation. The same instantaneous input produces the same instantaneous output.

Dynamic / stateful model

x[n] ─┬→ NONLINEARITY → y[n] └→ STORE / STATE ─┘

The response can change with recent signal history. Filters, feedback and other states can also sit around nonlinear elements.

Real analogue behaviour can involve many interacting effects: frequency response, nonlinear components, bias, feedback, stored energy, level-dependent behaviour, hysteresis and more. “Stateful” is a category, not one magic analogue algorithm.

Nonlinear does not mean irreversible

A nonlinear process changes the mathematical relationship between input and output, but that does not automatically mean information has been destroyed.

NONLINEAR ≠ LOSSY ≠ IRREVERSIBLE

Some nonlinear functions are still one-to-one, so every output value points back to one unique input value:

y = f(x) if f has an inverse: x = f⁻¹(y)

Hard clipping is different. Several different input values can collapse onto the same output value:

0.8 ─┐ 0.9 ─┼──→ 0.7 1.0 ─┘

Once that happens, the original value cannot be recovered uniquely.

So the important question is not simply “is it nonlinear?” but “does the transformation preserve enough information to be inverted?”

5. The toolbox comes back together

INPUT
→
FUNCTION
f(x)
→
OUTPUT
INPUT
→
FUNCTION
f(x,state)
→
OUTPUT
↖
z⁻¹
STORE

We have not invented a new universe. We have combined two primitives we already know:

FUNCTION + STORE = nonlinear behaviour with memory
Next question

6. How do we model a real device?

If a real amplifier, tape path or other processor is more complicated than one transfer curve, how might software reproduce it?

ONE IR → fixed linear response WAVESHAPER → nonlinear function CIRCUIT MODEL → components + filters + state + nonlinearities SYSTEM CAPTURE → probe a real device and infer its behaviour LEARNED MODEL → learn nonlinear temporal behaviour from examples
Next: modelling and capture — and why an ordinary impulse response cannot capture a level-dependent nonlinear device.