Simple Automated IR Measuring Tool

From DRC

Jump to: navigation, search

Measuring the room impulse response for use with Brutefir is currently quite complicated. There are some commercial tools which do a good job, but I really want to use Linux and also use a headless machine with no mouse or keyboard.

So to fill this need I have written a simple tool which should run on Linux, Windows and possibly also Mac, which simply plays a log sweep through your system and records the result. It then generates the room IR from this data.

At this stage its something that I use for my own purposes only and it's still quite simple, however, it is hopefully useful for others. You don't get much in the way of documentation, but it only takes a few params.

Basically, download the file. Under windows you get a pre-compiled executable. Under linux you probably just type "make" to get one. (You may need to edit the makefile to suit your architecture). Then run it with:

This gives you basic usage instructions.

./rec_imp 

This will list all your devices

./rec_imp -l

So in my system I can use the following to save the impulse response as "rec.pcm", using a 45 second sweep from 10Hz to 21Khz, on the first input and output channel available on the soundcard:

rec_imp rec.pcm 44100 10 21000 45 0:0 0:0

If you add in a couple of simple scripts then you can now automatically measure all your audio channels, generate the filters and install them into Brutefir or Convolver. For example, one user has reported the following:

I was successful with rec_imp and DRC & Convolver:

I am using MCE2005 with WMP10 and Convolver, DRC and rec_imp all latest and greatest releases. My sound card is an M-Audio Transit USB set to bit-perfect passthrough, 44100, 16bit and I am using the ASIO4ALL driver (could not get right levels of latency using the m-audio drivers, which resulted in 'cracking' sounds during the sweep). My microphone is probably a weak link - am using a Radio Shack boundary mic (next stop I will try to correct for the mic).

All of this feeds via S/PDIF into a Marantz 5200 and then to 6.1 B&W (600 series) speakers. I set the Marantz to play 6 channel stereo for my tests (which is independant of this experiment).

The following uses rec_imp to measure 2 channel - a Left then a Right sweep to build left and right files for Convolver via DRC. My batch file looks like this:


  Set REC_IMP=c:\Program Files\DRC\Rec_Imp
  Set DRC_DIR=C:\Program Files\DRC\DRC
  Set CONVOLVER=c:\Program Files\DRC\Convolver
  cd %REC_IMP%
  rec_imp.exe LeftSpeakerImpulseResponse.pcm 44100 20 21000 20 0:1 0:1
  move /y LeftSpeakerImpulseResponse.pcm "%DRC_DIR%"
  rec_imp.exe RightSpeakerImpulseResponse.pcm 44100 20 21000 20 1:1 1:1
  move /y RightSpeakerImpulseResponse.pcm "%DRC_DIR%"
  cd %DRC_DIR%
  drc.exe --BCInFile=LeftSpeakerImpulseResponse.pcm --PSPointsFile=bkHB.txt --PSOutFile=LeftSpeaker-rpsERB.pcm erb.drc
  move /y LeftSpeaker-rpsERB.pcm "%CONVOLVER%
  drc.exe --BCInFile=RightSpeakerImpulseResponse.pcm --PSPointsFile=bkHB.txt --PSOutFile=RightSpeaker-rpsERB.pcm erb.drc
  move /y RightSpeaker-rpsERB.pcm "%CONVOLVER%

Get rid of the --PSPointsFile arguments to DRC if you don't want to tweak the points file.

I solved the 'clicking' by increasing the latency by using ASIO4ALL instead of the regular drivers for my card (M-Audio Transit)


Please add feedback, comments or tips here, or drop me an email: ed (at) duffroomcorrection dot com

Updates

30/11/2005 - New update which moves to using the latest version of RtAudio which should fix most problems that users were seeing on Asio systems. However, windows still seems very picky about the exact audio params you open the audio device with and so it would be extremely useful if you can give feedback on what works and what doesn't. Please try the official windows binary at first and if you get problems then try the binary releases from JP below and report the log files back to Ed Wildgoose (email as above)

Downloads

(John Pullans version below is now largely similar to the release above, but he has setup the code for easy compilation with Visual Studio and also made available some versions which force the use of certain audio drivers, and/or have extra debugging info enabled so that you can report problems to me)

Or try jrp's version:

NB: The ASIO versions seem to crash on some systems [Ed says: This new version seems to fix this on most machines. Please report problems to me]]

Personal tools