Digital Room Correction Project - Page 6 - diyAudio
Go Back   Home > Forums > Source & Line > PC Based

PC Based Computer music servers, crossovers, and equalization

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 26th March 2010, 11:44 AM   #51
diyAudio Member
 
Join Date: Oct 2009
Location: Sydney, Australia
Default BruteFIR config for concert hall reverb

For those interested, here is the BruteFIR config file I use when playing the concert hall impulses into the rear channels of a 5.1 set-up (3.1 channels at rear).

Code:
##
#	Version 6c - SqueezeBox
#
# Put in calculated delays relative to FL, FR bass units
#
# Use virtual output channels to provide delay to all surround channels, including to common physical sub-woofer.
# Add rear centre surround channel.
#
# Floating point DRC filters.
# 60Hz FIR crossover filters (4096 taps each)
# Concert hall impulse responses (32 bit) for side and surround channels. Also delayed.
# Surround and side channels will be created and sent to DSPA1, operating in external decoder mode.
# Delay applied to low passed sub signal prior to ouput to A500.
# FL, FR output via RME SPDIF direct to DCX, not ADA8000. 
#
# ADA8000 physical connections
# 	IN Channel			OUT Channel
#	
#	1 - Video			1 - Not used
#	2 - Video			2 - Not used
#	3 - Video			3 - Spkr Surr Left
#	4 - Video			4 - Spkr Surr Right
#	5 - Video			5 - Spkr Side Left
#	6 - Video			6 - Spkr Side Right
#	7 - Sqb left			7 - Spkr Sub
#	8 - Sqb right			8 - Spkr Rear Centre
##

## General Settings that overide defaults in .brutefir_defaults ##

float_bits: 32;             # internal floating point precision
sampling_rate: 44100;       # sampling rate in Hz of audio interfaces
#filter_length: 512,64;	    # length of filters
filter_length: 2048,64;    # length of filters
overflow_warnings: true;    # echo warnings to stderr if overflow occurs
#show_progress: true;       # echo filtering progress to stderr
show_progress: false;       # echo filtering progress to stderr
max_dither_table_size: 0;   # maximum size in bytes of precalculated dither
allow_poll_mode: false;     # allow use of input poll mode
modules_path: ".";          # extra path where to find BruteFIR modules
monitor_rate: false;        # monitor sample rate
#powersave: -70;		# pause filtering when input is below 70 db from 0db reference
powersave: false;	    # pause filtering when input is null samples
lock_memory: true;          # try to lock memory if realtime prio is set
sdf_length: -1;             # subsample filter half length in samples
convolver_config: "~/.brutefir_convolver"; # location of convolver config file

########################################## COEFFS ##

coeff "left_drc_erb_pcm"
{
	#filename: "/home/bryan/drc filters/l_erb-44.1.wav"; # 32768 max size
	filename: "/home/bryan/drc filters/l_erb-44.1.raw"; # 32768 max size
	format: "FLOAT_LE";     # file format
	#attenuation: 6;		# attenuation of filter coefficents in dB
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         	# how long in blocks
	skip: 0;            	# how many bytes to skip
	shared_mem: false;  	# allocate in shared memory
};

coeff "right_drc_erb_pcm"
{
	#filename: "/home/bryan/drc filters/r_erb-44.1.wav"; # 32768 max size
	filename: "/home/bryan/drc filters/r_erb-44.1.raw"; # 32768 max size
	format: "FLOAT_LE";     # file format
	#attenuation: 6;		# attenuation of filter coefficents in dB
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;     	# how long in blocks
	skip: 0;            	# how many bytes to skip
	shared_mem: false;  	# allocate in shared memory
};

coeff "left_omni_hall"
{
	filename: "/home/bryan/impulse_responses/omni/l_s1_r1_o.raw"; # 4 sec impulse response, re-sampled to 44100Hz from 48000Hz, omni mic 
	format: "FLOAT_LE";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         	# how long in blocks
	skip: 0;            	# how many bytes to skip
	shared_mem: false;  	# allocate in shared memory
};

coeff "right_omni_hall"
{
	filename: "/home/bryan/impulse_responses/omni/r_s1_r1_o.raw"; # 4 sec impulse response, re-sampled to 44100Hz from 48000Hz, omni mic 
	format: "FLOAT_LE";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         	# how long in blocks
	skip: 0;            	# how many bytes to skip
	shared_mem: false;  	# allocate in shared memory
};

coeff "mono_omni_hall"
{
	filename: "/home/bryan/impulse_responses/omni/mono_s1_r1_o.raw"; # 4 sec impulse response, re-sampled to 44100Hz from 48000Hz, omni mic 
	format: "FLOAT_LE";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         	# how long in blocks
	skip: 0;            	# how many bytes to skip
	shared_mem: false;  	# allocate in shared memory
};

coeff "100hz_lowpass"
{
	filename: "/home/bryan/BruteFIR/brutefir-1.0k/100hz_lowpass.txt"; # 4096 taps
	format: "text";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         # how long in blocks
	skip: 0;            # how many bytes to skip
	shared_mem: false;  # allocate in shared memory
};

coeff "100hz_highpass"
{
	filename: "/home/bryan/BruteFIR/brutefir-1.0k/100hz_highpass.txt"; # 4096 taps
	format: "text";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         # how long in blocks
	skip: 0;            # how many bytes to skip
	shared_mem: false;  # allocate in shared memory
};

coeff "60hz_lowpass"
{
	filename: "/home/bryan/BruteFIR/brutefir-1.0k/60hz_lowpass.txt"; # 4096 taps
	format: "text";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         # how long in blocks
	skip: 0;            # how many bytes to skip
	shared_mem: false;  # allocate in shared memory
};

coeff "60hz_highpass"
{
	filename: "/home/bryan/BruteFIR/brutefir-1.0k/60hz_highpass.txt"; # 4096 taps
	format: "text";     # file format
	attenuation: 0;		# attenuation of filter coefficents in dB
	blocks: -1;         # how long in blocks
	skip: 0;            # how many bytes to skip
	shared_mem: false;  # allocate in shared memory
};

########################################## INPUTS ##

input	"sqb_left", "sqb_right"
{	
	device: "alsa" { param: "hw:R15"; } ;	    # module and parameters to output audio
	sample: "S24_4LE";   		# sample format
	channels: 18/6,7;	  	# number of open channels / which to use
	delay: 0,0;        		# delay in samples for each channel
	maxdelay: -1;       		# max delay for variable delays
	mute: false,false;  		# mute active on startup for each channel
};

########################################### OUTPUTS ##

# Specific speaker delays in samples @ 44100Hz and @ 48000Hz, relative to longest distance (FL, FR bass units)
#
# FL (satellite) 35 38 (done in DCX)
# FR (satellite) 35 38 (done in DCX)
# Sur Left 	69 76
# Sur Right	85 92
# Rear centre	219 238
# Sub woofer	154 168

output "spkr_front_left", "spkr_front_right", "spkr_sur_left", "spkr_sur_right", "spkr_side_left", "spkr_side_right", "spkr_sub", "spkr_rear_centre", "sur_left_sub", "sur_right_sub", "rear_centre_sub", "side_left_sub", "side_right_sub" 
{
	device: "alsa" { param: "hw:R15"; } ;	    	# module and parameters to output audio
	sample: "S24_4LE";   				# sample format
	channels: 18/16,17,2,3,4,5,6,7;   		# number of open channels / which to use
	mapping: 0,1,2,3,4,5,6,7,6,6,6,6,6;			# map virtual surround sub outputs to real sub
	delay: 0,0,14769,14785,0,0,154,14919,14700,14700,14700,14700,14700;  	# delay in samples for each channel. For sub, need to delay 1.5 metres = 4.373 milliseconds. 
							# @ 48KHz sampling = 210 samples.
							# @ 44100Hz sampling = 193 samples. Surround channels delay: 0.3 seconds = 14700 samples, 0.25 seconds = 11025 samples.
	maxdelay: -1;       				# max delay for variable delays
	mute: false,false;  				# mute active on startup for each channel
	dither: false;      				# apply dither
};

