Simple bash script which generates convolution filters for your stereo speakers with drc (DRC-FIR).
drc and sox executables must be in your PATH. We tested the script with drc 3.2.3 and sox v14.4.2 on Windows Git Bash.
To create convolution filters for a system using a sample rate other than 44.1 Khz, you'll also need a drc configuration file for 48.0 Khz impulse response files (Such as one from align2).
Measure your left and right speaker separately with REW, then export the impulse responses with "Export all impulse responses as WAV".
Replace /path-to-rew-exports/[left|right]-speaker-impulse-response.wav
with the file name you exported impulse responses to.
sox /path-to-rew-exports/left-speaker-impulse-response.wav -t f32 ./tmp/left-speaker-impulse-response.pcm
sox /path-to-rew-exports/right-speaker-impulse-response.wav -t f32 ./tmp/right-speaker-impulse-response.pcm
Copy the sample config file (which contains drc arguments on each line) to any directory you prefer and modify it to suit your needs.
mkdir ~/.drc-wrapper/
cp drc-args-sample.txt ~/.drc-wrapper/drc-args.txt
You'll at least need to edit the following arguments:
Path to calibration file for your microphone, which contains frequency and SPL offset value on each line. The first line must be the SPL offset value for 0 Hz and the last line is for 22000 Hz, otherwise drc fails to load the file.
See MCPointsFile documentation on DIR-FIC Website for more details.
The target curve of your speakers. DRC tries to make frequency response close to the curve as possible by applying filters.
We created a sample target curve file which I derived from B&K Curve from DRC Designer and Harman Target Curve, which you could use as a starting point.
See PSPointsFile documentation on DIR-FIC Website for more details.
Change /path/to/align2/files/drc/48.0KHz/minimal-48.0.drc
to whichever drc config file you prefer.
See this section on drc documentation for info on choosing a config file.
Change the current directory to this repo and run the script with the following format:
./drc-wrapper.sh <config_file> <sample_rate> <out_file>
For example, to create a filter from 48Khz impulse responses using the config file you created in the previous step, run the following command.
Replace /path/to/convolver-filters/
part with the directory you'd like to export a filter to.
./drc-wrapper.sh ~/.drc-wrapper/drc-args.txt 48000 /path/to/convolver-filters/convolver-filter.wav