Page 1 of 3

Synthesizing impulse responses

Posted: Wed Mar 19, 2008 2:02 pm
by dahnielson
If I calculate an impulse response like this one:

Image

How do I turn that into a WAV impulse response to be used in a convolution reverb, assuming that each bar is aligned to a sample?

Answers further down the threat.

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 6:10 pm
by dahnielson
What I'm trying to do is to ray trace sound being emitted from one point starting with a level of 1.0f. When the ray intersect a polygon ("walls") the level is attenuated according by the associated materials absorption coefficient and the ray is reflected, attenuated and reflected until it either has decayed 60 dB or reached some other set limit (like order of reflections). The rays are "recorded" when intersecting a receptor, each ray keep track of the distance (= time) it's traveled and get recorded in the impulse response.

What I've learned is that an ideal pulse is a single sample of maximum amplitude because it contain all frequencies (simulated by clapping hands or a starting pistol when recording real world IRs). So I guess the ray only need to keep track of one level (initially 1.0f). But how will materials with uneven absorption over the frequencies attenuate that level?

Will that attenuation be dependent on the distance the ray has traveled? Since velocity, wavelength and frequency are interrelated:

f = V/d

With f being the frequency that is attenuated, V is the velocity (344 m/s) and d the distance. Making a ray that has traveled 0.80 m being attenuated by the absorption coefficient for 430 Hz (being interpolated between the 250 and 500 Hz value). Is this a correct model?

(Hmm... or should that be f = V/2d ?)

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 6:28 pm
by Consul
I don't think this is exactly what you're after, but the CLAM team developed an audio ray-tracer using their framework. There's a blog post here: http://parumi.wordpress.com/2008/01/25/ ... -and-clam/

Their goal was to emulate the psychoacoustics of a room, which is a step beyond creating the impulse responses of a modeled room, so you might get some help from it. I personally would love to see an audio ray tracer that takes materials into account and can spit out impulse responses. :D

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 6:48 pm
by dahnielson
Consul wrote:I personally would love to see an audio ray tracer that takes materials into account and can spit out impulse responses. :D
Well that's what Impulse Modeler does in 2d:

http://www.voxengo.com/product/imodeler/

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 6:56 pm
by Consul
Well, sure, there's commercial software that does it. :P

Hopefully, that CLAM stuff was useful to you. It was the first thing I thought of.

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 7:56 pm
by dahnielson
Consul wrote:Hopefully, that CLAM stuff was useful to you. It was the first thing I thought of.
Not really. They didn't describe how they created their database of pre-rendered IRs. But I think I'm starting to grok it (see my updated post above).

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 10:47 pm
by Consul
Well, I tried, anyway. I'm hip-deep in my own research project at the moment. I'm hoping to have a preliminary whitepaper done in a few days.

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 11:34 pm
by dahnielson
Guess I could start by doing materials with flat frequency response. I do have an idea for using a very simple radiosity approach that let you calculate the scene in an intermediate first step and place the receptor in a second for final calculation of the IR.

Re: Synthesizing impulse responses

Posted: Wed Mar 19, 2008 11:52 pm
by Consul
Because different materials will produce different filtering effects on the original impulse, I would imagine that each material would have its own impulse response that would get added to the final response for the room. Perhaps the effect of each material can be simulated by a FIR filter on that ray.

I'm just thinking out loud here. Feel free to ignore me.

Re: Synthesizing impulse responses

Posted: Thu Mar 20, 2008 12:18 am
by dahnielson
My radiosity idea is simply to calculate a lot of responses in a discreetly spaced grid on each wall and then use them to calculate the next order of responses (that's the intermediate step). The number of iterations required depend on the order of reflections. The complexity is dependent on the size of the scene (numbers of responses calculated).

The filtering effect of the materials would be the absorption/reflection expressed as absorption coefficients:

Code: Select all

Material                           	125 Hz 	250 Hz 	500 Hz 	1 kHz 	2 kHz 	4 kHz
Vinyl tile or linoleum on concrete  	0.02  	0.03  	0.03  	0.03  	0.03  	0.02
The question still remains how do I filter the pulse using these coefficients?

P.S. OK, could I have possibly picked a worse example? Linoleum has an almost flat response making the example rather moot. :D