## Synthesizing impulse responses

Everything and anything, but nothing about the LinuxSampler project.
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Contact:

### Synthesizing impulse responses

If I calculate an impulse response like this one:

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?

Last edited by dahnielson on Sat Mar 22, 2008 12:58 pm, edited 2 times in total.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Contact:

### Re: Synthesizing impulse responses

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 ?)
Last edited by dahnielson on Sat Mar 22, 2008 1:00 pm, edited 10 times in total.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

Consul
Moderator
Posts: 189
Joined: Wed Jan 23, 2008 11:19 pm
Location: Port Huron, Michigan, USA
Contact:

### Re: Synthesizing impulse responses

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.
Darren Landrum

dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Contact:

### Re: Synthesizing impulse responses

Consul wrote:I personally would love to see an audio ray tracer that takes materials into account and can spit out impulse responses.
Well that's what Impulse Modeler does in 2d:

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

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

Consul
Moderator
Posts: 189
Joined: Wed Jan 23, 2008 11:19 pm
Location: Port Huron, Michigan, USA
Contact:

### Re: Synthesizing impulse responses

Well, sure, there's commercial software that does it.

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

dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Contact:

### Re: Synthesizing impulse responses

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).
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

Consul
Moderator
Posts: 189
Joined: Wed Jan 23, 2008 11:19 pm
Location: Port Huron, Michigan, USA
Contact:

### Re: Synthesizing impulse responses

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.
Darren Landrum

dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Contact:

### Re: Synthesizing impulse responses

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.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

Consul
Moderator
Posts: 189
Joined: Wed Jan 23, 2008 11:19 pm
Location: Port Huron, Michigan, USA
Contact:

### Re: Synthesizing impulse responses

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.
Darren Landrum

dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Contact:

### Re: Synthesizing impulse responses

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.
Last edited by dahnielson on Sat Mar 29, 2008 6:26 pm, edited 2 times in total.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux