Ray-Traced Acoustic Room Demo

Overview

This project is a virtual simulation that shows how sound behaves inside a room. Using a 3D environment, we can watch sound waves travel from a speaker, bounce off walls, and eventually reach a listener’s ears. Think of it like being able to see sound — something that’s normally invisible to us.

Understanding how sound moves through a room is important for many real-world applications:

Architects, audio engineers, and designers use these principles to create spaces that sound good. This project lets us see and experiment with these concepts in a virtual environment.


The Basic Idea: How Sound Travels

When you clap your hands in a room, the sound doesn’t just travel directly to your ears. It also:

  1. Travels outward in all directions from the source
  2. Hits the walls, floor, and ceiling
  3. Bounces back into the room (like a ball bouncing off a wall)
  4. Bounces again and again until the sound fades away
  5. Reaches your ears as a combination of the direct sound and all its reflections

This is why your voice sounds different in a bathroom (lots of hard, reflective surfaces) compared to a bedroom with carpet and curtains (soft, absorbing surfaces).


The Components of Our Virtual Room

The Room Itself

I constructed a simple rectangular room with six surfaces:

Each surface can be assigned different properties that determine how much sound it absorbs versus reflects. For example:

Surface Type Absorption What It Simulates
Concrete Very low (reflects most sound) Hard warehouse floor
Carpet Medium to high Living room floor
Acoustic panels Very high Recording studio walls

The absorption coefficient is a number between 0 and 1:

Most real materials fall somewhere in between, and they absorb different amounts depending on the pitch of the sound. Low rumbling sounds behave differently than high-pitched sounds.

The Sound Source (Monopole)

In the center of the room, I placed a virtual speaker called a monopole source. This is the simplest type of sound source — it radiates sound equally in all directions, like a tiny pulsing sphere. Imagine dropping a pebble in still water and watching the ripples spread outward in a perfect circle. A monopole does the same thing, but in three dimensions and with sound waves instead of water waves.

The Sound Rays

To visualize how sound travels, a technique similar to how computer graphics programs create realistic lighting is used. Instead of trying to simulate every single sound wave (which would be impossibly complex), invisible “rays” shoot out from the sound source in many directions — like the spokes of a wheel extending outward from the center.

Each ray:

These rays are tracked as they ping-pong around the room, recording how much energy they have at each step.

The Virtual Microphone

Somewhere in the room, a microphone object is placed. This is represented as a sphere with a certain capture radius. Whenever a sound ray passes through this sphere, the microphone “hears” it and records:

By adding up all the rays that reach the microphone, the total sound energy at that position can be calculated.

The Display

On screen, information about the captured energy is shown:


What You Can See and Do

When you run the simulation:

  1. Red lines appear showing the paths of sound rays as they travel from the source, bounce off walls, and eventually fade away
  2. The power meter updates showing how much sound energy reaches the microphone
  3. The frequency bars change based on how different pitches are affected by the room

Experimentation is done by:


Comparing Our Model to Theory

Scientists have developed mathematical formulas to predict how sound behaves in rooms without having to simulate every ray. Two famous formulas are:

The Sabine Equation (1900)

Developed by Wallace Sabine, a Harvard physicist who pioneered the science of room acoustics. His formula predicts reverberation time — how long it takes for sound to fade away after the source stops. This formula works well for rooms with hard, reflective surfaces (what acousticians call “live” rooms).

The Eyring Equation (1930)

Carl Eyring improved on Sabine’s work to create a formula that also works for rooms with lots of absorption (what acousticians call “dead” rooms, like recording studios). His formula gives more accurate predictions when rooms have very absorptive surfaces.

This project calculates both theoretical predictions and compares them to what our ray-tracing simulation actually measures. This helps verify that the virtual model is behaving realistically.


The Physics Behind It All

Energy Conservation

Sound carries energy. When a sound wave hits a surface:

This is why sounds fade away over time — each bounce removes some energy until there’s nothing left to hear.

Frequency-Dependent Absorption

Different materials absorb different pitches differently. For example:

This is why rooms sound different from each other — not just louder or quieter, but with different tonal qualities. The acoustic profile, if you will.

The Inverse Square Law

Sound gets quieter the farther you are from the source. Specifically, if you double your distance from a speaker, the sound energy drops to one-quarter of what it was. This is because the sound is spreading out over a larger and larger area as it travels.


Limitations of This Model

Like all simulations, some simplifications are being made:

  1. ** Rays instead of waves**: Real sound waves can bend around corners (diffraction) and create complex patterns when waves overlap (interference). Our ray model doesn’t capture these effects.

  2. Assuming simple reflections: Real surfaces scatter sound in complex ways. We assume simple mirror-like bounces.

  3. A limited number of rays: More rays would give more accurate results but would take longer to calculate.

  4. Only six frequency bands: Real sound contains a continuous spectrum of frequencies.

Despite these limitations, ray-tracing models like akin to this one are widely used in professional acoustic design because they provide a good balance between accuracy and computational speed.


Glossary

Term Definition
Absorption coefficient A number (0-1) indicating how much sound energy a surface absorbs
Decibels (dB) A unit for measuring sound intensity
Frequency The pitch of a sound, measured in Hertz (Hz)
Monopole A simple sound source that radiates equally in all directions
Ray tracing A technique that simulates sound by following individual rays as they travel and bounce
Reverberation The persistence of sound in a space after the source stops, caused by reflections
RT60 The time it takes for sound to decrease by 60 decibels (become one millionth as loud)

Summary

This project creates a virtual laboratory for exploring room acoustics. By visualizing sound as rays that travel, bounce, and fade, we can: