diyAudio

diyAudio (http://www.diyaudio.com/forums/)
-   Digital Line Level (http://www.diyaudio.com/forums/digital-line-level/)
-   -   Python Open Room Correction (PORC) (http://www.diyaudio.com/forums/digital-line-level/215529-python-open-room-correction-porc.html)

greenm01 3rd July 2012 01:41 AM

Python Open Room Correction (PORC)
 
1 Attachment(s)
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

twest820 3rd July 2012 05:34 AM

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.

chaparK 3rd July 2012 01:29 PM

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.)

hochopeper 3rd July 2012 02:14 PM

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!

greenm01 3rd July 2012 03:12 PM

Quote:

Originally Posted by twest820 (Post 3079814)
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.

greenm01 3rd July 2012 03:21 PM

Quote:

Originally Posted by chaparK (Post 3080063)
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 (Post 3080063)
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 (Post 3080063)
(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.

greenm01 3rd July 2012 03:26 PM

Quote:

Originally Posted by hochopeper (Post 3080107)
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...!

twest820 3rd July 2012 04:07 PM

Quote:

Originally Posted by greenm01 (Post 3080156)
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.

greenm01 3rd July 2012 05:18 PM

Phase
 
2 Attachment(s)
Quote:

Originally Posted by twest820 (Post 3080201)
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

twest820 3rd July 2012 05:44 PM

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.


All times are GMT. The time now is 04:34 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