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

With the fix I described above the agreement with the REW simulator is much better, but still not perfect. I think there is still a problem with the definition of the absorption coefficient and the acoustic impedance, because I can get a perfect match with REW if I just lower the absorption coefficient in my (updated) code from 0.1 to 0.02:

vsrew3.png


We're getting there alright, but I still need to understand why my code requires an absorption coefficient 5 times smaller than the REW simulator to get a matching result :confused:
 
I have a feature request for the REW room simulator: it would be nice to have a way to export the predicted frequency response, e.g. add it as a measurement. Right now I need to eyeball the graphs to compare them because I couldn't find a way to get the raw data out of the REW simulator.
Have you tried these buttons?

1670791625151.png
 
I do believe there must be some problem with how I originally setup the absorption boundary conditions.

I ran a modified version of @edechamps' script in post #34 with the absorption coefficient* set to 10^-12, from 20 to 160 Hz, 20 frequencies per octave, and here is the FR plot. It matched the results from REW pretty well.
(* The absorption coefficient in this case cannot be 0 since there is no other boundary condition given, which will result in an under-constrained problem.)

fr.png


I used Mathematica to run my case, and ported my changes back to a Jupyter notebook. I haven't rerun the attached Jupyter notebook to make sure the results are the same. The Mathematica version took ~45 minutes to run (61 frequencies) on my i7-10750H laptop.
 

Attachments

  • vsrew2.zip
    5.9 KB · Views: 61
I do believe there must be some problem with how I originally setup the absorption boundary conditions.

Yeah. I'm trying to figure out exactly how the absorption coefficient is supposed to be modelled but I get the impression that there is some contradictory definitions out there. The term "specific acoustic impedance" seems to mean different things depending on the paper - the book @JohnPM suggested seems to use the term slightly differently from Wolfram, for example. Also there is the added complication that acoustic impedance is a complex number, and according to @JohnPM's book there is an infinity of possible complex impedances for a given absorption coefficient - I'm guessing this conundrum is solved by assuming the impedance of a real world wall would have a negligible imaginary part (acoustic reactance)?? I'll admit I'm quite out of my depth right now and this stuff is making my head spin…

@JohnPM Could you by any chance explain how REW uses the "surface absorption" parameter in its calculations and why, so that we can better understand the reasoning and try to reconcile that with the boundary conditions used in our FEM code?

We can all see the absorption coefficient seems to make a lot of difference to the results. I need to get the proper definition of that coefficient implemented properly so that I can set it based on real-world observed values (including absorbers) and trust that the results are at least theoretically correct. I hope that all these data sources use the same definition at least :eek:
 
I just convert them to the equivalent reflection coefficients [sqrt(1-alpha)] though the subsequent calculations use R^2. I found that didn't agree as closely as I'd like with an image source approach, so I applied an empirical tweak to use R^2.2 which matched better.
 
Spent some time playing with pyroomacoustics (PRA) to try to understand how the image source model (ISM) calculate the room frequency response. Please be reminded this is my first foray with PRA.

The image source model treats the walls/ceiling/floor as mirrors, and compute the locations of the reflection "images". Here are a few plots of the room and images. The first only have the source (1 speaker). The second is the source and the 1st order images, which means 1 single reflection. The third figure is shows 2nd order (2 reflections) images, and the fourth figure shows the 3rd order images.

room_plot_0.pngroom_plot_1.pngroom_plot_2.pngroom_plot_3.png

