Python Open Room Correction (PORC)

Hmm. I tried Align2 and I can't get any output at all. I get a window of zero size and no files. I do see command windows go by, but they close before I can read the error message.
I guess there's something wrong with my installation, but I don't know how to work out what it is :(
I suspect it's missing some Python dependencies. Check in the setup page to install Octave and all Python parts.
 
Hi all,

so I modified Align2 to be able to use the mixed phase option (with autotrim of IR) , it works fine.

But I noticed a low frequency target problem, similar to the one that Timbarnes had.
It seems that following change gives better results, so replace :

fir = sig.firwin2(501, frq, np.power(10, pwr/20.0), nyq = frq[-1])
by :
fir = sig.firwin2(4095, frq, np.power(10, pwr/20.0), nyq = frq[-1])

Compare both responses (501 and 4095) :

porc5010.png


porc4010.png
 
Last edited:
Member
Joined 2011
Paid Member
Would it be too tedious for someone to provide step-by-step, beginning-to-end instructions on how to achieve DRC with the various tools being discussed? Also, can this only be implemented in OpenDRC hardware, or can I do it on my Linux music server somehow? (with a jack plugin, or something??)

I currently use HolmImpluse to measure response and then manually adjust EQ (SuperEQ in DeaDBeeF) to compensate, but this all sounds like it would be much better...
 
Last edited:
Would it be too tedious for someone to provide step-by-step, beginning-to-end instructions on how to achieve DRC with the various tools being discussed?

It's not very difficult, one you have all the tools installed. On Linux its fairly easy; Windows can be a pain, but doable. "Just" follow the instruction and examples specified in the README. Of course, you should also have the proper measurement equipment and know how to capture your Room Impulse Response (RIR).

Also, can this only be implemented in OpenDRC hardware, or can I do it on my Linux music server somehow? (with a jack plugin, or something??)

Yes, both. I actively actually use OpenDRC (digital version) on my stereo, although you could also use jconvolver on Linux (among other tools) or the convolver plugin for Foobar2000 on Windows.

Unfortunately this is a DIY get-your-hands dirty tool, so you'll have to invest some time learning the ropes. Maybe you could contribute a better step-by-step guide once you figure it out (again, it's not very difficult if you know your way around the command line).
 
I'm about to embark on some mods to PORC, want to check that I'm not going to duplicate any effort. Here's my rough hitlist for things to look into over the next few weeks:

- Document setup process for first time python users to hopefully broaden the number of people that can use this.
- iPython notebook for user interface for dialogue for input / output files from PORC - this will allow it to run on all OSes and have minimal need for command line interaction when using the software
- look into using scipy to generate the output coefficients directly - reduce dependencies
- generate files for biquads for IIR filter
- automate + user interface for leading zeros removal

Thoughts? Is best way for me to submit any changes just to put a pull request on github? I've not contributed to any git repos before so hopefully I don't make too many embarrassing mistakes in that process :)

Cheers,
Chris
 
Last edited:
Just wrote up a rough setup guide since in here we've had a few questions from people with zero Python experience it seems simplest to start from ground zero.https://github.com/zzzzrrr/porc/pull/1

Very nice; much appreciated. I just just merged your changes in.

I believe the next step would be to remove some of the extra dependencies such as libsndfile. The reason I used this library was because I was not happy with the built in functions in Scipy. This was over a year ago.... hopefully things have improved since?
 
Very nice; much appreciated. I just just merged your changes in.

I believe the next step would be to remove some of the extra dependencies such as libsndfile. The reason I used this library was because I was not happy with the built in functions in Scipy. This was over a year ago.... hopefully things have improved since?

No worries! Hopefully it allows a few more people to try out the software.

Not being unfamiliar with the requirements for jconvolve and similar software convolution systems, I am more focused on the OpenDRC/minisharc user, because that's me! I was thinking that we could generate the binary file needed for those directly using ndarray.tofile(). Skipping the sox requirement too. Does jconvolve take the wav file as it's input for filter without any need for sox conversion? At least this way libsndfile and sox would be optional dependencies only needed for those using software based convolution. You're right it'd be nice to not need the other dependencies but I don't have a setup to use for testing them at the moment so other than to write something and do a comparison to the output file to that generated by libsndfile. Not sure how successful that would be but probably worth a shot.
 
I won't have time to get back to tidy it up for a few days but I played around and worked out generating .bin file for OpenDRC directly using np.tofile() I think.

I'm ordering my minisharc in a week or two and still need to build DACs for it before I'll be able to test this out, so would be good if someone could check it imports into the plugin okay after I tidy it up.

One thing to note, the current workflow converts to float64 -> normalised -> pcm16 -> float32 when going to wav file then processed in sox. The below does float64 -> normalise -> float32. So there will be some difference in the coefficients by doing a more direct conversion. Should be better, when I was doing the comparisons I still had some residual error (less than e-08 magnitude difference) when getting generating float32 wav files to run through sox.
 
Simplification

I won't have time to get back to tidy it up for a few days but I played around and worked out generating .bin file for OpenDRC directly using np.tofile() I think.

Exporting directly to the .bin file from numpy is a great idea. Also, I believe we could eliminate all the other dependencies (Scikits.audiolab, setuptools, libsndfile) and make SciPy the only required install (other than Python).

Honestly I've been distracted by other priorities, and there didn't seem to be much interest from anyone else in this project early on. I had PORC up and running, with OpenDRC and jconvolv, and didn't invest much time in making it user friendly.

If there's enough interest I might invest the time, if no one else beats me to it.

 
Last edited:
In terms of user friendliness it is perfect for me. I can totally relate to life priorities too. For windows people there is the Align2 GUI. Since I'm okay with Python though still learning I thought I'd have a look at the code and see if there was anything that could be improved, not because anything is broken but because sometimes new things are fun and it seemed a small enough project that I could get my teeth into it quickly to help my Python learning and contribute something that might help a few others :)



I was re-reading a few of Bank's papers recently and found that there are a few new (2013) papers published on Bank's list of publications page that are of interest that aren't listed on the Parallel Filter's summary page. I'm still trying to get my head around the pole distribution in the new papers vs the earlier papers in the warped pole IIR filter design stage. It's a complex topic and I haven't looked at DSP stuff since uni 5+years ago and we really only covered the basics then.


The beauty of the anaconda or enthought python distributions is that they cover those numpy/scipy/IPython/mpl dependencies in a single installer, that's why I chose anaconda for the install guide, keeps it simple for people new to scientific python world. I'm also interested in some of the stuff that continuum analytics are producing (Travis Oliphant is one of the guys running that company I believe and he was one of or the lead on numpy development for a great number of years). See numba, blaze and bokeh are looking like pretty neat tools indeed, though very very new and still in a pretty steep part of development cycle. They're probably of limited benefit for PORC certainly interesting for some other stuff I play around with ...