• 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!

In-Room Speaker Frequency Response Simulation (Low Frequency)

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
[Edit] Member edechamps has pointed out my method of modeling wall absorption was incorrect and he is right. I have replaced the attached ZIP archive with update the Mathematica and Jupyter notebooks. With the old method, the wall absorption was much higher than they should be, and the updated model gave different results. The room frequency response results were replaced with those from the updated model.

I started a thread a few months ago on simulating room modes in an arbitrarily shaped room using Mathematica (free on Raspberry Pi) or the Wolfram Engine (free for "developers" at this time). Room modes are calculated without sound source, and they give indications only regarding the reverberant sound. The sound we hear in a room is the summation of both direct sound and reverberant sound. Also, whether a room mode is excited or not depends on speaker placements (in relation to the mode peaks and nulls) and listening positions. Therefore, to properly simulate the in-room response, the sound sources (i.e. speakers and subs) need to be included in the model.

First, a disclaimer. I have no formal education in acoustics and am an amateur in this area. What I am presenting is based on what I believe to be correct, which is not quite the same as being correct. My simulation results looked reasonable to me, so it kind of passed my not-stringent-at-all smell test :)

In this example I am simulating a simpler non-rectangular room. Please refer to the above referenced room mode simulation thread on how to build 3-D models of rooms that are more complex. This room model is composed of two rectangular blocks (cuboids). There is a “main listening area” and an "adjacent area". Two subs are placed near the lower left and right corners of the front wall.

Room Illustration.png


We'll first start with a simulation of the room modes. For now we'll concentrate on the 72.56 Hz room mode. Our subs are place at the corners near where there are peaks with opposite polarities. The horizontal plotting plane is at z (height) = 0.8 m, which is my assumed ear level.

Room_Mode_72.56Hz.gif


The in-room response are simulated with all walls (including ceilings and floors) being 90% reflective. This is higher than the reflectivity number (95%) Todd Welti and Allan Devantier used in their multi-sub paper. Thus this room is still quite acoustically live. Here are the response plots with sub 1 on only, sub 2 on only, and both on at the same time. The total sub output power was normalized, i.e. in the both subs active cases, their individual output level is reduced to half. the Since the subs are located near room mode peaks of opposite polarities, let's reverse the polarity of sub 2.

Sub1_only.GIF
Sub2_only.GIF

Subs1_and_2.GIF
Subs1_and_2_2reversed.GIF




The number in the dB (color) scales are arbitrary, and we should look only at the relative differences. Note that the upper limits in the color scales are different in these plots. In the sub 1 only and sub 2 only plots we can see the signatures of the room modes. In the subs 1+2 plot, because the subs are placed where the room mode peaks are in opposite polarities, there are significant cancellations and the room SPL is significantly reduced. The room mode was also less noticeable as it was "cancelled". When we reversed the polarity of one of the subs, we are fully exciting this room mode again.

As you can imagine, there are many knobs to play with. We can move the subs around, add more, play with magnitude and phase. And this is just at one frequency! There is the full range of bass frequencies to consider :eek:

The attached zip file contains the Mathematica and Jupyter notebooks for the frequency response and room mode simulations.
 

Attachments

  • In-Room FR Simulations Notebooks v2022-12-26.zip
    28.9 KB · Views: 61
Last edited:
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
Screen snips from the FR simulation Jupyter notebook. The notebooks are in the attached ZIP file.
[Edit] Updated to correct the wall absorption model error.

theory.png


[Edit] Add links to some references.
Wolfram monograph on frequency domain acoustics: https://reference.wolfram.com/langu...tics/AcousticsFrequencyDomain.html#1527648872
Wikipedia page on Neumann boundary condition: https://en.wikipedia.org/wiki/Neumann_boundary_condition
COMSOL introduction to acoustics: https://www.comsol.com/multiphysics/acoustics

[Edit] Removed ZIP file. The Jupyter notebooks were updated and put into the updated ZIP file attachment in Post #1.
 
Last edited:
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
Posted the brief description on the theory and the Jupyter notebooks for running on the Wolfram engine above.

Also ran another test case. This time the 2 subwoofers are placed at the mid lengths of the 2 side walls. The outputs from both subs are the same in both magnitude and polarity (and no delay between them). Here is the animation of a frequency sweep from 60 to 80 Hz. I also think I have figured out how to fix the color scale :)