PRA uses the Sabine formula to calculate the wall absorption coefficient and the order required to calculate the room FR with an estimated RT60 given by the user. The absorption coefficient is the amount of energy absorbed per reflection. To keep things simple, I used the same wall absorption coefficient for all walls (so that I don't need to keep track of which reflection from which wall). The absorption coefficient is defined as the fraction of energy absorbed for each reflection. Therefore, the reduction of the pressure magnitude of the reflection is given by: sqrt(1 - e_absorption).

The FR calculated from the PRA room impulse response (RIR) matches the REW results very well. There are some differences at 85 - 95 Hz. I tried to calculate the FR in the frequency domain and my results did not match those from PRA (and REW).

freq_domain_calc.png

I looked at the RIR closer, and notice that the impulses are windowed sinc functions instead of the "ideal" delta function. That means the wall reflections used in the room FR calculations are bandlimited. Each impulse (from each reflection) may therefore "interfere" with other nearby impulses.

rirs.png

I then proceed to compute my own RIR using windowed sinc pulses. I didn't use as high order as PRA in my model since my program runs a lot slower than PRA. With order 30 my results matched those from PRA pretty well at the higher frequencies. To get my results to match those from PRA at the lower frequencies will require a significantly higher order and longer compute time. I made another version of the program using the Julia language (faster than Python) to calculate my order 80 room FR.

rirs_2.pngFR_from_rir_s.pngFR_julia.png

Now that I have a decent understanding of how the ISM compute the room FR, my next step is to figure out how to reconcile my FEM wall reflection coefficients with those used by PRA (and REW). My Python Jupyter notebook is in the ZIP file.
 

Attachments

  • 2022-12-18-1 Rectangular Room.zip
    4 KB · Views: 53
REW's simulation uses a fixed absorption factor for surfaces with no dependence on frequency or angle of incidence. Under those conditions the attenuation of images is pretty unambiguous and the ISM results also corresponded better with results from other packages and validation by other users. That work was done more than ten years ago now, but I'm open to suggestions for improvements. I don't think simulations are especially useful in circumstances where measurements can be made, however. When the simulation disagrees with reality I favour reality. :)
 
REW's simulation uses a fixed absorption factor for surfaces with no dependence on frequency or angle of incidence. Under those conditions the attenuation of images is pretty unambiguous and the ISM results also corresponded better with results from other packages and validation by other users.

As I alluded to earlier, I'm a bit worried that, even when the absorption coefficient of the boundaries is known, that's still not enough data to derive a frequency response because the absorption coefficient only gives you information about the magnitude of the wall impedance - it tells you nothing about its complex angle. The complex angle would affect the phase of the reflected wave, which seems like it would matter when computing the sum of the various reflected waves at the listening position for the purposes of computing the frequency response. I don't know how your method handles this problem. I also have no idea what the impedance angle of a piece of drywall (or a window pane, or a tuned absorber, etc.) is supposed to look like…

It could very well be that I'm confused about the math/physics and this doesn't actually matter. I guess I could try running the FEM simulation with various wall impedance angles to find out. But first I need to finish reading that book you recommended. So much stuff to learn, so little time…

I don't think simulations are especially useful in circumstances where measurements can be made

I would find it extremely useful to be able to simulate low frequency responses at various positions in arbitrary room shapes with custom absorption characteristics, assuming the results are accurate enough to be practically useful (I'm clearly not there yet). This is why I find this FEM stuff fascinating. Experimenting with a simulation is much, much, much easier than experimenting in the physical world, which might involve extremely painful undertakings like ordering $10k+ worth of tuned bass absorbers, spending entire week ends trying to set them up in different ways, ultimately realizing they're useless, and then wondering how the hell one would go about returning an entire truck's worth of acoustic equipment.
 
I would find it extremely useful to be able to simulate low frequency responses at various positions in arbitrary room shapes with custom absorption characteristics, assuming the results are accurate enough to be practically useful (I'm clearly not there yet).
That's a big assumption though. The simulation should really include the polar responses of the sources and model the surfaces including their variation in absorption with frequency and angle according to the actual composition across the whole surface. That is a big modelling task and a bigger data accumulation task, if the data even exist. How coarse can the approximations be to provide actionable results? Architectural acoustic packages tend to be more concerned with getting the approximate decay times of the space within an acceptable span at the low end and avoiding issues higher in the frequency range through ray tracing approaches, but if you are not building a new concert hall it is probably faster and cheaper to make measurements with some quantities of the materials that might potentially be accommodated in the space you are aiming to treat. The practical choices of what may be accommodated are often quite limited in any case.
 
Looks like I have figured out a way to match the wall absorption coefficients between REW (and pyroomacoustics) and Mathematica FEM. However, I did have to apply a kludge to get the numbers right.

The way I originally applied the absorption coefficient was completely wrong. The "correct" method is what @edechamps showed in post #39. Here is a clip from his first reference:
acoustic_impedance.png


α is the absorption coefficient, i.e. the fraction of the energy absorbed by the wall during a reflection. Z_o is the acoustic impedance of the wall. |R| is the magnitude of the complex reflection coefficient. When the wall is totally absorbing, Z_o is equal to (i.e. matches) the acoustic impedance of air, which is ρ * c, and we have |R| = 0. When the wall is totally reflecting, Z_o is infinite, and |R| = 1.

When I used Z_o calculated using equations 5 & 6, the results did not match those from REW well, with too much absorption. However, if I take the |R| as calculated by equation 5, and then take its square root again, the results match those from REW and PRA very well. No idea why. Here are the results with the absorption coefficients from 0.1 to 0.5

FR0.10.pngFR0.20.pngFR0.30.pngFR0.40.pngFR0.50.png

It is expected that there will be some differences between the results from FEM and ISM. These 2 methods treat wall absorption differently. ISM does not consider frequency and the direction/angle of the sound waves hitting the walls. For FEM the absorption is a strong function of the incidence angle of the acoustic wave hitting the wall. Both are highly simplistic approximations of actual wall reflections.

A more realistic, but much more complicated way, of modeling the wall using FEM is to include the acoustics-structure interactions in the analysis. We'll need to model the wall deflections due to the pressure loading from the acoustic waves, compute the wall movements, the amount of energy the acoustic waves transferred (or loss) to the wall, and the acoustic waves the wall re-radiates back into the room. We'll need to have very detailed knowledge of the structural construction and properties of the construction materials. It is well beyond the capabilities of amateur enthusiasts.

The Wolfram language Jupyter notebook is in the ZIP file. I'll correct the opening post in the next few days.
 

Attachments

  • vsrew_ntk2.zip
    5.5 KB · Views: 77
I see you ended up in the same place I did @NTK - including the unexplained difference between the "theoretically" correct impedance and the one that actually matches other methods (in post #41 I found that I had to use 0.02 in FEM to match 0.1 in REW). Clearly we have reached the same conclusion, but we still lack clarity as to the reasons behind the differences.

By the way, if this wasn't confusing enough already, there's yet another formula relating absorption and impedance in page 35 of Kuttruff. I haven't tried it yet.

ISM does not consider frequency and the direction/angle of the sound waves hitting the walls. For FEM the absorption is a strong function of the incidence angle of the acoustic wave hitting the wall.

How so? My limited understanding is that the Neumann boundary conditions used in FEM only care about normal incidence and do not consider oblique angles.

In any case, I was under the perhaps naive intuition that incidence angles don't matter much at such low frequencies/large wavelengths, but I'll admit I don't have much confidence in that assertion.

I think I know how I can measure the impedance of my walls: I just bang my head on them :p
 
Last edited:
I see you ended up in the same place I did @NTK - including the unexplained difference between the "theoretically" correct impedance and the one that actually matches other methods (in post #41 I found that I had to use 0.02 in FEM to match 0.1 in REW). Clearly we have reached the same conclusion, but we still lack clarity as to the reasons behind the differences.
There are so much uncertainties in the wall absorption coefficient and our current model of wall reflections is so primitive that I am not going to start worrying about the discrepancies between the two methods. Both are likely way off. I think we are at the point of all models are wrong, but are any of them useful?
By the way, if this wasn't confusing enough already, there's yet another formula relating absorption and impedance in page 35 of Kuttruff. I haven't tried it yet.



How so? My limited understanding is that the Neumann boundary conditions used in FEM only care about normal incidence and do not consider oblique angles.

In any case, I was under the perhaps naive intuition that incidence angles don't matter much at such low frequencies/large wavelengths, but I'll admit I don't have much confidence in that assertion.
The image source model does not consider the incident angle of the wave hitting the wall. Reflectivity is constant and every reflection is attenuated by the same ratio. For FEM, the reflectivity is (ξ cos θ - 1)/(ξ cos θ + 1), where ξ is the specific wall impedance (= Z_wall/Z_air ). Thus they are theoretically different, but Allen and Berkley (section I B) commented that the effect was not believed to be serious. Anyhow, likely minor noise compared to the rest of the uncertainties, such as knowing what the actual values of the absorption coefficients are and their non-uniform distribution across the surfaces ...
I think I know how I can measure the impedance of my walls: I just bang my head on them :p
Looks like we are at the end of our rope. To the tried and true method ... :D
keep-calm-and-bang-head-here.png
 
@NTK Just FYI, I would strongly suggest that anyone working on these notebooks use version 13.2 of Wolfram that recently came out. It looks like they changed something between 13.1 and 13.2 that results in obscene speedups for the FEM solver. I am now able to simulate over 80 frequencies on a high-precision ~19k element mesh in less than 2 minutes. Previously that kind of run would take closer to an hour!
 
Hey guys, I heard somewhere on YouTube that you should add porous treatment in a room in areas of high velocity and not in areas of high sound pressure.

Is this true? and is it something we can simulate?
 
Hey guys, I heard somewhere on YouTube that you should add porous treatment in a room in areas of high velocity and not in areas of high sound pressure.

Is this true? and is it something we can simulate?

Yes, that is true. Porous absorption works by having the individual fibres or cells impede the gas flow. If you have low velocity and high pressure, the gas flow is acting on the entire panel, rather than entering and being partially converted into heat energy. This is why thicker absorption panels should generally use a lower density material, as it allows the gas flow to penetrate further, increasing overall absorption.


The simulation isn't perfect, but you can clearly predict that the best low frequency absorption comes from panels which have an air gap, are relatively thick, and use low or medium density material.
 
Back
Top Bottom