# Phase Fold

Wave · y = f(x, t)

`y = sin(x + sin(2x + t)) · cos(t · 0.3 + x · 0.5)`

[Open in the app](https://www.wavelace.com/app#p=9) · [This page](https://www.wavelace.com/presets/phase-fold)

### What it draws

Three sines are stacked here: one inside another, and that pair times a third. The outer `sin(x + …)` is a carrier of wavenumber 1, with crests `2π ≈ 6.28` apart, and it holds no `t` of its own, so alone it would stand still.

The inner `sin(2x + t)` is added to its phase. It swings the carrier back and forth by up to one radian, and lines of constant phase satisfy `2x + t = constant`, so that swing drifts left at `1/2 = 0.5` units per second at `Speed` 1. The final factor `cos(0.3t + 0.5x)` is a slow envelope. Its zeros are `π/0.5 ≈ 6.28` apart, two of them across `±6`, and they slide left at `0.3/0.5 = 0.6` units per second, pinching the curve flat as they pass.

### Why it folds

Differentiate the phase of the outer sine and the local wavenumber falls out: `1 + 2·cos(2x + t)`, a number that runs between `−1` and `3`. Where it is large the crests bunch up. Where `cos(2x + t) < −0.5`, which is a third of the axis at any instant, it is negative and the phase runs backwards. That is the fold: a crest and a trough are created together, drift apart, and are swallowed again a moment later.

This is frequency modulation, the trick of an FM radio carrier, and the Jacobi–Anger expansion names the parts. The modulated sine is a sum of plain waves of wavenumber `1 + 2n` weighted by Bessel values, `J₀(1) ≈ 0.765` on the carrier and `J₁(1) ≈ 0.440` on its first pair of sidebands.

### Not chaos

Nothing here is sensitive to its starting conditions, because there are none: the height at a point is a formula in `x` and `t`. The two clock rates, `1` and `0.3`, stand in the ratio `10:3`, so the picture repeats exactly every `20π ≈ 62.8` seconds. It looks unruly only because three rhythms of similar size lie over one another.

### Try

- Take the modulation out: `sin(x)·cos(t·0.3 + x·0.5)` is a still carrier under the same drifting envelope.
- Put it back at half strength, `sin(x + 0.4·sin(2x + t))·cos(t·0.3 + x·0.5)`: the local wavenumber is now `1 + 0.8·cos(2x + t)`, never negative, so the wave breathes but never folds.
- Then overdo it, `sin(x + 3·sin(2x + t))·cos(t·0.3 + x·0.5)`: the wavenumber ranges from `−5` to `7` and the folds crowd together.
- `Top` in the deck: seen from above, each fold shows as a fork running back through the ribbon.

### Read more

- [Frequency modulation](https://en.wikipedia.org/wiki/Frequency_modulation)
- [Jacobi–Anger expansion](https://en.wikipedia.org/wiki/Jacobi%E2%80%93Anger_expansion)
- [Bessel function](https://en.wikipedia.org/wiki/Bessel_function)
- [Instantaneous phase and frequency](https://en.wikipedia.org/wiki/Instantaneous_phase_and_frequency)