Room.png


FR.GIF
 

q3cpma

Major Contributor
Joined
May 22, 2019
Messages
3,060
Likes
4,418
Location
France
If I were to dream, an interactive tool based on this where you can move the sub(s) and listening point while getting the frequency response in real time would be incredible. A way to specify wall material and thickness to automatically get the acoustical properties using a DB would be necessary too.
Add a complementary tool to get the rest of the FR by adding speakers and predicting reflections/cancellations from a spin (+phase?) and I'd fund the development.
The ultimate detail would be to increase the database with some other objects like acoustical treatment, sofas, bookshelves (with books), etc...

Does anything remotely like this already exist? Something like super-Amroc + Google Sketchup, basically.
 

abdo123

Master Contributor
Forum Donor
Joined
Nov 15, 2020
Messages
7,446
Likes
7,955
Location
Brussels, Belgium
If I were to dream, an interactive tool based on this where you can move the sub(s) and listening point while getting the frequency response in real time would be incredible. A way to specify wall material and thickness to automatically get the acoustical properties using a DB would be necessary too.
Add a complementary tool to get the rest of the FR by adding speakers and predicting reflections/cancellations from a spin (+phase?) and I'd fund the development.
The ultimate detail would be to increase the database with some other objects like acoustical treatment, sofas, bookshelves (with books), etc...

Does anything remotely like this already exist? Something like super-Amroc + Google Sketchup, basically.

there is a room simulator function that does all of this in REW, but only for rectangular (cuboid) rooms.

but i'm guessing you meant irregularily shaped rooms?
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
Do you have a Raspberry Pi with 4 GB RAM or more ? May be you can try it on one.
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
Yeah I do, is the Mathmatica model identical to the Wolfengine model?
Because I'm kind of stuck on the activation *whelp*
They are almost the same. For some reason unknown to me, the mesh generation method I used in the Mathematica notebooks didn't work with the Jupyter notebook running on the Wolfram engine, so I used a different method.

If you have a Pi, you can try running the Mathematica notebooks (the .nb files) on Mathematica. They are in the ZIP file in Post #1.
 

abdo123

Master Contributor
Forum Donor
Joined
Nov 15, 2020
Messages
7,446
Likes
7,955
Location
Brussels, Belgium
They are almost the same. For some reason unknown to me, the mesh generation method I used in the Mathematica notebooks didn't work with the Jupyter notebook running on the Wolfram engine, so I used a different method.

If you have a Pi, you can try running the Mathematica notebooks (the .nb files) on Mathematica. They are in the ZIP file in Post #1.

Success!

1626033345670.png


But then this happened

1626033441143.png


Am i missing something again?
 
  • Like
Reactions: NTK
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
These are the portion of the code that sets up the 5 plotting planes. It is a bit of PITA to setup the plots to your liking :(

'plane1' is defined by a line from pt1 to pt2, and extend in the direction (-1, 0, 0), which is negative x.
'plane2' is defined by a line from pt1 to pt3, and extend in the direction (0, 1, 0), which is positive y.

The other 3 plotting planes are:
{"XStackedPlanes", {0}} means one plane parallel to the x plane, at x = 0.
{"YStackedPlanes", {adjwid}} means one plane parallel to the y plane, at y = 6.
{"ZStackedPlanes", {4/5}} means one plane parallel to the z plane, at z = 0.8 (the assumed ear level while listening).

plot_planes.PNG


FR_60_Hz.png
 

abdo123

Master Contributor
Forum Donor
Joined
Nov 15, 2020
Messages
7,446
Likes
7,955
Location
Brussels, Belgium
@NTK okay so I switched the dimensions up a bit and now the green area is the listening area, it seems now to be working, don't know i broke the graphs before.

Are the room modes accurate now?

1626034916617.png

1626034964631.png
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
I'd assume so. You can cross check it with the Amroc room mode calculator. Your room is almost rectangular, so the room mode frequencies should be very close.
 
OP
NTK

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,715
Likes
6,003
Location
US East
Seconds. All units are SI.

In the notebook for "sub2", I was playing with delays in fractions of the period (i.e. 1/frequency). Obviously that makes the delay variable with frequency, which is not feasible unless you are using DSP with lots of taps.

delay.PNG
 
Top Bottom