A Journey To Shepard Tones
[Blog #4.2]
Close your eyes and imagine climbing a staircase that never ends. Each step takes you higher, yet somehow you never reach the top. You are ascending, perpetually, impossibly. This is not a dream, nor is it architecture, it is sound.
Let us begin by listening carefully to the following short piece composed by Hans Zimmer for the film Dunkirk. The piece carries a peculiar perceptual tension. As the sound unfolds, you can feel an uncanny sensation: the pitch appears to be rising continuously, without ever reaching a peak.
The sound seems to go upward forever without arrival of any climax. This experience is not accidental, nor is it a trick of imagination. It is a carefully constructed auditory illusion.
The effect you are hearing is known as the Shepard–Risset Glissando, a phenomenon that exploits the way the human brain interprets pitch and continuity.
What Is a Shepard Tone?
A Shepard tone is an auditory illusion in which a sequence of tones creates the impression of a pitch that endlessly ascends or descends. In reality, the sound never truly becomes higher or lower. Instead, multiple tones spaced an octave apart fade in and out in a precise pattern, convincing the auditory system that motion is occurring where none exists.
The Shepard–Risset Glissando
The Shepard–Risset Glissando extends this idea further. Rather than using discrete steps, it produces a smooth and continuous slide in pitch. The result is a seamless glissando (from Italian/French for "to slide") that appears infinite, a sonic staircase with no first step and no last.
What makes this illusion especially powerful is its psychological effect. The ear hears movement; the mind anticipates resolution. Yet resolution never arrives. In Dunkirk, this perpetual rise mirrors the film's emotional landscape: sustained tension, delayed release, and an unbroken sense of urgency.
But to truly grasp how this works, we must deconstruct the illusion piece by piece, starting with the most fundamental properties of sound.
Frequency: The Language of Pitch
To move forward, we must step away from illusion and return to fundamentals. One of the most basic physical properties of sound is frequency. In acoustics, frequency refers to the number of oscillations a sound wave completes per second, measured in hertz (Hz). Perceptually, this physical quantity is experienced as pitch.
As frequency increases, the perceived pitch rises. As frequency decreases, the perceived pitch falls. This relationship holds regardless of how loud the sound is, allowing pitch and loudness to be examined independently[1] Stevens, S. S., and J. Volkmann. "The Relation of Pitch to Frequency: A Revised Scale." The American Journal of Psychology 53, no. 3 (1940): 329–53. https://doi.org/10.2307/1417526 .
Fixed Frequency, Constant Loudness
Below are examples of pure sine waves played at a constant loudness of 50%. The first sound has a frequency of 500 Hz, while the second is played at 1000 Hz. Apart from frequency, all other parameters remain unchanged.
When listening to these sounds, the distinction is immediate. The 1000 Hz tone is perceived as higher in pitch than the 500 Hz tone, despite both having identical loudness. This demonstrates a key principle: pitch is governed by frequency, not amplitude.
Amplitude: The Measure of Loudness
If frequency determines pitch, what determines loudness? The answer lies in amplitude, the height of the sound wave. A wave with greater amplitude carries more energy and is perceived as louder. Crucially, changing amplitude does not change pitch.
Same Pitch, Different Volume
Below are two versions of the same 1000 Hz sine wave. The first is played at 10% amplitude, the second at 90%. The frequency remains identical, only the loudness changes.
The pitch of both sounds is identical, both oscillate at exactly 1000 Hz. Yet the second sound is noticeably louder. This confirms that frequency and amplitude are independent properties: one controls what we hear (pitch), the other controls how much we hear (loudness).
Movement Through Frequency Domain
So far, we have examined static sounds, tones that hold steady at a single frequency. But what happens when frequency changes continuously over time? This is called a frequency sweep or glissando.
Continuous Rise: 100 Hz to 1000 Hz
Below is a sine wave that starts at 100 Hz and smoothly rises to 1000 Hz over several seconds, all while maintaining a constant amplitude of 50%. Listen carefully to how the pitch climbs steadily upward. This is a real ascent, the frequency is genuinely increasing.
This is the sound of genuine motion. The frequency increases linearly, and our ears follow it without confusion. There is a clear beginning at 100 Hz and a clear end at 1000 Hz. But what if we could make this ascent loop back on itself, creating the illusion that it never stops?
Fading In and Out: Amplitude Envelopes
Just as frequency can change over time, so too can amplitude. An amplitude envelope describes how the loudness of a sound evolves from silence to full volume and back again. This technique is crucial for creating the Shepard tone illusion.
Fixed Pitch, Changing Volume
Below is a 500 Hz sine wave whose amplitude gradually increases from 0% to 100% over time. The pitch never changes, only the loudness. Notice how the sound emerges from silence and grows to full strength.
This fading technique will become essential. In the Shepard tone, multiple tones must fade in and out at precisely the right moments, creating a perceptual "handoff" that tricks the brain into hearing continuous motion.
The Mathematics of Octaves
The Shepard tone's illusion is built on a precise mathematical foundation. Two frequency lines are used, each spanning exactly one octave. An octave represents a doubling of frequency, when a sound's frequency doubles, we perceive it as the "same" note, just higher.
Below is the complete frequency structure used in this demonstration. Notice how Line 1 ends at 353.6 Hz, and Line 2 begins at exactly that same frequency. This overlap is the key to creating seamless perceptual continuity.
| Sample Point | Line 1 Frequency (Hz) | Line 2 Frequency (Hz) |
|---|---|---|
| 1 | 176.8 | 353.6 |
| 2 | 182.0 | 364.0 |
| 3 | 187.3 | 374.6 |
| 4 | 192.8 | 385.6 |
| 5 | 198.5 | 396.9 |
| 6 | 204.3 | 408.5 |
| 7 | 210.3 | 420.5 |
| 8 | 216.4 | 432.8 |
| 9 | 222.6 | 445.3 |
| 10 | 229.3 | 458.6 |
| 11 | 236.0 | 472.0 |
| 12 | 242.9 | 485.8 |
| 13 | 250.0 | 500.1 |
| 14 | 257.4 | 514.7 |
| 15 | 264.9 | 529.8 |
| 16 | 272.7 | 545.3 |
| 17 | 280.7 | 561.3 |
| 18 | 288.9 | 577.8 |
| 19 | 297.3 | 594.7 |
| 20 | 306.1 | 612.1 |
| 21 | 315.0 | 630.0 |
| 22 | 324.3 | 648.5 |
| 23 | 333.8 | 667.5 |
| 24 | 343.5 | 687.1 |
| 25 | 353.6 | 707.2 |
Toward the Illusion: Two Octaves Apart
Now we begin constructing the illusion itself. The key insight is this: tones separated by an octave are perceived as harmonically related, almost as the "same" note, just higher or lower. If we create two frequency sweeps an octave apart and play them simultaneously, something remarkable happens.
Line 1: Rising from 177 Hz to 343 Hz
This sweep covers one octave, starting at a low frequency and climbing upward. The amplitude remains constant at 100%.
Line 2: Rising from 343 Hz to 687 Hz
This sweep starts exactly where Line 1 ends (343 Hz) and rises to 687 Hz, another octave higher. It too plays at constant 100% amplitude.
Heard individually, these are simply two rising glissandos. But they are carefully designed to overlap in a specific way. When played together, they begin to hint at something more complex, though the illusion is not yet complete.
The Missing Ingredient: Amplitude Fading
The key to the Shepard tone is not just layering multiple frequencies, it is controlling their visibility. By applying opposite amplitude envelopes to the two lines, we create a perceptual handoff: as one tone fades out, the other fades in. The brain perceives continuity, not replacement.
Line 1: Fading In (0% → 100%)
This version of Line 1 (177-343 Hz) starts silent and gradually becomes louder, reaching full volume by the end.
Line 2: Fading Out (100% → 0%)
This version of Line 2 (343-687 Hz) starts at full volume and gradually fades into silence. This is the opposite envelope of Line 1.
Individually, these sound unremarkable. But when combined, something extraordinary happens. The fading creates seamless continuity: as the higher tone disappears, the lower tone takes its place, yet because they are an octave apart, the brain interprets them as a single entity that has somehow "looped" back without descending.
Shepard Tone
We have arrived. Below is the completed Shepard tone, both lines playing simultaneously, with Line 1 fading in as Line 2 fades out. The sound loops continuously, creating the sensation of endless ascent.
Listen carefully. At first, you may hear the pitch rising. But as the loop repeats, you will realize something: the sound never arrives anywhere. It climbs forever, yet it never gets higher.
This is the Shepard tone. Not a trick of editing, not a manipulation of playback, simply two carefully crafted sine waves, phased and enveloped to exploit a quirk of human perception.
The illusion works because our auditory system groups octave-related tones together. When the higher tone fades out and is replaced by the lower tone an octave below, the brain does not perceive a descent, it perceives a continuation. The loop is seamless, and the ascent appears infinite.
Afterwards
The Shepard tone is more than an auditory curiosity. It is a window into how perception shapes reality. Throughout this exploration, we have deconstructed the illusion piece by piece. We isolated frequencies, mapped amplitude envelopes, visualized waveforms, and traced the mathematical architecture that makes the impossible ascent possible. We have, in essence, peaked behind the curtain.
And yet, knowing how it works does not make it stop working. Even now, after understanding the mechanics (the octave relationships, the crossfading, the perceptual handoff), when you press play on the complete Shepard tone or the piece by Hans Zimmer, or any other such piece, you still hear it rising. The illusion persists, but it transforms. What once felt mysterious now feels ingenious. What seemed magical now appears elegant. The illusion has not become mundane. It has become real in a different way: real as a testament to the brain's pattern-seeking nature, real as a clever exploitation of how we organize sound.
This journey began with an interesting sequence of events. I had heard of the Shepard tone before. The name was familiar, the effect was known to me: that endless rising pitch, the auditory illusion of perpetual ascent. But I had never looked under the hood. I did not know how it was made, what frequencies were involved, or why the brain falls for it so completely.
One day, while working with a senior, we stumbled upon something interesting in Wolfram Mathematica. Within it was a module that could generate sound directly from mathematical functions. No external speakers, no audio interfaces, no separate software. Just code and equations that produced waveforms. We played with it for a while, generating simple tones, experimenting with frequencies.
I showed it to my professor. He looked at it, thought for a moment, and then said, "Let's do something with this. Let's make our own Shepard tone." At the time, neither of us fully understood how to construct one. We knew the effect, but not the mechanics. So we started researching. We dug deep, experimented with frequencies, mapped out octave relationships. Slowly, the structure emerged: two frequency lines, separated by an octave, one fading in as the other fades out. Simple in concept, precise in execution.
We built it piece by piece. First, isolated sine waves at fixed frequencies. Then sweeps, watching the pitch climb smoothly over time. Then amplitude envelopes, controlling how sounds fade in and out. Finally, we layered the two octave-separated lines together, timed their crossfades, and looped the result. The illusion worked. What you hear in this post is the result of that process: each sound file synthesized within Mathematica, each graph plotted from raw waveform data.
What struck me most was not the complexity of the illusion, but its simplicity. The Shepard tone requires no exotic sounds, no digital trickery. It needs just sine waves, careful timing, and an understanding of how octaves relate. It is built from the most fundamental elements of sound, yet it creates an experience that feels impossible. This is the beauty of illusions: they remind us that reality is not just what exists, but how we interpret what exists.
In Dunkirk, Zimmer used the Shepard–Risset Glissando to mirror the psychological tension of soldiers trapped with no escape. It creates urgency without resolution, movement without progress. But the illusion speaks to something broader: our minds constantly construct coherent narratives from incomplete information. We seek continuity, we expect patterns, and sometimes those expectations can be shaped, redirected, even fooled.
Now that we understand the mechanism, the Shepard tone remains as compelling as ever. It captivates us not despite our knowledge, but because of it. We hear both the illusion and the architecture beneath it. We climb the infinite staircase, aware that it loops, yet unable to stop perceiving the ascent. This is the paradox of understanding: knowledge reveals the trick, but the magic lingers. And here it is, presented to you as it was first presented in my professor's acoustics lecture: a journey to Shepard tone.
Have fun.
This blog post documents the Shepard tone demonstration created for an introductory acoustics lecture. All sound files and waveform graphs were generated from scratch using Wolfram Mathematica, synthesizing pure sine waves with precisely calculated frequency sweeps and amplitude envelopes.
📄 View Complete Mathematica Notebook (PDF)
Special thanks to my professor for the collaboration and to Roger Shepard and Jean-Claude Risset for their pioneering work in psychoacoustics that made this illusion possible.
An insightful and inquisitive capture of shepard tone. Eloquent presentation. 🤩
ReplyDeleteThank you. ❤️
DeleteNice blog. I have learnt an interesting thing, the way it's presented is good and understandable.
ReplyDeleteAyee.. happy to hear... It is an interesting thing.. !!!
Delete