Got it running today and it's basically working.
@Daverz : I didn't understood your whole script and I made a simpler version which I will refine later based on yours. I wondered what the "remix" command is doing.
This is how I did it and I hope it's correct:
First I exported the IR files of both channels (left and right speaker) from the REW sweeps (Options: 32 bit Floats; Export measured IR, normalize sample to peak value). The sweeps were taken at 48 kHz sampling rate. This is important for the filters that also has to be generated based on 48 kHz.
Opening the file for the left channel with audacity looks like this and it seems to be nomalized to -1:
These two files must be converted to pcm files with sox so that they can be used as input data for DRC:
Code:
sox rew_ir_left.wav -t f32 -r 48000 -c 1 rew_ir_48_left.pcm
sox rew_ir_right.wav -t f32 -r 48000 -c 1 rew_ir_48_right.pcm
Now the filters can be generated with DRC:
Code:
drc --BCInFile=/home/marco/DRC_room_correction/rew_ir_48_left.pcm --PSOutFile=/home/marco/DRC_room_correction/filter_48_left.pcm --PSPointsFile="/usr/share/drc/target/48.0 kHz/pa-48.0.txt" --MCFilterType=N --PLMaxGain=1.2 --MSNormType=E --MSNormFactor=1 "/usr/share/drc/config/48.0 kHz/erb-48.0.drc"
drc --BCInFile=/home/marco/DRC_room_correction/rew_ir_48_right.pcm --PSOutFile=/home/marco/DRC_room_correction/filter_48_right.pcm --PSPointsFile="/usr/share/drc/target/48.0 kHz/pa-48.0.txt" --MCFilterType=N --PLMaxGain=1.2 --MSNormType=E --MSNormFactor=1 "/usr/share/drc/config/48.0 kHz/erb-48.0.drc"
To work as input for a convolver the resulting pcm files have to be converted to wav again:
Code:
sox -t f32 -r 48000 -c 1 filter_48_left.pcm filter_48_left.wav
sox -t f32 -r 48000 -c 1 filter_48_right.pcm filter_48_right.wav
As convolver I used jconvolver that can be started from the terminal and appears in jack.
It can be started with
where jc.config is a config file that looks like:
Code:
# This file is for use at 48 kHz.
#
#
# Verzeichnis wo die Filter files sind:
#
#/cd /home/
#
# in out partition maxsize
# ---------------------------------------------------------------
/convolver/new 2 2 1024 65536
#
# in out gain delay offset length chan file
# --------------------------------------------------------------------------
/impulse/read 1 1 1 0 0 0 1 filter_48_left.wav
/impulse/read 2 2 1 0 0 0 1 filter_48_right.wav
Here I'm not sure what's the correct setting for partition and maxsize and if this does have any effect at all. Does anybody know?
Is there any better convolver than jconvolver?
I then use Carla to route the audio from my DAW or from the Pulse2Jack sink through jconvolver:
The left channel (=left speaker) is corrected by the left inverse IR and the right speaker signal by the right IR file.
The correction works very good, except of one thing for which I didn't find a solution yet. For all settings I have tested the sound is amplified by the filter which lead to clipping. For instance with a filter generated by:
Code:
--BCInFile=/home/marco/DRC_room_correction/rew_ir_48_left.pcm --PSOutFile=/home/marco/DRC_room_correction/filter_48_left.pcm --PSPointsFile="/usr/share/drc/target/48.0 kHz/pa-48.0.txt" --MCFilterType=N --PLMaxGain=1.2 "/usr/share/drc/config/48.0 kHz/erb-48.0.drc"
the volume after jconvolver is ~0.6 dB louder while with --PLMaxGain=4 its much worse and it's almost 5 dB louder. I played with the normalization setting (
MSNormType and
MSNormFactor), but the resulting filters (when opening the wav files) look identical and the signal though the filter is amplified.
Another thing I wonder how DRC is taking care if one is using an 8 inch or e.g. 5 inch woofer. How can I prevent that DRC is boosting low frequencies which my speaker can't reproduce?
Under the line that's really great and on par with Sonarworks.