Python Open Room Correction (PORC) - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

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 3rd July 2012, 12:41 AM   #1
diyAudio Member
 
Join Date: Nov 2011
Location: Maryland
Default Python Open Room Correction (PORC)

I've created the Python Open Room Correction (PORC) project to generate room correction filters for OpenDRC, or any other convolution engine for that matter. The filter is based on the work of work of Dr. Balazs Bank.

PORC is intended to be a free command line tool. If you desire a fancy GUI feel free to fork this project (or pay for an expensive commercial software package).

PORC allows one to specify a target curve and generate the corresponding loudspeaker-room correction filters. The filters may easily be imported into OpenDRC. I've been listening on my system for the last few weeks and the result is excellent. It even sounds fantastic well outside the targeted sweet zone. Attached is a screen shot of my left channel speaker results.

Room EQ Wizard (REQ) is an excellent (and free) tool for measuring the loudspeaker-room impulse response of your system.

I realize I can do a much better job with documentation; this project is intended to be a work in progress. See the link above for the code.

/Mason
Attached Images
File Type: png eqplot.png (171.8 KB, 1187 views)
  Reply With Quote
Old 3rd July 2012, 04:34 AM   #2
diyAudio Member
 
Join Date: Jun 2009
Interesting approach to the filter bank synthesis. How do the equalized and unequalized phase response compare? If I were equalizing this example the low tech way I'd throw probably 11 peaking patches at it and generally expect to get a fairly linear result.
  Reply With Quote
Old 3rd July 2012, 12:29 PM   #3
chaparK is offline chaparK  Luxembourg
diyAudio Member
 
Join Date: Apr 2010
Location: Luxembourg
Nice ! Congrats for the hard work !

I've checked your website for an example of output file (i.e. FIR coefficients). Could you point to such a file? I'd like to look at the file format and see how much effort is required to use it with my own convolution device.

Cheers

Nick

(Looking at the equalizing curve, there's a boost by over 20 dB in the lower end. One has to be careful not to blow the speaker.)
  Reply With Quote
Old 3rd July 2012, 01:14 PM   #4
diyAudio Member
 
Join Date: Feb 2009
Location: Brisbane, Australia
Excellent idea, I'd been thinking of a similar project with python, I'll play with your code later in the week and save myself any duplication and just send pull request your way if I have anything to add

I'll also test it on osx 10.7 too.

With ipython I find less need for gui stuff (I find it distracting anyway)

hint ipython notebooks are pretty cool:
Code:
ipython notebook --pylab inline
I hadn't seen the papers from Dr Bank either so looks like I've got some reading to do!

Last edited by hochopeper; 3rd July 2012 at 01:17 PM.
  Reply With Quote
Old 3rd July 2012, 02:12 PM   #5
diyAudio Member
 
Join Date: Nov 2011
Location: Maryland
Quote:
Originally Posted by twest820 View Post
How do the equalized and unequalized phase response compare?
The filter is minimum-phase, if that's what you're referring to.

In any regard it sounds fantastic. This loudspeaker-room correction filter, in combination with OpenDRC convolution, completely transforms my system. The result is "silky smooth." In retrospect my system definitely sounds "bright" and a little "harsh" without the filter. There's no going back.

One could test the filter with the free Foobar2000 convolution plugin on Windows. On Linux, one could try jcgui with Jack.

All one needs to do is purchase a calibrated measurement microphone and a descent audio interface. Room EQ Wizard is an excellent free software tool that will allow you to measure the impulse response of your speaker-room system. When measuring, make sure the audio playback device and the microphone are running on the same clock (i.e. audio interface).

I designed the script to be as simple as possible. I've had success in the past with DRC-FIR, but the learning curve is fairly high and setup/configuration can be a pain. The scientific computing packages for Python are quite nice.
  Reply With Quote
Old 3rd July 2012, 02:21 PM   #6
diyAudio Member
 
Join Date: Nov 2011
Location: Maryland
Quote:
Originally Posted by chaparK View Post
Nice ! Congrats for the hard work !
Thanks. The real credit goes to Dr. Bank for developing the parallel filter. I took his MATLAB code and ported it to Python in order to make it more accessible to folks.

Quote:
Originally Posted by chaparK View Post
I've checked your website for an example of output file (i.e. FIR coefficients). Could you point to such a file?
If you look in the 'data' directory on Github, you can find the measured impulse response of my system. You can run this data through the filter to produce an example. The filter output is a mono wav file. You can use 'sox' to change it to your desired format.

Quote:
Originally Posted by chaparK View Post
(Looking at the equalizing curve, there's a boost by over 20 dB in the lower end. One has to be careful not to blow the speaker.)
The curves are actually normalized, but I shifted them to all fit on the same graph.

Last edited by greenm01; 3rd July 2012 at 02:29 PM.
  Reply With Quote
Old 3rd July 2012, 02:26 PM   #7
diyAudio Member
 
Join Date: Nov 2011
Location: Maryland
Quote:
Originally Posted by hochopeper View Post
With ipython I find less need for gui stuff (I find it distracting anyway)
iPython is great! I believe the Scientific Python tools are viable alternatives to MATLAB and all the other commercial packages that cost an arm and a leg for non-student editions.

For this type of application working on the command line is very fast. The script does produce a nice graph of the output (see initial screenshot). The initial learning curve might be a little high to setup Python and all the required dependencies, but getting ones hands into the guts of things is in the spirit of open source and DIY anyway...!
  Reply With Quote
Old 3rd July 2012, 03:07 PM   #8
diyAudio Member
 
Join Date: Jun 2009
Quote:
Originally Posted by greenm01 View Post
The filter is minimum-phase, if that's what you're referring to.
Yes, that's clear from the links. It's worth looking at phase as well as magnitude, though getting good phase data is harder.

Last edited by twest820; 3rd July 2012 at 03:09 PM.
  Reply With Quote
Old 3rd July 2012, 04:18 PM   #9
diyAudio Member
 
Join Date: Nov 2011
Location: Maryland
Default Phase

Quote:
Originally Posted by twest820 View Post
It's worth looking at phase as well as magnitude, though getting good phase data is harder.
I plugged the impulse responses into Room EQ Wizard, and the output is 180 phase shifted from the input. This is typical behavior of an all pass filter.

RED = Convolution Output
GREEN = Input
Attached Images
File Type: png output.png (72.0 KB, 1059 views)
File Type: png input.png (74.2 KB, 1033 views)
  Reply With Quote
Old 3rd July 2012, 04:44 PM   #10
diyAudio Member
 
Join Date: Jun 2009
Cool. I was more curious about the measured in room phase response with the excess phase removed. Sorry not to be more clear. Though if RoomEQ supports excess phase removal that might be close enough.

Last edited by twest820; 3rd July 2012 at 04:46 PM.
  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
Introducing OpenDRC, Open Digital Room Correction engine minidsp miniDSP 19 3rd September 2012 01:37 AM
How does the BeoLab5 room correction work? boris81 Subwoofers 0 6th February 2011 06:14 PM
Is a Room correction trial possible? brianuk PC Based 7 5th October 2009 07:29 PM
I need help with digital Room-correction Radian Multi-Way 1 7th February 2007 07:10 PM
Room correction systems herodote Digital Source 0 24th July 2006 10:56 AM


New To Site? Need Help?

All times are GMT. The time now is 09:56 AM.


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