############################################# FILTERS  ##

########   LEFT CHANNEL

########################

##
## INPUT FILTERS ##
##

filter "front_left_eq"
{
	from_inputs: "sqb_left"/1.5;
	to_filters: "front_left_highpass", "sub_output";
	#coeff: -1;			# no filtering, just pass through
	coeff: "left_drc_erb_pcm";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "sur_left_ir"
{
	from_inputs: "sqb_left"/1.5;
	to_filters: "sur_left_lowpass", "sur_left_highpass";
	#coeff: -1;			# no filtering, just pass through
	coeff: "left_omni_hall";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "side_left_ir"
{
	from_inputs: "sqb_left"/1.5;
	to_filters: "side_left_lowpass", "side_left_highpass";
	#coeff: -1;			# no filtering, just pass through
	coeff: "left_omni_hall";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

##
## FINAL FILTERS TO OUTPUTS ##
##

filter "front_left_highpass"
{
	from_filters: "front_left_eq";
	to_outputs: "spkr_front_left";
	#coeff: -1;			# no filtering, just pass through
	coeff: "60hz_highpass";		# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "sur_left_highpass"
{
	from_filters: "sur_left_ir";
	to_outputs: "spkr_sur_left"/1.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_highpass";	# FIR filter
	coeff: "60hz_highpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "sur_left_lowpass"
{
	from_filters: "sur_left_ir";
	to_outputs: "sur_left_sub"/6.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_lowpass";	# FIR filter
	coeff: "60hz_lowpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "side_left_highpass"
{
	from_filters: "side_left_ir";
	to_outputs: "spkr_side_left";
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_highpass";	# FIR filter
	coeff: "60hz_highpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "side_left_lowpass"
{
	from_filters: "side_left_ir";
	to_outputs: "side_left_sub"/6.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_lowpass";	# FIR filter
	coeff: "60hz_lowpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

###############################

##### RIGHT CHANNEL

###############################

##
## INPUT FILTERS ##
##

filter "front_right_eq"
{
	from_inputs: "sqb_right";
	to_filters: "front_right_highpass", "sub_output";
	#coeff: -1;			# no filtering, just pass through
	coeff: "right_drc_erb_pcm";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "sur_right_ir"
{
	from_inputs: "sqb_right";
	to_filters: "sur_right_lowpass", "sur_right_highpass";
	#coeff: -1;			# no filtering, just pass through
	coeff: "right_omni_hall";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "side_right_ir"
{
	from_inputs: "sqb_right";
	to_filters: "side_right_lowpass", "side_right_highpass";
	#coeff: -1;			# no filtering, just pass through
	coeff: "right_omni_hall";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

##
## FINAL FILTERS TO OUTPUTS ##

filter "front_right_highpass"
{
	from_filters: "front_right_eq";
	to_outputs: "spkr_front_right";
	#coeff: -1;			# no filtering, just pass through
	coeff: "60hz_highpass";		# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "sur_right_highpass"
{
	from_filters: "sur_right_ir";
	to_outputs: "spkr_sur_right";
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_highpass";	# FIR filter
	coeff: "60hz_highpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "sur_right_lowpass"
{
	from_filters: "sur_right_ir";
	to_outputs: "sur_right_sub"/6.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_lowpass";		# FIR filter
	coeff: "60hz_lowpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "side_right_highpass"
{
	from_filters: "side_right_ir";
	to_outputs: "spkr_side_right";
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_highpass";	# FIR filter
	coeff: "60hz_highpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "side_right_lowpass"
{
	from_filters: "side_right_ir";
	to_outputs: "side_right_sub"/6.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_lowpass";		# FIR filter
	coeff: "60hz_lowpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

###############################

##### REAR CENTRE CHANNEL

###############################

filter "rear_centre_ir"
{
	from_inputs: "sqb_left"/3.0, "sqb_right"/3.0;
	to_filters: "rear_centre_lowpass", "rear_centre_highpass";
	#coeff: -1;			# no filtering, just pass through
	coeff: "mono_omni_hall";	# floating pt filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "rear_centre_highpass"
{
	from_filters: "rear_centre_ir";
	to_outputs: "spkr_rear_centre"/4.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_highpass";	# FIR filter
	coeff: "60hz_highpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

filter "rear_centre_lowpass"
{
	from_filters: "rear_centre_ir";
	to_outputs: "rear_centre_sub"/6.0;
	#coeff: -1;			# no filtering, just pass through
	#coeff: "100hz_lowpass";		# FIR filter
	coeff: "60hz_lowpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

################ PHYSICAL SUB WOOFER PROCESSING

filter "sub_output"
{
	from_filters: "front_left_eq", "front_right_eq";
	to_outputs: "spkr_sub"/3.0;
	#coeff: -1;			# no filtering, just pass through
	coeff: "60hz_lowpass";		# FIR filter
	process: 0;        		# process index to run in (-1 means auto)
	delay: 0;           		# predelay, in blocks
	crossfade: false;   		# crossfade when coefficient is changed
};

##########   END FILTERS ############################################
  Reply With Quote
Old 2nd November 2011, 09:07 PM   #52
diyAudio Member
 
Join Date: Feb 2009
Location: UK
OK, so I'm having a go with this. I cobbled together a measurement microphone using a Panasonic WM-61A capsule and Veroboard pre-amplifier using a single OPA134 and 9V battery, with a long output lead, allowing me to site the noisy PC outside the listening room. This connects to Line In on one channel of my M Audio 2496 card. I placed the microphone in a typical listening position, with the capsule on a short 'stalk' of wire to separate it from nearby surfaces.

I'm using a 'sacrificial' pair of Mission 702e speakers, in case something goes wrong!

First problem encountered was that the DRC-supplied 'rec_imp' utility ("Simple Automated IR Measuring Tool") didn't recognise my USB DAC (which is how I get the audio to the amplifier). The DRC documentation mentions that you can use other tools to measure the impulse response, so I downloaded HomeTheatreShack's free 'REW v5.0' tool which is a magnificently user-friendly graphical program with all sorts of facilities for microphone calibration etc. I imported a WM-61A calibration file found somewhere on the web. Using this, I was able to perform a 23 second sweep from 20Hz-20kHz and extract the impulse responses for left and right. These can be saved as integer .wav files.

So far so good. Next problem is that DRC requires a headerless impulse response file, so I loaded each impulse response wav file into CoolEdit96 (they look and sound like impulse responses!) and re-saved as raw 16 bit .pcm. I then changed the supplied normal-44.1.drc DRC config file so that BCInFileType is 'I' (integer) not 'F'. I could then run DRC from the command line! (twice) I then had raw 32 bit float files for Left and Right and room correction.

Intending to use the ConvolverVST-enabled Spotify-based Fidelify as my test source, I needed to get the two room correction filters into a stereo .wav file (I think). I did this by importing both 32 bit float files into Audacity, and did a 'Combine to stereo' operation. Then I saved the resulting file as a .wav.

Fidelify does actually run on my machine! I called up the ConvolverVST control panel and selected my new stereo room correction file. A couple of seconds later, music emerged from the speakers! I can turn the filter on and off with a tick box, to compare it with the 'raw' setup.

Early days, but not impressed so far! It's doing something but there's some sort of anti-phase effect in there, lack of top end brightness, and a sense of suppression of transients..? It's a relief to turn it off to be honest.

Things I don't know that I'm doing correctly:

(1) Should I save the impulse response from REW5.0 with the 'normalised' option? My gut feeling is that this would be wrong: if one channel reaches the listener more quietly than the other, then shouldn't this be compensated for in the correction? If I normalise the impulse response individually, this information will be lost.
(2) Is the DRC config parameter BcInFileType the one that refers to the impulse response, and is type 'I' correct for the .wav I'm supplying?
(3) When I munge the two room correction filters together to a stereo .wav for ConvolverVST, am I getting Left and Right the right way round?
(4) The documentation for DRC says:
Quote:
DRC doesn’t automatically compensate for delays caused by loudspeaker misplacement and having the two channels with near to perfect direct sound, both in phase and magnitude, makes any difference in the arrival time immediately and clearly audible, with a nasty phasey sound and a blurred stereo image. Less than 10 cm are enough to cause clearly audible problems, so take your time to measure the distance from both loudspeakers and the listening position before doing any measure, and also do your measures by placing the microphone exactly at the listening position.
Surely room correction based on impulse response should automatically compensate for any placement of the speakers..? (One of the advantages of such a system should be that if you can't get your listening position exactly central, the system can compensate for it, I would have thought.) Is DRC not reproducing the relative delays between Left and Right, but attempting to 'line them up' in time, based on the position of the loudest part of the recorded impulse, or something like that? I may have the wrong idea of what room correction aims to achieve, however.

I would be very keen to hear what sorts of experience other users of DRC have had, and if they have any top tips.

Last edited by CopperTop; 2nd November 2011 at 09:12 PM.
  Reply With Quote
Old 3rd November 2011, 06:02 AM   #53
diyAudio Member
 
Join Date: Oct 2009
Location: Sydney, Australia
Hi. Room correction can be tricky to get right. Especially with lots of manual intermediate steps.

To get around the multiple step dance I eventually bought some software (Audiolense Juice HiFi) that runs under Windows. It does end-to-end processing, from the sweep recording through to creating the correction filters. The filters can be changed graphically. It also allows mike correction files to be used. I believe the demo version will allow you to have a bit of correction done (40 secs?), so you can try out the software and see if it will work on your system. I would recommend giving it a go. If it doesn't work out then I'd go back to the DRC process.
  Reply With Quote
Old 3rd November 2011, 09:21 PM   #54
diyAudio Member
 
Join Date: Feb 2009
Location: UK
@boconnor

I may just give Audiolense a trial, but it's not cheap is it!

A question to all room correction experts: when measuring the impulse response by swept sine wave, there's no problem in having an unknown latency between the output and the input is there? In my setup the output is a PCM2704 USB DAC, and the mic input feeds my M Audio 2496. Obviously there will be some difference in the timing between the two. I'm assuming, though, that the result of this will be to shift the measured room response by a few milliseconds either way, which shouldn't matter to the end result. Am I correct in thinking this?
  Reply With Quote
Old 4th November 2011, 08:22 AM   #55
diyAudio Member
 
Join Date: Oct 2009
Location: Sydney, Australia
Quote:
Originally Posted by CopperTop View Post
A question to all room correction experts: when measuring the impulse response by swept sine wave, there's no problem in having an unknown latency between the output and the input is there? In my setup the output is a PCM2704 USB DAC, and the mic input feeds my M Audio 2496. Obviously there will be some difference in the timing between the two. I'm assuming, though, that the result of this will be to shift the measured room response by a few milliseconds either way, which shouldn't matter to the end result. Am I correct in thinking this?
If the delay is consistent between both L and R channels it should be no problem.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Room Correction and Foobar2000 Convolve mr.duck Digital Line Level 1 23rd June 2009 04:49 PM
DIY DSP for Digital Room Correction OzOnE_2k3 Digital Source 114 17th June 2008 08:25 PM
Audyssey MultEQ XT Digital Room Correction wigginjs Multi-Way 37 24th February 2008 06:10 PM
I need help with digital Room-correction Radian Multi-Way 1 7th February 2007 07:10 PM


New To Site? Need Help?

All times are GMT. The time now is 06:47 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2