Welcome, Guest
Username: Password: Remember me

TOPIC:

Python Open Room Correction (PORC) 10 years 6 months ago #5979

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0
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.

Here's 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, but if you have any questions this forum is a good place to start. See the link above for the code.

/Mason
Attachments:

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #5989

  • devteam
  • devteam's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9143
  • Thank you received: 1451
Wow Mason!

That's an amazing project! We knew that you were having fun with your OpenDRC but we didn't expect you were having that much fun with coding an application as well! :-)

Do you know John @ REW? We should get you 2 to talk to each others.. He's a very good friend of the miniDSP community being on the board of advisor... Very smart but very busy!

Please get in touch with us if there is anyway we can help your project(This email address is being protected from spambots. You need JavaScript enabled to view it.). We're always pleased to see some community work like yours.

Great job once again and thanks for sharing it with the community! Hoping others can contribute. I know that Curryman has a "taste" for FIR so he might be a good person to share ideas...

DevTeam
miniDSP, building a DSP community one board at a time.

Please Log in or Create an account to join the conversation.

Last edit: by devteam.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #5997

  • john.reekie
  • john.reekie's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 3778
  • Thank you received: 1593
Thank you!! I will give it a run when I get DRC-DI running (week or two).

Four thumbs up!

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6001

  • curryman
  • curryman's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 793
  • Thank you received: 181
if I only had more time... ;) I should quit the job and concentrate on hobbies ;)

Really great work and thumbs up from me too!

I'll do some reading and will try the software after setting up my system again (have been to the Frickelfest and actually I am waiting for new enclosures for my 2x8).

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6003

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0

That's an amazing project!

Thanks. It appears all the commercial filter generation packages are quite expensive. My goal was to help OpenDRC live up to its namesake. You have a great product, and it's brought much joy to my DIY audio experience. Thanks you for making this fantastic DSP hardware available.

Do you know John @ REW? We should get you 2 to talk to each others.. He's a very good friend of the miniDSP community being on the board of advisor... Very smart but very busy!

I definitely make good use Room EQ Wizard. This is a hobby project of for me, and my time is also limited. I do have a day job and family obligations :-) If John wants to integrate my project into REW that would be fantastic, although I believe his code is closed source?

Hoping others can contribute.

Me too! I hope this will turn into a community project.

/Mason

Please Log in or Create an account to join the conversation.

Last edit: by greenm01.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6004

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0

if I only had more time... ;) I should quit the job and concentrate on hobbies ;)

My sentiments exactly! My day job isn't nearly as fun as this DIY stuff.

In any regard, let me know if you need help getting setup. I could definitely improve the documentation on Github.

/Mason

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6038

  • pos
  • pos's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 364
  • Thank you received: 206
Very nice project, thank you for sharing this!
One question: What happens to the phase? Is it possible to also provide a phase target curve?
If not, are those filters minimum phase or linear phase?

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6039

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0

what happens to the phase? Is it possible to also provide a phase target curve?
If not, are those filters minimum phase or linear phase?

The filter is minimum phase. The output is phase shifted 180 degrees from the input, which is typical behavior of a second order all pass filter. See attached graphs. The phase shift has no effect on the audio quality, IMHO.



Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by greenm01. Reason: editorial

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6040

  • pos
  • pos's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 364
  • Thank you received: 206
Your phase measurements do not seem to have the proper offset on the impulse response, this makes it impossible to read and interpret.
Have you tried using HolmImpulse?

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6042

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0

Have you tried using HolmImpulse?

Thanks for the link. Don't have time right now to check it out; my main machine is running Linux at the moment.

I can send you my impulse responses (uncorrected and corrected) if you would like. I've also included my room measurements in the data directory on Github, so you can run the filter yourself.

The filter is 2nd order all pass minimum phase, so the phase should be shifted by 180 as indicated in the charts above. What should the proper offset look like?

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6044

  • pos
  • pos's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 364
  • Thank you received: 206
