Press "Enter" to skip to content

Advanced Digital Twin Loudspeaker Design – with Treble Acoustic Simulation Suite and BEM

Viktor 0

This post describes a full “Digital Twin” simulation of an advanced speaker design. The speaker’s sound radiation properties are simulated using numerical acoustics, and then the in-room response of the speaker is simulated using software from the Icelandic company Treble Technologies. It is even possible to listen to the simulated speaker! Such end-to-end simulations—from the shape of the speaker to the in-room audible result—are almost a dream come true for a speaker designer. Recent advances in simulation software have significantly improved the cost/accuracy/computation-time trade-off to make these simulations.

With this post I also illustrate the design of a speaker with a cardioid radiation pattern. The simulations are based a virtual prototype with similar box design and driver configuration as the Kii Audio Three, one of the more advanced home audio speakers currently available. By exhibiting a cardioid radiation pattern at low to mid frequencies, this speaker has a more frequency-independent directivity than conventional speakers, potentially enhancing sound quality.

Loudspeaker Geometry

The first step is to define the geometry of the speaker box. I used FreeCAD, a free and open-source 3D CAD software that works excellently for this purpose. The left image below shows the speaker model. The simulation includes four drivers: one mid/bass and a tweeter in a shallow waveguide on the front, and two woofers on the sides (the real Kii Audio Three has additional low-frequency drivers on the back). The circles indicating driver placement are for illustration only. The acoustic output of the drivers is simulated using point sources placed on the box surface, as described below.

Once the geometry is defined, the next step is to export a surface mesh from FreeCAD for use in numerical acoustic simulations. The right image below displays the surface mesh exported from FreeCAD.

Loudspeaker Simulation using BEM

For numerical simulation, I used the mesh2hrtf open source BEM (boundary element method) Python package, available on Github. As the name suggests it was made for a slightly different purpose, but it works equally well for simulating the radiation pattern of a speaker. There are also some excellent tutorials available on how to use it.

The simulation results provide the sound pressure response of each driver in many directions. The settings I used included 1,850 directions equidistributed on a sphere, and I chose to simulate the response across the frequency range of 0-20 kHz.

To run the BEM calculations, the speaker surface mesh must be imported into Blender, which is free and open-source. Using the mesh2hrtf add-on, a mesh2hrtf project is then exported. The driver positions are marked in Blender, and they are simulated as point sources. Hence, the narrowing directivity of the drivers in their upper working range is not modeled, but the simulations are anyhow very useful for evaluating a speaker design concept.

A Python script initiates the BEM calculations. The calculations are multi-threaded and mesh2hrtf utilize the “Burton-Miller collocation boundary-element method coupled with the multi-level fast multipole method” to reduce calculation time. It is advisable to run the calculations on a machine with many CPU cores and lot’s of RAM. For me, the calculations took around a day to finish.

Loudspeaker Simulation Result

To calculate the response of the speaker system with the combined acoustic output from all drivers, I loaded the BEM simulation data into MATLAB. I applied a linear-phase crossover at 3 kHz between the front woofer and tweeter and then plotted the resulting frequency response for various horizontal angles.

The left figure below shows the simulated response of a standard 2-way configuration, excluding the side drivers. This design has an increasingly wide dispersion at low frequencies, which is typical for this type of speaker as the wavelength becomes larger than the dimensions of the speaker. The speaker has been EQed for a flat response on-axis.

The right figure is a bit more exciting and shows the horizontal response of the speaker when the side-woofers are utilized to achieve a cardioid directional pattern below approximately 1 kHz. I created the filters to obtain the cardioid pattern using least-squares filter optimization in MATLAB.

And here you can see the horizontal directivity of the two designs as waterfall-style plots:

As you can see, the speaker with cardioid pattern in the bass has a more constant directivity vs. frequency. Here is the speaker energy-response for the two designs, i.e., the power-averaged response in all directions:

For this plot, I used a crossover frequency of 2 kHz to illustrate the occurrence of a dip in the energy response at the crossover frequency due to interference (lobing) between the drivers. This dip actually disappears when using a higher crossover frequency of 3 kHz, which was used in the rest of the simulations. With the comprehensive data from the BEM simulations, it’s really convenient to vary parameters such as the crossover frequency/slope to optimize the design.

The simulated speaker features rounded side edges on the front baffle with a 40 mm radius. This rounding significantly affects the polar and on-axis response of the speaker above approximately 1 kHz. Re-running the simulations with a 20 mm edge radius resulted in notable irregularities in the response due to edge-reflection effects.

Room Response Simulation using Treble

The Treble Acoustic Simulation Suite is a cloud-based software for room acoustic simulations. I believe that Treble has achieved a balance between accuracy, computation speed, features, price and not least user experience that makes it stand out in the market. Importantly for the current project, Treble supports modeling the sound source radiation pattern, allowing us to use the speaker directivity data simulated earlier with BEM. Additionally, Treble supports exporting ambisonics impulse responses, enabling headphone-auralization of the room, which I will discuss below.

The Treble software numerically solves the acoustic wave equation below a user-specified threshold frequency, which I set at 500 Hz. For higher frequencies, it employs a geometrical room acoustics model. Computations are performed in the cloud and parallelized on GPUs, thus reducing calculation time.

I used the Python SDK version of the Treble software. Directivity data is imported using CLF files, which are commonly used by room acoustic software. Creating CLF files involves a few steps and requires a (free) license for the CLF authoring tools. The directivity balloon to the right below shows the radiation pattern of the BEM-simulated loudspeaker design at the crossover frequency, plotted in the CLF authoring tool.

Although the Treble software supports modeling complex room geometries, for this project I used a simple shoebox design measuring 5x6x2.8 meters, as shown in the left figure below. I included two loudspeakers and a single listening position, indicated in the figure. Furthermore, I specified the wall material to have 26% absorption at all frequencies.

After running the Treble simulation, I loaded the resulting room impulse responses into MATLAB. Below, you can see the modeled in-room impulse and frequency responses, comparing the frequency responses of the cardioid and standard speaker designs (with 1/8-octave smoothing applied). The non-cardioid design has a slightly stronger response in the bass due to its rising energy response toward lower frequencies.

Examining the energy decay over time for the impulse responses of both designs reveals that the cardioid design has less reflected energy in the 125-500 Hz band. This is expected due to its higher directivity, though the difference is not substantial.

Finally, I observed that with the cardioid design, the speakers are more phase coherent in a certain frequency range in the bass, leading to a stronger summed response at the listening position. This is likely because the cardioid design interacts differently with room modes. However, I will not tire the reader with more graphs, instead let’s take a listen to the two designs.

Headphone Auralization using Ambisonics

The Treble software includes its own tools for headphone auralization. I chose however to use the Ambisonics export feature which allows for the use of 3rd party auralization tools. From Treble, I exported a 4th-order Ambisonics room impulse response. I then applied an Ambisonics-to-binaural decoder of my own design. The result is a set of binaural room impulse responses (BRIRs). When convolving the BRIRs with speaker signals, the result is headphone signals that gives one the impression of being in the simulated room.

Here is a simple channel check where you can hear the locations of the speakers in the room:

And below is an example of a bass line, where the first half of the file is the standard design playing and the second half is the cardioid design. The cardioid design has a bit tighter bass since it excites the room less, and the bass is also stronger on this track since the two speakers sum more coherently, as mentioned.

Can you hear the difference? I hope you like progressive trance music as the difference is hard to hear on Hotel California ;-).

Summary

  • “Digital Twin” loudspeaker design is feasible, and highly useful for understanding and iterating a specific loudspeaker design.
  • BEM for speaker directivity modeling + Treble for room acoustic simulation is a great combo.
  • The cardioid loudspeaker design presented gives a relatively constant directivity with frequency.

Leave a Reply

Your email address will not be published. Required fields are marked *