Ray Tracing Room Acoustics — User Guide
A simplified 3D geometric room model that traces specular reflections, adds direct propagation and a deterministic diffuse tail, builds a synthetic impulse response, and convolves it with the source.
What this does
The script represents the room as a rectangular box with coordinates x = width, y = depth, z = height. Rays leave the source in approximately even directions using a Fibonacci-sphere distribution, reflect specularly from the six room boundaries, and contribute to the IR when a reflected segment passes within the listener capture radius. A direct path and a diffuse noise tail are added separately.
Quick start
- Select exactly one Sound.
- Run
Ray_Tracing_Room_Acoustics.praat. - Choose one of eight room presets or Custom.
- For Custom, set room dimensions, source/listener coordinates, ray/reflection counts, absorption, propagation, tail, diffuse level, and wet/dry mix.
- Click OK. The result is named
original_raytraced_PresetName.
Room presets
| Preset | Dimensions W×D×H | Rays | Max refl. | Wall α | Requested tail |
|---|---|---|---|---|---|
| Small Living Room | 5×4×3 m | 150 | 10 | 0.40 | 0.6 s |
| Large Concert Hall | 40×20×15 m | 300 | 25 | 0.15 | 3.0 s |
| Bathroom (Bright) | 2.5×2×2.2 m | 250 | 20 | 0.05 | 1.0 s |
| Recording Studio (Dead) | 6×5×4 m | 100 | 5 | 0.70 | 0.3 s |
| Cathedral (Very Long) | 60×40×25 m | 400 | 30 | 0.08 | 5.0 s |
| Small Club | 12×10×4 m | 200 | 12 | 0.25 | 1.0 s |
| Outdoor (Minimal) | 100×100×50 m | 80 | 3 | 0.95 | 0.2 s |
| Bright Chamber | 8×7×6 m | 250 | 15 | 0.12 | 1.5 s |
Presets also set listener radius, air absorption, diffuse level, and source/listener positions. Speed_of_sound, Wet/Dry, Draw and Play remain available from the form.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
| Room_width_m / height / depth | 8 / 6 / 5 | Rectangular room dimensions. Internally limited to at least 0.1 m. |
| Number_of_rays | 200 | Fibonacci-sphere rays launched from the source. |
| Max_reflections | 15 | Maximum wall intersections traced per ray. |
| Listener_radius_m | 0.5 | Capture radius around the listener; internally capped below half the smallest room dimension. |
| Wall_absorption | 0.15 | Energy absorption coefficient. Pressure reflection amplitude is sqrt(1-α). |
| Air_absorption | 0.001 | Exponential pressure loss per metre. |
| Speed_of_sound | 343 | Propagation speed used to convert path length to delay. |
| Reverb_tail_s | 1.5 | Additional IR time after the calculated RT60. |
| Diffuse_level | 0.15 | Amplitude scale of the seeded Gaussian diffuse tail. |
| Source_x/y/z | 2 / 3 / 1.5 | Source position, clipped inside the room. |
| Listener_x/y/z | 6 / 3 / 1.5 | Listener position, clipped inside the room. |
| Wet_dry_percent | 60 | Blend between padded dry source and convolved room response. |
Geometric room model
The direct path uses Euclidean source-to-listener distance, delay distance / speed_of_sound, and pressure amplitude exp(-airAbs·distance)/(1+distance). For reflected paths, every ray is advanced to the nearest of the six walls, reflected specularly, and attenuated by air loss and the pressure reflection coefficient. Listener arrival is evaluated before the wall loss that terminates that segment, so a listener hit reflects the path actually travelled to the listener.
Only reflected segments after at least one completed wall reflection are eligible for reflection taps. A ray stops early when its accumulated pressure gain falls below 0.001.
Impulse response & RT60
A mono IR is created with duration direct delay + RT60 + requested tail. RT60 is estimated from a single average wall absorption using Sabine's formula:
RT60 = 0.161 × room volume / (wall absorption × total surface area)
The value is constrained to 0.05…5.0 s. The diffuse tail begins at the direct-arrival time and uses seeded Gaussian noise multiplied by exp(-6.9·t/RT60). Its internal seed is 20260814, after which the script restores Praat's normal unpredictable RNG. The IR is only attenuated if its peak exceeds 0.99.
Channels & output
The same mono room IR is convolved with the selected Sound. Praat applies the convolution across the source channels, so the original channel count is preserved. The dry copy is padded to the wet result length before Wet/Dry mixing.
The final result is attenuation-limited only when its peak exceeds 0.95; quiet material is not boosted. The output is longer than the source because the convolution includes the complete synthetic IR response.
Visualization
The visualization retains the CAD-style room views and shows: top view in X–Y (width × depth), side view in Y–Z (depth × height), cached ray paths, source and listener, the generated impulse response with direct-arrival and RT60 references, and a full original/result waveform overlay on a shared amplitude axis.