Your room as a reverb
Clap your hands in a tiled bathroom, a lounge room, an empty hall and a stairwell, and you hear four different claps. Your hands did the same thing each time; the room did the rest. Every surface sent the sound back, a little later and a little quieter, and you heard all of those copies at once.
That’s all a room does to a sound: it adds delayed, scaled copies. So a room can be captured as a list of numbers (how much of the sound arrives after each delay), and once you have the list, you can put any sound in that room, without going there. This page measures rooms, including yours, and does exactly that.
It leans on:
- Designing FIR filters: a filter’s taps, and its impulse response.
- The Fourier transform, for the convolution theorem, and the FFT.
- Finding signals below the noise, for chirps and why a long sound can measure as sharply as a short one, and for finding your own echo.
- A synth to play, whose reverb imitates a room with a few delay lines: this page compares it with real rooms.
1 · A room answers a click
Section titled “1 · A room answers a click”Start with one wall. A click from a loudspeaker reaches your ear twice: straight from the loudspeaker, and again off the wall, a few milliseconds later (sound travels about 34 cm a millisecond) and a little quieter (it went further, and the wall soaked some of it up). Bouncing off a wall looks, to your ear, exactly like a second loudspeaker behind the wall, as far behind it as the real one is in front: a mirror image. Its sound arrives by the straight line from the image, the same length as the bounce.
In a room, the images have images: a sound that bounces off the left wall and then the right one comes from an image of the image, two rooms away. The walls are two facing mirrors, and the room repeats in every direction. Each image is one reflection, and how far away it is says when the reflection arrives.
A 5.5 × 4.5 m room from above, with its floor and ceiling left out for now. Each dot is an image of the source (bigger: louder), and the grid is the room’s mirror copies. With one bounce each, there are 4 reflections (the solid lines show the real paths, off each wall); the first arrives 5.5 ms after the direct sound. With up to 8 bounces, 144 are drawn, 130 of them in the first 100 ms (the furthest images are off the edge). Below: what the microphone hears from a click, one click per image, each quieter with distance.
What the microphone hears from a single click is the room’s impulse response: the direct sound, then the early reflections, separate enough to see one by one, and then more and more of them, closer and closer together.
2 · Thousands of reflections: the tail
Section titled “2 · Thousands of reflections: the tail”Add the floor and ceiling and the images fill space in every direction. The number arriving by time grows as (they fill a sphere of radius , at one per room-sized cell), so after a few tens of milliseconds there are hundreds a millisecond, too many for the ear, or a model, to tell apart. They blur into a hiss that dies away: the reverberant tail.
How fast it dies depends on two things. Each time the sound meets a wall, the wall soaks up a share of its energy (tiles and glass very little, curtains, carpet and people a lot). And in a small room the sound meets a wall more often. Wallace Sabine worked this out by experiment, timing how long organ pipes took to fade in Harvard’s lecture halls with a stopwatch, and gave the reverberation time: the time for the sound to fall 60 dB (to a millionth of its energy),
with the volume in cubic metres and the surface area in square metres. Bigger rooms ring longer; softer ones die sooner. Air soaks up high frequencies too, a little every metre, and in a big room the sound travels a long way, so the highs die first.
The model room: its reflections are tracked image by image until the tail starts (shaded), and then the tail is noise, as loud as the reflections would be on average, dying at the rate the walls and air set (Carl Eyring’s form of Sabine’s formula, which also holds for rooms that soak up a lot). In the empty classroom (9 × 7 × 3 m, 189 m³, each wall soaking up 10%), Sabine’s formula gives 1.37 s; Eyring’s gives 1.27 s for the lows and 0.73 s for the highs, where the air takes more. Measured from the model’s own decay curves (section 6 shows how): 1.26 s and 0.79 s.
The model is how acoustic designers start: mirror images for the early reflections, statistics for the tail. Real rooms aren’t empty boxes (furniture and odd shapes scatter the sound), so for a real room, it’s better to measure it. That needs two more pieces: what to do with an impulse response, and how to get one.
3 · A room is one huge FIR filter
Section titled “3 · A room is one huge FIR filter”An FIR filter, on the FIR page, is a list of taps: each output sample is the newest input sample times the first tap, plus the one before times the second, and so on. Feed it a single click and out come the taps themselves: a filter’s taps are its impulse response.
A room does exactly that. So a room is an FIR filter, just a huge one: a two-second impulse response at 48,000 samples a second is a filter with 96,000 taps. The direct sound is the first tap, each reflection is a tap a little later, and the tail is tens of thousands of small, noisy taps. Running a sound through the filter, convolution, puts it in the room.
Convolution can be seen the other way round, too: every sample of the sound sets off its own copy of the room’s answer, scaled by that sample and starting at its time, and all the copies add up.
A sound of four samples, in a “room” whose impulse response is the sound itself, then an echo 3 samples later at half the level and a quieter one 5 samples later. Each input sample sets off a copy of the impulse response, scaled by the sample; the output is all of them added. Where copies overlap, they add: output sample 3 is 0.5 (the first sample’s echo) plus 0.4 (the last sample itself), 0.9.
Sound being linear (two sounds at once make the sum of what each makes alone) is what makes this work: as long as the room doesn’t change and nothing in it distorts, its impulse response says everything about what it does to any sound.
4 · Doing it fast
Section titled “4 · Doing it fast”Done directly, convolution costs one multiplication per tap per output sample: 96,000 taps at 48,000 samples a second is about 4.6 billion multiplications a second, for one channel. That’s too slow for a phone, and a long cathedral would be several times worse.
The convolution theorem gives a short cut: convolution in time is multiplication in frequency. Take the FFT of the sound and of the impulse response, multiply them bin by bin, and take the inverse FFT. The FFT’s cost grows as , not , so for long filters this is enormously cheaper. (The FFT’s convolution wraps round the end, so both are padded with zeros first, to at least the length of the result.)
There’s a catch for live sound: an FFT needs a block of input before it can start, so the output comes out a block late. An FFT as long as the room means seconds of delay. The answer is to partition: cut the impulse response into short blocks, convolve each block with the FFT, and add the results, each delayed by its block’s position. Each new block of input needs one FFT, then one multiplication per frequency bin for each partition, and one inverse FFT; the delay is just one block.
Multiplications per output sample for a 2 s room (96,000 taps), against the block size. Directly, it’s 96,000 per sample: 4,608 million a second. In blocks of 512 samples (10.7 ms late, green), 40.0 million a second, over a hundred times fewer. One block the size of the whole room, 7.1 million a second, but 2.7 s late. Time it runs all three on this page’s sentence, in your browser (the direct one only on its first quarter of a second, then scaled up: the whole would take too long).
Commercial convolution reverbs go one step further, with non-uniform partitions: small blocks at the start of the impulse response, for a short delay, and bigger blocks further on, which are cheaper per sample and have time to compute (William Gardner showed this in 1995). Browsers have one built in, the Web Audio API’s ConvolverNode; this page uses its own partitioned convolver, in blocks of 512, for the live figure in section 8.
5 · Measuring a room: why not just clap?
Section titled “5 · Measuring a room: why not just clap?”To measure a room, play a click and record what comes back. That works, and a starting pistol or a burst balloon is how rooms were measured for decades. The trouble is energy. A loudspeaker can only move so far, so a click is limited in height, and a click lasts one sample: it carries very little energy. The room’s tail, 60 dB down, is quieter still, and a room is never silent: there’s traffic, air conditioning, the fridge. The tail disappears into that noise long before it has fallen 60 dB.
The fix comes from radar, as on the finding-signals page: send a long sound with a lot of energy, whose shape you know, and squeeze it back into a click afterwards. For rooms, the best long sound is a sine sweep.
The empty classroom, measured with background noise 50 dB below full scale: with a click (both at the same peak level), the noise is only 16.9 dB below the impulse response’s loudest 10 ms, and most of the tail is lost in it. With a 2 s sweep, it’s 59.0 dB below: 42.2 dB better. Each time the sweep is made four times as long, the noise drops another 6 dB: 36.2 dB better with a 0.5 s sweep, 48.2 dB with an 8 s one.
The sweep Angelo Farina proposed in 2000 is exponential: its frequency climbs from the bottom of hearing to the top taking the same time for every octave, as a musical glide does. To squeeze it back into a click, it’s convolved with its inverse filter: the same sweep played backwards, so that the low frequencies, which came first, are delayed the most, and everything lines up at one moment. The sweep spends as long going from 30 to 60 Hz (30 Hz wide) as from 10 to 20 kHz (10,000 Hz wide), so it puts far more energy into each hertz at the bottom; the inverse is made quieter at the low end, 6 dB an octave, to even that out.
The exponential sweep has one more gift. A loudspeaker pushed hard distorts, adding harmonics: while the sweep plays 1 kHz, it also makes some 2 kHz and 3 kHz. To the inverse filter, a 2 kHz sound at the moment the sweep was at 1 kHz looks like the sweep arriving early, by the time the sweep takes to climb an octave. So each harmonic’s response comes out as its own small impulse response, ahead of the room’s, and simply falls off the front: the measurement of the room is left clean.
Top: a 2 s sweep from 30 Hz to 20 kHz, each octave taking the same time, and its inverse, the same backwards. Bottom: a sweep through a loudspeaker pushed hard (50% on the slider: it distorts its lows, below about 1.5 kHz, where its cone moves furthest), then through the inverse, with the room left out: one click, and before it, the harmonics’ own clicks, at exactly the times the sweep takes to climb an octave (2nd harmonic, 213 ms early) and an octave and a fifth (3rd, 338 ms early). Here they’re 41.5 and 37.8 dB below the click; pushed 20%, 51.4 and 48.1 dB.
Other test sounds are used too. Maximum-length sequences (the m-sequences of the finding-signals page) have the same squeeze-to-a-click property and are fast to compute, but loudspeaker distortion spreads through the whole result instead of moving out of the way, which is why the sweep has largely replaced them.
6 · How long a room rings
Section titled “6 · How long a room rings”With an impulse response measured, the reverberation time can be read from it. Its energy, drawn in dB, falls roughly in a straight line, but it’s noisy: the tail is a hiss, and its level jumps around. Manfred Schroeder found, in 1965, a way to get a smooth curve from a single measurement: add up the impulse response’s energy backwards from the end. At each moment, the result is all the energy still to come. It’s exactly what you’d get by averaging the decay of infinitely many bursts of noise, the old way of measuring, and it falls smoothly.
Its slope gives the reverberation time. Rooms rarely give a clean 60 dB above the noise, so the slope is measured between −5 and −35 dB and stretched to 60: T30. Between −5 and −25 dB, it’s T20.
There’s a trap: the noise under the measurement. Integrating backwards from the end of the recording adds up the noise too, and the curve stops falling where the noise takes over, as if the room rang for ever. The fix (a simple form of the method of Lundeby and others) is to find where the decay meets the noise, by fitting a line to the decay, and to stop the integral there.
The classroom’s impulse response with noise 40 dB below its loudest 10 ms. Without any noise, its T30 is 1.06 s. With the noise integrated to the end, the curve flattens out and T30 comes out at 7.80 s. Stopped where the decay meets the noise (dashed line), 1.03 s. With the noise 30 dB down, the decay never reaches −35 dB above it, and only T20 can be measured.
The reverberation times of real rooms span a wide range: a furnished lounge room about 0.3 to 0.5 s, a classroom about 0.6 to 1 s (more when empty), a concert hall about 2 s, and a large stone church can ring for 5 s or more. Rooms for speech want it short, so each syllable has died before the next; rooms for music want it longer.
7 · Measure your own room
Section titled “7 · Measure your own room”Now the real thing: your loudspeaker plays a sweep, your microphone records what the room does to it, and the inverse filter turns that into your room’s impulse response.
Use the loudspeaker, not headphones, somewhere quiet; start with the volume about where you'd play music.
Top: the impulse response in dB, from the direct sound; with a measured sweep, the part before 0 is the loudspeaker’s distortion (section 5’s harmonics), cut away. Middle: its decay curve, stopped where it meets the noise. Bottom: the reverberation time in each octave. Before you measure, it shows the model lounge room, with noise 60 dB down, as a good measurement would have. Each measurement is kept as take 1 or take 2, for the next figures.
Some things to know:
- Everything in the path is measured. The impulse response includes the loudspeaker and the microphone. A laptop’s or a phone’s loudspeaker makes almost nothing below a few hundred hertz, so the lowest octaves of the measurement are mostly noise, and the octave figures for 125 and 250 Hz will be unreliable. A bigger loudspeaker fixes that.
- Where the microphone points matters, if it’s directional: a cardioid microphone pointing at the loudspeaker hears more of the direct sound and less of the room than one pointing away. An omnidirectional microphone (and most phones’ and laptops’ microphones are close to one) hears the room evenly.
- Somewhere else. The sweep can be saved as a WAV file (it starts after a second of silence and leaves four seconds afterwards for the room to ring), played from a phone or a portable loudspeaker in a stairwell, a church, a car park or a tiled underpass, and recorded on anything. Then open the recording here: the page finds which sweep it was, and where it starts. A stereo recording (two microphones) gives a stereo impulse response in one go. Big public spaces are rarely quiet, so a longer sweep helps, and early mornings help more.
- Two different clocks. When the sweep is played from one device and recorded on another, their clocks differ slightly (by a few parts in a hundred thousand). Over a 10 s sweep that’s a fraction of a millisecond, which smears the very top of the response a little and does no other harm.
If you can’t play a sweep somewhere, a clap or a burst balloon, recorded and opened as an impulse response, works too: it’s the old way, with the noise of section 5. Impulse responses from elsewhere (as WAV files) open the same way.
8 · Any sound, in your room
Section titled “8 · Any sound, in your room”With an impulse response in hand, putting a sound in the room is one convolution.
A sound, in a room: one of the model rooms, or your takes. How much room sets how much of the room is heard against the dry sound (at 100%, only the room). Stereo uses two impulse responses, one for each ear: for the model rooms, two microphone positions a metre apart; for yours, two takes (or a stereo recording). Live runs your microphone through the room as you make the sound, through this page’s partitioned convolver (blocks of 512 samples: the room starts 10.7 ms late, plus the browser’s own delays): use headphones, or the loudspeaker and microphone will feed back and howl.
A single impulse response gives mono: the room is all there (its size, its colour, how long it rings) but it sounds as if it’s in front of you, coming from one point. Two microphones a little apart hear different patterns of reflections, and two different tails, one for each ear, are what make a sound feel wide and enveloping. One microphone in two places, measured twice, does nearly as well, which is why there are two takes.
Studios go further, with true stereo: four impulse responses, from a left and a right loudspeaker position to a left and a right microphone, so a sound panned left in the mix is heard from the left in the room. And surround and headphone (“binaural”) reverbs use more again.
9 · Convolution or an algorithm?
Section titled “9 · Convolution or an algorithm?”The synth page’s reverb does something quite different: eight delay lines feeding each other, set to die away in a chosen time. That’s algorithmic reverb, and it’s cheap, smooth, and every part of it can be changed while it plays. Convolution is exact, but fixed: changing the room means measuring another one.
A room beside the synth page’s reverb, set to the room’s own reverberation time (its damping at 8 kHz). Top: the room’s first 100 ms has a clear direct sound and separate early reflections at set times; the reverb’s builds up from echoes of its delay lines, the same ones over and over. Bottom: for the empty classroom (T30 1.06 s overall), the room’s lows take 1.26 s and its highs 0.79 s; the reverb’s take 1.07 s and 0.66 s. Its one setting is matched to the room’s overall time, which the faster-dying highs pull down.
The two are often used together: convolution for the first part, where the early reflections tell the ear how big the room is and where the walls are, and an algorithm for the long tail, where only how fast it dies (and how much faster the highs die) matters, and the algorithm can be adjusted.
10 · Correcting a room
Section titled “10 · Correcting a room”Many AV receivers, hi-fi amplifiers and studio monitors come with room correction: a microphone at the listening position, some test sounds, and a filter applied to everything played afterwards, to undo what the room does. If a room is a filter, the obvious way is to run every sound through the room’s inverse first, so that the two cancel and you hear the recording as it was made.
That can be done, exactly, at one spot. The inverse has to start before the sound does (to cancel a reflection, it sends out anti-sound timed to meet it, and a room’s response can’t be inverted without that look-ahead), so it comes with a delay. And it’s exact only where it was measured. Move a few centimetres and every reflection arrives at a slightly different time: a 3 kHz wave is only 11 cm long, so the fine detail the inverse was built to cancel is no longer there, and the anti-sound it sends out, early, is heard as it is.
The model lounge room, with its correction measured at one spot and heard from 0 to 60 cm away. The exact inverse, at the measuring spot, removes the room: a flat response and a single click (with a faint hiss 32 dB down, where the inverse was held back at frequencies the room barely passes). Just 2 cm away, the bass is still corrected (3.6 dB of spread to 0.2: its waves are metres long), but the treble is less even than with no correction at all (2.5 dB of spread, against 1.1), and the sound that arrives before the direct sound is only 3.5 dB below everything else: a whoosh of pre-echo before each sound. The averaged correction (measured at the spot and 25 cm each way, smoothed, bass only, minimum phase) halves how uneven the bass is (3.5 to 1.8 dB of spread at the measuring spot, and the same 25 cm away), leaves the treble alone, and adds no pre-echo. At 60 cm, outside the area it was measured over, it still helps: 5.1 to 3.5 dB.
So real room correction is cautious, and does far less than invert the room:
- Several positions, averaged. What’s the same across the listening area is kept, which is mostly the loudspeaker’s own response and the bass; what changes from spot to spot is left alone.
- Mostly the bass. Below a few hundred hertz, the wavelengths are metres long, and a small room’s resonances (its modes: standing waves between the walls) give peaks of 10 dB or more that are much the same from seat to seat. That’s where correction helps most. Higher up, only broad, gentle changes.
- Cut, don’t fill. A deep dip is usually two paths cancelling (the direct sound and a reflection half a cycle late). Boosting that frequency boosts both, and they still cancel: it spends amplifier power and helps nowhere else. So boosts are limited (here to 6 dB) and cuts are allowed more.
- Minimum phase. A resonance’s peak behaves like a simple resonator, and a filter with the opposite shape and the least possible delay (minimum phase, found here from the cepstrum) undoes both its loudness and its long ringing, with no pre-echo. Some systems also correct timing (when each frequency arrives), again averaged over the listening area, and some use several subwoofers together to cancel a mode actively.
- A target, not a straight line. A loudspeaker in a room usually sounds best with the treble gently falling, so most aim for that.
The reverberant tail isn’t touched at all. It’s different at every point in the room, so the only way to shorten it is to change the room: curtains, rugs, bookshelves and absorbing panels.
Summary
Section titled “Summary”- A room adds delayed, scaled copies of a sound: one for each reflection, found by mirror images of the source. Its answer to a click is its impulse response.
- After the early reflections there are too many to count: the tail, which dies in the reverberation time, set by the room’s size and how much its surfaces soak up (Sabine’s formula). Air takes the highs first.
- A room is one huge FIR filter: its taps are its impulse response. Convolution puts any sound in it.
- Convolution is fast with the FFT (the convolution theorem), and partitioning the impulse response keeps the delay to one short block, for live sound.
- A click carries little energy. An exponential sine sweep and its inverse filter measure a room with tens of decibels less noise, and move the loudspeaker’s distortion out of the way.
- Schroeder’s decay curve, stopped where it meets the noise, gives the reverberation time (T20, T30), in each octave band.
- Two impulse responses, from two places, make a room sound wide.
- Algorithmic reverbs (delay networks) are cheap and adjustable; convolution is exact but fixed.
- A room’s exact inverse works only where it was measured: centimetres away it adds pre-echo. Room correction averages several positions, corrects mostly the bass, and uses minimum-phase filters.
Further reading
Section titled “Further reading”- Wallace Clement Sabine, Collected Papers on Acoustics (Harvard University Press, 1922): the reverberation time and its formula.
- Carl F. Eyring, “Reverberation time in ‘dead’ rooms”, Journal of the Acoustical Society of America 1(2), 1930.
- Jont B. Allen and David A. Berkley, “Image method for efficiently simulating small-room acoustics”, Journal of the Acoustical Society of America 65(4), 1979.
- Manfred R. Schroeder, “New method of measuring reverberation time”, Journal of the Acoustical Society of America 37(3), 1965.
- Angelo Farina, “Simultaneous measurement of impulse response and distortion with a swept-sine technique”, 108th Audio Engineering Society Convention, Paris, 2000.
- Anders Lundeby, Tor Erik Vigran, Heike Bietz and Michael Vorländer, “Uncertainties of measurements in room acoustics”, Acustica 81(4), 1995: where the decay meets the noise.
- William G. Gardner, “Efficient convolution without input-output delay”, Journal of the Audio Engineering Society 43(3), 1995.
- Stephen T. Neely and Jont B. Allen, “Invertibility of a room impulse response”, Journal of the Acoustical Society of America 66(1), 1979: why a room can’t simply be inverted.
- Biljana D. Radlović, Robert C. Williamson and Rodney A. Kennedy, “Equalization in an acoustic reverberant environment: robustness results”, IEEE Transactions on Speech and Audio Processing 8(3), 2000: how far from the measuring spot an exact correction still works.
- Richard K. Cook and others, “Measurement of correlation coefficients in reverberant sound fields”, Journal of the Acoustical Society of America 27(6), 1955: why nearby points hear the same bass and different treble.
- ISO 3382-1, Acoustics: measurement of room acoustic parameters: how T20, T30 and the rest are measured.