Here is an exemple of the measurement of a 2-way speaker in an anechoic simulated situation (1m measurement + impulse gating + frequency restriction)

HolmImpulse will automatically set the delay offset to match the impulse (you only have to make sure of polarity) and will show the phase with that point as reference.

Here we clearly see the effect of an timely aligned acoustic LR24 at 2khz (the phase starts to shift higher in frequency because the tweeter rolloff could not be fully corrected with minimum phase filters)

Now the same measurement with a wrong offset (only 1ms, much less than your measurements appear to have) :

You can see a similar (and predicitble) behavior as in your measurements.

By the way, I would like to use the open drc to correct the phase before reaching my IIR crossovers, using a FIR inverse 2nd order allpass filters at 2khz with a Q=0.707, to mimic the phase behavior of the acoustical LR24. I would also like to correct the effect of the sealed box in the low (12dB/oct...).
Would that be possible to model such a filter with your code? Or is there an even simpler way to just model a given biquad, inverse it, and put it in the open drc?
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by pos.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6045

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0

HolmImpulse will automatically set the delay offset to match the impulse (you only have to make sure of polarity) and will show the phase with that point as reference.

I installed HolmImpulse on Windows 7, and it crashes whenever I attempt to import my impulse response. REQ imports the same file with no problem.

I will drop the 'eqresp.wav" file into my Github repo, in the 'data' directory, if you want to take a look.

Would that be possible to model such a filter with your code? Or is there an even simpler way to just model a given biquad, inverse it, and put it in the open drc?

You can set the target correction curve, if that's what you're asking.

Please Log in or Create an account to join the conversation.

Last edit: by greenm01.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6046

  • pos
  • pos's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 364
  • Thank you received: 206

You can set the target correction curve, if that's what you're asking.

My target gain curve would be my measurement (no change at all): I just want to alter phase.

Anyway, back on your measurements: I imported it from the "measurement" panel, and the least I can say is that you impulse looks "funky".



You have got a very short and full band reflection (<20cm), so that must be a very hard and big surface near your mic or speaker. Or maybe (probably) you are measuring both speakers in the same time??

I don't know how you are supposed to operate for room correction with REW, but in my experience measuring both speakers in the same time as well as calculating an inverse filter from a measurement at a single position are both not good things to do. Doing both in the same time is not a good idea, especially in the critical khz range where you get lots of comb filtering with two speakers playing in the same time: you don't want to automatically correct that sort of things (at one point in space)...
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by pos.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6047

  • greenm01
  • greenm01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 37
  • Thank you received: 0

You have got a very short and full band reflection (<20cm), so that must be a very hard and big surface near your mic or speaker. Or maybe (probably) you are measuring both speakers in the same time??


I'm measuring one channel at a time, with the exception of my sub. I basically have a 2.1 system:

< 120Hz = Sub (shared on both left and right)
120Hz - 1kHz = Dipole speaker
> 1kHz = BMR full range tweeter

This is a modified Linkwitz Pluto setup . The speakers are positioned in a "typical" living room a few feet away from walls and adjacent surfaces. The measurement phone is positioned behind my couch, about where my head would be positioned if I was sitting in a typical listening position.

In any regard I'm not concerned about phase in my particular setup. With speaker-room correction and OpenDRC it sounds absolutely fantastic. I couldn't ask for anything better in this price range.

Please Log in or Create an account to join the conversation.

Re: Python Open Room Correction (PORC) 10 years 6 months ago #6049

  • pos
  • pos's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 364
  • Thank you received: 206

In any regard I'm not concerned about phase in my particular setup. With speaker-room correction and OpenDRC it sounds absolutely fantastic. I couldn't ask for anything better in this price range.

All the best then.
I am not looking for automated DRC with the openDRC, but manual corrections from the analysis of multiple measurements.

Please Log in or Create an account to join the conversation.

Last edit: by pos.
Moderators: devteam