Jump to content

Room Mode Calculator


Recommended Posts

Time has come to share with the general public a project I have been working on day and night for the last 5 days.

It is a project I have contemplated doing for years, but lacked the formulas to even start it. Math is not my forte, so I have been reluctant to even give it a go.

Last week Andyr shared with me a room mode spreadsheet that he had. I won't go into the history of the spreadsheet right now, but will note all contributors in the credits.

 

While the Excel spreadsheet had formulas, they weren't particularly unusable formulas as is, I was able to get the gist of what was going on, and turn that into programming code with some modification.

The reason I am posting now is because I am at a point now where I have something resembling a usable program, and it could actually turn into something.

 

I need to try and remember how to do graphs in code, but once that is taken care of I want to start on some features I think most room mode calculators lack.

For years I have been using online calculators trying to design the perfect room. Anyone who has tried doing the same thing, will be aware that it is extremely time consuming to say the least. Going up and down values trying to find something that works.

 

What I would like to do besides the typical room mode information, is add a feature where it can automatically search various heights, widths and length looking for ideal rooms, and spit out a short list of suggested room sizes.

 

 

1498522347_Screenshotfrom2022-08-0320-03-41.thumb.png.ee3ea6a184621c7fda53c18ab0a024a4.png

  • Like 3
Link to comment
Share on other sites


Great project, SS!

 

Choosing optimum dimensions is a great idea - but can I suggest you should have to specify one of the 3 dimensions ... and then the s/sheet takes over from there?

 

For instance, you may have a limitation on length of the room ... or height ... or width.

 

Andy

 

Link to comment
Share on other sites

1 minute ago, andyr said:

Great project, SS!

 

Choosing optimum dimensions is a great idea - but can I suggest you should have to specify one of the 3 dimensions ... and then the s/sheet takes over from there?

 

For instance, you may have a limitation on length of the room ... or height ... or width.

 

Andy

 

 

Good idea Andy. That would probably cut down on search time as well. Nothing stops you doing all three separately. Although it would still be nice to see if if it could search all three, just to find the optimum room size. Will try and start with one room first though.

Link to comment
Share on other sites


Just putting it out there for discussion as I really haven't put a lot of thought into how I might achieve the automatic room checking section of the code yet.

 

A couple of thoughts have occurred to me though. I will probably have to write a completely different section of code for it, for several reasons.

 

The first being computing power... If I was to try and get the existing code to try and do what I want it to do it would be constantly trying to update the graph (when I get it going that is), spending a huge amount of resources trying to display every single combination on the graph. This on it's own is likely to cause Windows to hang.

 

Secondly the interface I have designed uses values taken from NumericUpDown boxes which you either enter a value in manually, or click up or down to change it's value. Now this is fine for us humans, because the computer thinks we move like rocks compared to it. So it has all the time in the world to do changes at the speed we move at (that's right you're a rock in their world).

 

Changing the values at the NumericUpDown boxes automatically,  while it would be super cool seeing the counters spin around like your power box needle when you turn the kettle on, it really once again would not be all that practical from a computer resource perspective.

 

So what I think this means is that particular section of code is going to be very boring to look at. I am going to have to put values into arrays or variables, so the computer can work with them at a speed it likes. Which brings me to the tricky bit...

 

Trying every combination is going to be extremely challenging, as the only way I can think to do it is to brute force crack it. Much like trying to find the combination of a lock.

Your typical 3 barrel lock has 1,000 (10 * 10 * 10) combinations. 0,0,1 - 0,0,2 - 0,0,3 all the way up to 9,9,9. (Height, Width, Length same as 3 barrels)

 

That is child's play for a computer... The problem I have is that the program I wrote can check up to 30.999 meters in every direction. So that is 30,999 * 30,999 * 30,999 combinations. Much like each lock tumbler has 30,999 numbers. Now you don't need a calculator to know that is going to be one big ass number when it is done computing.

 

So I am thinking I am going to need to some how set up, upper and lower limits for each room dimension, and possibly even try and make it check with different value units. i.e. increment in meters, or increment in decimeters, or increment in centimeters, or increment in millimeters to cut down on computing time, or we may not get a result in our life times (yes it could take that long).

 

If I do loops within loops, within loops within loops I think this is probably going to be the easiest way to execute the code, but that is still going to be a mammoth task (starting to see why I have never seen this done before).

 

But I see the code going something like this...

 

1918648452_PseudoCode.png.614df4da26c699c8a8b5dfaeb0167675.png

 

Actually that code would only look at one room dimension... This is about to get very tricky... Anyway thoughts? Comments? Alternate ways of trying to evaluate?

 

071649221088-3281038923.jpeg.f821a8a12d50ce26034b9bcb76eb8d07.jpeg

Link to comment
Share on other sites


