This repository contains code for a differentiable room acoustics simulator, as described in (paper TBA).
The simulator utilizes variants of the image source [1,2] and diffuse rain [3] methods from geometric acoustics to efficiently render spatial audio inside cuboid rooms. It is capable of computing gradients in roughly constant memory via path replay backpropagation [4,5], and is differentiable with respect to many of its input parameters, including:
- Room dimensions
- Multi-frequency material properties of each wall
- Source and receiver properties
- Location
- Orientation
- Multi-frequency directivity response
- Room air conditions
This repository is currently a work-in-progress, and will be updated with more detailed documentation in the near future.
First, install the following dependencies (e.g. via pip):
scipy
torch
sphericart[torch]
Currently the code has only been tested on scipy>=1.16.3, torch==2.10.0, sphericart[torch]==1.0.8 with Python 3.12 and higher, but earlier versions may still work.
Next, in your copy of this repo's root directory, install diffsra locally via pip:
cd <path/to/root/dir/>
pip install build
python build -m
pip install .(for now, the package is not yet published, so it must be installed locally)
If you used this code in your research, please cite:
TBA
[1] Allen, J.B. and Berkley, D.A., 1979. Image method for efficiently simulating small‐room acoustics.
[2] Borish, J., 1984. Extension of the image model to arbitrary polyhedra.
[3] Schröder, D., 2011. Physically based real-time auralization of interactive virtual environments.
[4] Vicini, D., Speierer, S. and Jakob, W., 2021. Path replay backpropagation: differentiating light paths using constant memory and linear time.
[5] Finnendahl, U., et. al., 2025. Differentiable geometric acoustic path tracing using time-resolved path replay backpropagation.