# Compute impulse response of a cavity for sound waves

Given a (closed or not) surface and a point emitting a spherical sound wave, how can I calculate the wave amplitude in any point of space, considering reflections on this surface ?

The idea is to determine the response of the cavity to a dirac impulse, for use in convolution reverb afterwards (and also mainly because the question interests me). The main idea is answering the question "If I am at this point of the cavity and say 'Hello World', what echo will I hear ?".

Remembering some lessons on waves some years ago, I tried to go with Huygens-Fresnel principle, by computing the value of wave after exaclty 1, 2, 3 etc.. reflexions and summing up everything, but I couldn't find out how to properly formulate it in this case.

Going deeper into Wikipedia, the Kirchhoff integral theorem, but my attempts to use it where quite unsuccessful as well.

Is there some formula of this kind that would stand for my problem (and maybe that could be exactly resolved in cases with a lot of symmetries), or should I just get down to the wave equation and compute numerically the value (and thus, how should it be done with a dirac impulse as initial conditions) ?

There are a few things to think about here.

First - a cavity will in general have modes. For a simple shape (rectangular etc) these modes can be calculated; as shapes get more complex, this becomes very hard to do. Let's assume your shape is nicely symmetrical, so you can compute the modes.

Second, for each mode you will have associated losses: if you stimulate a mode, it will lose energy over time. These losses are due to energy coupling to the walls, as well as losses due to attenuation of the sound in air. Obviously a cavity with an opening will have greater losses - sound energy can be carried away by the waves that leave the opening. A mode that has an antinode at an opening will be lossier than a mode that has a node there.

Finally - when you are at a given point inside your cavity, the degree to which a delta impulse couples energy into each mode (given that delta = all frequencies) depends on the position relative to nodes / antinodes. A stimulus near a node will not excite that mode; a stimulus near an antinode will.

Putting all that together gives you some basis for the impulse response for your cavity - but it's obviously only a start.