Why do you need to go to 3 decimal places in measurement inputs? Isn’t that down to the millimetre? Wouldn’t 1 decimal place be sufficient for what you’re trying to achieve?

Link to comment
Share on other sites


1 hour ago, jt301 said:

Why do you need to go to 3 decimal places in measurement inputs? Isn’t that down to the millimetre? Wouldn’t 1 decimal place be sufficient for what you’re trying to achieve?

Not really.... 10cms (~4" for those in the imperial world) is too big of a distance to increment by. You can get wildly different results. The smallest I would want to go down to is a centimeter. Going down to millimeters just gives those in the imperial world chance to evaluate their listen spaces, since the sizes can only be entered in metric.

 

Besides, there is little difference in coding adding additional decimal places, because it is mostly repetition of same code. Being 10 based it is real easy to just keep adding more decimal places. I thought about going down to a 1/10 of a mm just so imperial people could get exact room sizes, but it is really not worth it since metric can get down to within a couple of 64ths of an inch, and I can't see anyone need to be more precise than that.

Link to comment
Share on other sites

Hi SS,

best wishes for your project, but there's such significant variability in room construction materials and absorption coefficients of the room and the contents that you'll chase your tail spending time on developing "another room mode calculator" - there's heaps out there already, and all of them are just a guide, requiring "in room" measurements after the room is built to manage acoustic issues.

 

Toole has discussed, "there are no perfect room dimensions", and obviously you want to avoid even multiples of dimensions. After that it doesn't matter much other than to make the room as big as you can.

 

Every room will have modal issues unless it's huge.

If constructing, go as large as you can, avoid even multiples of dimensions, and treat once it's built.

 

Mike

  • Like 4
Link to comment
Share on other sites

17 hours ago, almikel said:

Toole has discussed, "there are no perfect room dimensions"

This x1000

 

As long as you don't pick a really bad arrangement (for your sources and listeners setup) .... then the solution to better sound is not really to improve the arrangement (of modes)

  • Like 1
Link to comment
Share on other sites

17 hours ago, almikel said:

Hi SS,

best wishes for your project, but there's such significant variability in room construction materials and absorption coefficients of the room and the contents that you'll chase your tail spending time on developing "another room mode calculator" - there's heaps out there already, and all of them are just a guide, requiring "in room" measurements after the room is built to manage acoustic issues.

 

8 minutes ago, davewantsmoore said:

This x1000

 

As long as you don't pick a really bad arrangement (for your sources and listeners setup) .... then the solution to better sound is not really to improve the arrangement (of modes)

 

Not really looking to build just another room mode calculator, but at the same time it hasn't entered my head to try and build a calculator that will tell you the perfect room. I am just lending a bit of automation to the process. As Andy said you want to avoid big modal spikes, so what I am working on is going through each combination looking for two specific criteria to start with.

 

I have something like 28 measurement frequencies, the first thing I am looking for is a result of the mode issues for a given frequency (so adding up the weighted room modes Axial = 1, Tangential = 0.5, Oblique = 0.25) to get a result for that specific frequency, then looking through all of the 28 results to find the highest number (biggest spike) and recording that result, I am also summing up the 28 frequency results to get a total number. From there I do some comparisons.

 

I can test to see if the current numbers of Largest Numbers (spikes) and the Lowest Total (least amount of issues) are lower than the ones I have recorded. If they are that room size is added to a list, and then those new low numbers become the new bench mark.

 

Once it has finished going through all the options, it will have produced a list of potential half decent rooms with the better results being at the end of the list. From there I plan to trim a certain amount of listed rooms and run it through a second test, and that is to see which rooms in the list come closest to know listening room ratios.

 

I am hoping from there it spits out a list of possible candidates. Ones that are close to known working ratios, ones that have the lowest modal spikes, and the lowest amount of total room mode issues. From there the room can be treated accordingly, but it would put you in a pretty good starting position versus trying every one by hand in the online ones.

Link to comment
Share on other sites

At the moment I am just manually clicking through the room sizes and only one room at a time (so no more than a hundred or two options) and it found a couple of results.

I set the code to add the room if it was either lowest spike OR lowest total number. The finished list could be run again to find a list of the lowest spike AND the lowest summed. First pass through I am only looking for anything remotely worth looking at.

 

Obviously once I have all the logic worked up it won't display to text boxes and labels like it does now.

 

166913955_Screenshotfrom2022-08-0614-01-57.thumb.png.0bb1017d8e51cb177829e3b9725e9db7.png

 

 

Link to comment
Share on other sites

Had some success, but the results aren't quite what I expected... By using an OR (largest or lowest summed) it quickly reached the pinnacle where it excluded further results, which led me to start thinking perhaps this is not the most efficient way to eliminate results.

 

There might be better results that are being missed. There might be results that are just above the lowest values which are better than previously best results.

 

What might be a better approach is to use the lowest summed value combined with a value below the maximum Largest results.

 

i.e Largest < 2.25 + lowest Total, with an adjustable Largest value.

 

733536679_Screenshotfrom2022-08-0701-30-54.thumb.png.b92b392578a203990fc9bc8822757893.png

Link to comment
Share on other sites

Posted (edited)

Had some success... Using an upper limit for the highest room modes and the lowest summed total of room modes I want to search, was a much more effective way of searching. Using the previous model of diminishing results it might have ruled out some results that were better than ones that were kept, as it was just whittling down previous high scores.

 

Now that I have a workable sample of results I am going to put it through a second test condition (made sense to do it at this point instead of slowing down the search that may included trillions+ of possible options). Now I am checking each of the suitable results against a list of known best room ratios as determined by "experts" (definitely people that know more than me). So what this second check will do is compare each of the potential found room ratios against a list of known good room ratios.

 

Work out how far it is from that known ratio, to find the potential rooms that are the closest fit to known best room ratios. This will allow me to turn a list of possibly thousands into a list of whatever I want, by bubbling out the ones furthest from the mark. But there is a lot of math / code to work out between now and then.

 

1659245094_Screenshotfrom2022-08-0817-37-52.thumb.png.307eb264874fee1dd580fb103a69060f.png

 

Edited by Silent Screamer
Link to comment
Share on other sites

On 06/08/2022 at 1:09 PM, davewantsmoore said:

This x1000

 

As long as you don't pick a really bad arrangement (for your sources and listeners setup) .... then the solution to better sound is not really to improve the arrangement (of modes)

 

Dave has it covered. 

 

While it seems you're having fun coding, all the predictions will be wrong by a few orders of magnitude compared to the precision you are running. 

 

All your equations assume rigid boundaries, which don't exist. Unless perhaps a concrete bunker is close. The compliance of doors and most surfaces means the effective dimensions of the room are bigger than measured. Error could be 0.5m etc.

 

Consider absorbers, similar effect. People only generally consider the absorption coefficient, that is only the real part. All absorbers shift phase as well in the imaginary plane. So again, your reflection is different to a rigid surface with a loss.

 

Modal affects are really only worth considering sub 300Hz, as above that rooms have high enough modal density to be in the realm of reverb and the item driving sound quality is control of low order reflections. Sub 300Hz, its about speaker and listening position placement 1st.

 

To me room design starts with ideal listening triangle. From this you can figure out the distances you need to walls and ceiling to control imaging and have space for treatment. Then a check on low order modes, rev etc. 

  • Like 1
Link to comment
Share on other sites

Posted (edited)
51 minutes ago, DrSK said:

 

Dave has it covered. 

 

While it seems you're having fun coding, all the predictions will be wrong by a few orders of magnitude compared to the precision you are running. 

 

All your equations assume rigid boundaries, which don't exist. Unless perhaps a concrete bunker is close. The compliance of doors and most surfaces means the effective dimensions of the room are bigger than measured. Error could be 0.5m etc.

 

Consider absorbers, similar effect. People only generally consider the absorption coefficient, that is only the real part. All absorbers shift phase as well in the imaginary plane. So again, your reflection is different to a rigid surface with a loss.

 

Modal affects are really only worth considering sub 300Hz, as above that rooms have high enough modal density to be in the realm of reverb and the item driving sound quality is control of low order reflections. Sub 300Hz, its about speaker and listening position placement 1st.

 

To me room design starts with ideal listening triangle. From this you can figure out the distances you need to walls and ceiling to control imaging and have space for treatment. Then a check on low order modes, rev etc. 

 

The calculator will be no more, or no less accurate than any other room mode calculator. The purpose of any calculator shouldn't be to find a perfect room, but to avoid any really bad ones. If you stick 10ft x 10ft x 10ft in any room mode calculator it will have a coronary. I am only making the decision part a little less time consuming. All the hard work required in measuring and treating the room will need to still be done. Doesn't hurt to try and give it a helping hand by avoiding something really bad size combinations.

 

And yes I am enjoying the coding challenge. Been a long time since coding progress has gone this smoothly.

Edited by Silent Screamer
Link to comment
Share on other sites

Finished the the first draft of the calculator. Still has  lots of clean up work to be done, and some graph work to sort out, but the automatic room mode calculator section of the code is working and can select one of three ways to display the results.

 

1918346900_Screenshotfrom2022-08-1421-14-06.thumb.png.912e0e5a406df25048f8feeaa6c05ede.png

 

 

Edited by Silent Screamer
  • Like 1
Link to comment
Share on other sites


 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.




×
×
  • Create New...
To Top