• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Arbitrary Shape Room Mode Simulator

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,880
Likes
16,666
Location
Monument, CO
I have not. I am not much of a MATLAB user. But I think for MATLAB the PDE Toolbox will be required (which I don't have).

Pierre is (was?) experimenting with FireDrake on Python (see post, link below). I am also thinking about doing it with Gridap on Julia, to be fully FOSS, if I can manage to muster enough motivation :facepalm:
OK, thank you. Always hope, not that I have time to play after work anyway. We use Python at work so that's an option (though programming is not my strong suit).

My personal Matlab license is up for renewal, suppose I could add the PDE Toolbox and see if that adds motivation (though time is the problem, and energy, not motivation).
 

Frgirard

Major Contributor
Joined
Apr 2, 2021
Messages
1,737
Likes
1,042
A door, a window or the nature of the boundaries changes everything. Nice thought experiment, but the real world is unfortunately more complex.
 

krabapple

Major Contributor
Forum Donor
Joined
Apr 15, 2016
Messages
3,193
Likes
3,754
This opening post is to show how to simulate room modes using Mathematica. The other room mode calculators I could find on the web can only handle rectangular box shaped rooms. Mathematica can solve for arbitrarily shaped room. I only attempted 2D, but theoretically Mathematica should be able to compute 3D too. I'll leave that for the ASR high achievers :D

Mathematica comes free with Raspberry Pi (Raspbian). I don't have a Pi with me so I haven't tested my notebook on a Pi. This example notebook took several seconds to run on my i7-10750H laptop, with the vast majority of it on generating the plots. I am guessing it wouldn't be too bad on a Pi. I'd love to have some feedback if any of you try it on a Pi. I'd recommend running it on one of the models with larger amounts of RAM.

A brief look at the those few (7) lines of code (looks so simple, isn't it ;)):
So...where would you place your speakers, subwoofer(s) and listening chair, based on this?
 

storing

Active Member
Forum Donor
Joined
Aug 27, 2021
Messages
226
Likes
220
OK, nobody took my bait. So I guess I'll do it. Here is a full-on 3D arbitrary shape room mode simulation.
@NTK thanks for this, just tried it out. Not a mathematician, so some questions; in general: how to interpret the plot? Like: is red cancellation, and is there a way to know which wall contributes to it most? The frequencies output for my room seem to make sense, in that some of the values happen to be roughly those values in which I see issues in mic measurements, but I'm not quite sure if that's just a conincidence - there seems to be no clear system in knowing which frequency would be a cancellation at MLP vs amplification. I'll spend more time later (thinking of entering a simple cuboid to then compare results with other calculators to see which thing modifies what) but I think an explanation could be useful for others as well.
 

krabapple

Major Contributor
Forum Donor
Joined
Apr 15, 2016
Messages
3,193
Likes
3,754
hah, well, I'm familiar with that 2002 document. I've relied on his slide #14 'trick' for subwoofer placement to cancel width modes myself.

However, Toole, Welti, etc have always been mainly concerned with getting most consistent bass performance over a multi-listener listening area. That is not necessarily what a single MLP occupant/ASR obsessive aims for.

I'm interested to know how you arranged your setup, based on your simulations.
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,708
Likes
5,975
Location
US East
@NTK thanks for this, just tried it out. Not a mathematician, so some questions; in general: how to interpret the plot? Like: is red cancellation, and is there a way to know which wall contributes to it most? The frequencies output for my room seem to make sense, in that some of the values happen to be roughly those values in which I see issues in mic measurements, but I'm not quite sure if that's just a conincidence - there seems to be no clear system in knowing which frequency would be a cancellation at MLP vs amplification. I'll spend more time later (thinking of entering a simple cuboid to then compare results with other calculators to see which thing modifies what) but I think an explanation could be useful for others as well.
hah, well, I'm familiar with that 2002 document. I've relied on his slide #14 'trick' for subwoofer placement to cancel width modes myself.

However, Toole, Welti, etc have always been mainly concerned with getting most consistent bass performance over a multi-listener listening area. That is not necessarily what a single MLP occupant/ASR obsessive aims for.

I'm interested to know how you arranged your setup, based on your simulations.
The subject can get a bit complicated and there isn't a simple answer. It will take me some time to gather materials. Give me a few days.
 

kthulhutu

Active Member
Joined
Mar 15, 2022
Messages
132
Likes
113
hah, well, I'm familiar with that 2002 document. I've relied on his slide #14 'trick' for subwoofer placement to cancel width modes myself.

However, Toole, Welti, etc have always been mainly concerned with getting most consistent bass performance over a multi-listener listening area. That is not necessarily what a single MLP occupant/ASR obsessive aims for.

I'm interested to know how you arranged your setup, based on your simulations.
For single MLP, best thing to do is find the most comfortable position without nulls and then you can EQ everything else into a nice smooth response.
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,708
Likes
5,975
Location
US East
@NTK thanks for this, just tried it out. Not a mathematician, so some questions; in general: how to interpret the plot? Like: is red cancellation, and is there a way to know which wall contributes to it most? The frequencies output for my room seem to make sense, in that some of the values happen to be roughly those values in which I see issues in mic measurements, but I'm not quite sure if that's just a conincidence - there seems to be no clear system in knowing which frequency would be a cancellation at MLP vs amplification. I'll spend more time later (thinking of entering a simple cuboid to then compare results with other calculators to see which thing modifies what) but I think an explanation could be useful for others as well.
The red and green both indicate areas of maximum pressures of the room mode, but with opposite polarities (when one is at maximum positive pressure, the other is at maximum negative pressure). White is zero pressure, which indicates areas of the room mode nulls.
surf_ani.gif


The room modes, however, can only give information regarding the reverberant sound responses. The direct sound from the source is not considered. I ran a series of full room response simulations to help show the differences. I used a simple rectangular room (5 m wide x 4 m long x 2.44 m high). To cross check the accuracy of the calculated room mode frequencies, the calculated mode frequencies matched those using Amroc at Amcoustic.

room_modes.png

Let's look at two of the modes - 54.91 Hz and 80.90 Hz. This is an enlarged plot of the 54.91 Hz mode. I normalized the totally sub output power to be the same in all simulation runs, i.e., if there is 1 sub, the output is set to 1 (arbitrary unit). For 2 subs, output of each is set to 1/2, and etc. All room boundaries (walls, ceiling and floor) are modeled with a uniform absorption coefficient of 0.2.

room_mode_54.91hz.png

1 Sub
All room modes peak at the room corners (when 3 perpendicular walls intersect). This is with the sub placed at a room corner. The room mode shape is recognizable from the response plot but the null is shifted away from the sub after summing with the direct sound response.

room_resp_54.91hz_01.png

The 2 cases are place at mid-length nulls along the 2 walls. Placing the sub at nulls give weaker averaged room SPL. Also, the room mode is not excited when the sub is located at the null, and the room mode pattern is not noticeable in the response plot.

room_resp_54.91hz_02.png room_resp_54.91hz_03.png

2 Subs
This is the response of placing the a sub at each end of the long wall. Since the modes at the corners of the long wall are of opposite polarity, a significant portion of the sub outputs cancel each other.

room_resp_54.91hz_04.png

This is the plot of the 2 subs placed at mid-length along the short wall, where there are room mode nulls. The nulls cause low sound level in larger areas in the room (outside of the room center) than in the 1 sub case.

room_resp_54.91hz_05.png

The graph shows the subs at diagonal corners, where the room modes have the same polarity. In this case, the response pattern follows the room mode.

room_resp_54.91hz_06.png

4 Subs
This is the response plot for a sub at each room corner. Since 2 of the 4 subs are placed at room mode peaks at one polarity, and the other 2 are place at opposite polarity, they largely cancel each other and result in a low average sound pressure response.

room_resp_54.91hz_07.png

When all 4 subs placed at the nulls at the mid-length of the walls, they effectively cancel each other and the average room response is the lowest of all 8 cases.

room_resp_54.91hz_08.png

Here are the enlarged view of the 80.90 Hz room mode, and the room responses for the same cases as above. The most notable difference is that the mid-length on the long wall is a mode peak instead of a null (and you can see the effect in the 3rd response plot).

room_mode_80.90hz.png
room_resp_80.90hz_01.pngroom_resp_80.90hz_02.pngroom_resp_80.90hz_03.pngroom_resp_80.90hz_04.pngroom_resp_80.90hz_05.pngroom_resp_80.90hz_06.pngroom_resp_80.90hz_07.pngroom_resp_80.90hz_08.png

The "high level" conclusion is that in-room bass response optimization is complicated, and the room mode plots, while they can be informative, only tell part of the story.
 
Last edited:
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,708
Likes
5,975
Location
US East
As a follow on to the previous post, I ran some calculations similar to those in Todd Welti and Allan Devantier's multi-sub paper.

The room and sub locations are the same as the previous post. I simulated the frequency response (sweep from 20 Hz to 120 Hz at 1 Hz increment) at a number of locations in the room (see below for the perspective view and the top view).
multisub_locations.png multisub_locations_top.png

This are the frequency response plots of all the locations (magnitude). Since there is symmetry in room and measurement locations geometry, the FR plots reflected them. The first 4 plots are the FR at the measurement locations when only 1 of the 4 sub are active. The 5th plot is for all 4 of them active. I have confirmed that a vector sum of the first 4 responses is equal to the 5th plot (after normalizing for the total output power), which is to say the system is linear (as is dictated by the math used).

multisub.png

I haven't attempted any EQ optimization on these simulation data. The SFM (sound field management) method as described in the Harman paper uses brute force search to find the optimal setting. I haven't looked what method MSO uses.
 
Last edited:

617

Major Contributor
Forum Donor
Joined
Mar 18, 2019
Messages
2,433
Likes
5,376
Location
Somerville, MA
@NTK, from a purely theoretical standpoint would it be possible to use measurements as an input to derive the rough geometry of the room?

Also these visualizations go a long way to explaining the chaos that is the modal region.
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,708
Likes
5,975
Location
US East
@NTK, from a purely theoretical standpoint would it be possible to use measurements as an input to derive the rough geometry of the room?

Also these visualizations go a long way to explaining the chaos that is the modal region.
I don't know. Not my area of expertise but I doubt it. I think the application is similar to that of sonars, which I think uses different (beamforming?) methods.
 

-Matt-

Addicted to Fun and Learning
Joined
Nov 21, 2021
Messages
679
Likes
569
@NTK Thanks for sharing the code.

I was interested to see what the modes did in my "L" shaped room - thought I'd share the results in case anyone else has a similar configuration.

The larger cuboid is my lounge 5.7m x 3.6m (ceiling is 2.4m high), this is joined via a 30cm thick arch to the dining room 3m x 3.3m.

My front speakers are on the short wall in the lounge (with the arch to the right when you face towards them). The main listening position is near the back wall of the lounge.

There are large windows and two doorways that are neglected in this sim. (I think the aspect ratio of the X and Y axes is a bit distorted in the mode plots).

geometry.png


All Room Modes Grid.png
 
Last edited:
  • Like
Reactions: NTK
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,708
Likes
5,975
Location
US East
@NTK, from a purely theoretical standpoint would it be possible to use measurements as an input to derive the rough geometry of the room?

Also these visualizations go a long way to explaining the chaos that is the modal region.
I was reading this paper which the authors described a method based on knowing the basic room geometry and sound source location to "filter out" the early reflections.

They referenced this paper (which I haven't read) which may be of interest to your question.
 
  • Like
Reactions: 617

sarumbear

Master Contributor
Forum Donor
Joined
Aug 15, 2020
Messages
7,604
Likes
7,321
Location
UK
I compared my results with the web calculator from AMcoustics.
https://amcoustics.com/tools/amroc?l=400&w=400&h=400&r60=0.6
Andreas' website is my go to place when I need simple calculations for finding a simple (cheap) way to tame a room's acoustics.
  • The Helmholtz calculator is especially useful for DIYers. Very simple to use.
  • This calculator is also very good to quickly visualise the effectiveness of an absorber. You can immediately see/understand if a manufacturer had been lying on their product specs :)
  • This calculator is for the serious DIYer who is planning on building a multi-layer absorber. I had a few of these built for my friends and the results matched the calculations.
 

Frank71

New Member
Joined
Feb 21, 2024
Messages
4
Likes
0
@NTK , Hi I've found this post very interested! Have you any news or progress about it? Thanks
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,708
Likes
5,975
Location
US East
Welcome to ASR!
@NTK , Hi I've found this post very interested! Have you any news or progress about it? Thanks
@ylio has a much more user friendly room mode calculator created using COMSOL (as a COMSOL app).

There are also some attempts to perform room response simulations, but not very conclusive. See below thread.
 
Last edited:

Frank71

New Member
Joined
Feb 21, 2024
Messages
4
Likes
0
Thanks NTK!
If I can find some time, in which discussion should I send my room measurements to get some advice?
 

Frank71

New Member
Joined
Feb 21, 2024
Messages
4
Likes
0
And which is the best programming language (python?) to visualize the waves in the room in 3d?
Thanks in advance
 
Top Bottom