Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding optimal internal cabinet volume for best acoustic response from the drivers #3

Open
2 of 8 tasks
TooDissing opened this issue Feb 19, 2022 · 9 comments
Open
2 of 8 tasks
Assignees
Labels
original project scope Scope that is part of the original project scope

Comments

@TooDissing
Copy link
Collaborator

TooDissing commented Feb 19, 2022

Description

In order to make the most of the drivers, it is important to provide "enough" volume for each driver. But what is enough?
Each driver resides in its own internal cabinet - at least for now. This is done in order to minimize interference between the drivers, but does take up more room for bracing etc.

The main goal are to keep the cabinet small, but at the same time ensure that the minimum requirements for frequency range and max SPL are met; find more information here.

Definition of Done

Finding the needed volume involves the following tasks:

  1. Simulate cabinet volume for different bass extension targets
  • 45Hz
  • 60Hz
  • 80Hz
  1. Build and validate three test cabinets with different volumes
  • Build cabinet 1
  • Build cabinet 2
  • Build cabinet 3
  • Measure each cabinet
  • Validate possible frequency range and max SPL of each cabinet

Documentation

We also need to describe the measurement and validation parameters and this process.

@TooDissing TooDissing added the enhancement New feature or request label Feb 19, 2022
@TooDissing TooDissing added original project scope Scope that is part of the original project scope and removed enhancement New feature or request labels Feb 19, 2022
@emiltb
Copy link

emiltb commented Mar 15, 2022

I commented on the first blogpost, but wanted to elaborate a bit, because I think there are advantages to using a structured approach for optimization and testing of the prototypes. I believe that the suggested approach of simulating the acoustic properties is a good starting point (although I have no knowledge about that). However, many physical parameters come into play when testing the real acoustic performance of various prototypes, and the interactions between the various parameters can be difficult to discern.

Dynamic Design of Experiments

The approach I suggest is called Dynamic Design of Experiments (DoE). In contrast to Classical DoE where one sets up a factorial design and tests a predetermined number of combinations to create a model of a system, Dynamic DoE uses a Bayesian Optimization algorithm to model a system and incrementally learns about the systems performance based on its input parameters. This means that new iterations of the speaker design can be tested in iterations as small as 1, and new test parameters be determined on the basis of the newest findings. I found an article that describes the Bayesian Optimization here: https://distill.pub/2020/bayesian-optimization/

Despite being a really advanced tool, it is freely available through Brownie Bee in a publicly funded project. Danish Technological Institute recently published a brief video about on of their first case studies, describing the approach and results (https://www.youtube.com/watch?v=zHsTAhzvYYA). In this video a production company managed to optimize a production process with 20-30% of the experiments that they would normally have to perform.

Suggested workflow

What Brownie Bee offers is a methodology to optimize the speaker design in (hopefully) as few iterations as possible. It would likely be achieveable by a workflow like this:

  1. Determine the parameters of interest for the model through a brainstorming session. For input parameters this could be e.g. width, depth, height, materials, etc. as well as upper and lower bounds for these and output parameters would likely be frequency range, max SPL and response linearity.
  2. Run simulations of the speaker design to get an idea of the effect of the parameter space.
  3. Select three promising configurations based on simulations and construct prototypes. Measure the output parameters on the prototypes.
  4. Input the input and output parameters of the first three experiments in Brownie Bee. This will then issue a new set of parameters in the area where it's model of speaker performance is most uncertain.
  5. Construct a new prototype based on the suggestion from Brownie Bee and pass the output parameters back into Brownie Bee.
  6. Repeat step 4 and 5 until satisfactory performance.

I would be happy to discuss this approach further and help in setting up the optimization algorithm.

@TooDissing
Copy link
Collaborator Author

Thank you for the thorough walk through walkthrough and suggested workflow @emiltb.

Have you worked with this tool yourself?
It also seems like a big mouthful do endeavor into such a tool.

Maybe some practical examples would be great, or maybe you could assist with this tool when we get some data from the first cabinet?

@TooDissing TooDissing mentioned this issue Mar 16, 2022
5 tasks
@TooDissing
Copy link
Collaborator Author

The three different simulation targets mentioned above can't provide the same level of SPL, but it could be interesting to see how high (in SPL) each target frequency the drivers can deliver.

@emiltb
Copy link

emiltb commented Mar 17, 2022

Thank you for the thorough walk through walkthrough and suggested workflow @emiltb.

Have you worked with this tool yourself? It also seems like a big mouthful do endeavor into such a tool.

Maybe some practical examples would be great, or maybe you could assist with this tool when we get some data from the first cabinet?

I'll be happy to help. I used the tool in a very early version, since I used to work at the Center at the Danish Technological Institute who is involved in the BOOST Væksten project that develops the tool. It has definitely matured more since then and is quite accessible once you get started. I'm open to being actively involved once data is available. I'll post an example of how it could be used with some dummy data here as soon as I have time, just to give a better feeling of how it can be used.

@emiltb
Copy link

emiltb commented Mar 20, 2022

I've run an optimization test using some dummy data I've created to illustrate the principle. The Python code used for my data generation is available in this Gist: https://gist.github.com/emiltb/a15c4db0598ab494a433ee138ca4bd76.

Generating data for a hypothetical speaker

The Python code creates a Speaker class which takes three input variables: a (width, 15-30 cm), b (depth, 5-10 cm) m (material, either 1 or 2). Two response (sound pressure level (spl) and response linearity (lin)) variables are then created for the speaker based on these, which follow some equation to smoothly vary the response over the parameter space. In reality the input- and response variables of interest should be selected through a brainstorming session and discussions with someone with some level of subject matter expertise. It is possible to work with more input variables than this example, but if course it quickly increases the parameter space drastically.

The goal of the optimization is to approximate this equation for each response variable, so we can get an idea about how varying the input variables effects the response and use this to find an optimum.

If a hypothetical speaker is created with prototype = Speaker(20, 8, 1) it can be tested with prototype.test() which will output:

Speaker test results:
Speaker parameters: 20 cm x 20 cm x 8 cm, material 1
Sound pressure level: -74 dB
Linearity: +/- 3.5 dB

The reported spl is negative, because the optimization algorithm is set up to always minimize the response.

Optimizing results

Brownie Bee is started and the input variables defined as shown in the picture below. It supports both continous, discrete and categorical values.

01_setup

The only other parameter that needs to be set initially is Xi. It is on the same scale as our response (i.e. dB in our case). Initially it is best to start with a large value to make the algorithm more explorative. It can then be lowered later to optimize around the best results. For spl I started with Xi=30 and lowered it to 5 after 6 attempts.

In order to start the optimization in Brownie Bee, I need three initial measurements. @TooDissing has mentioned in several places that they are doing simulations to determine some properties of the speaker. I will assume that this work has been used to select three promising speaker configurations that have been created and has had spl and lin measured. These numbers are filled into Brownie Bee, and the algorithm run to select the next experiment.
01_initial_data

I press Run, and then get the results of the first model estimation as well as a suggestion for the next prototype. If is is more practical to construct more speakers in one go, it is also possible to get suggestions for e.g. the next three prototypes:
04_initial_suggestion

I can then iterate over these steps, i.e. get a suggestion for the next experiment, and run the test in my Speaker class, until I am satisfied with the results. After 6 experiments I lowered Xi to 5 and then with 7 experiments I have these points:

06_global_maximum_SPL_found

And this response model, which shows the response dependence on each input variable as well as the interaction between pairwise input variables.
image

After 7 prototypes with SPL optimization I decided that I was satisfied with the results, and changed the input so all of the responses were the linearity meaurements instead. Assuming that all response variables of interest are measured for all prototypes, we can kickstart the new model by inputting already known data.
08_first_run_lin_results

I kept iterating over linearity measurements until 20 prototypes had been "constructed" and tested.
09_last_run_lin

10_last_run_lin

We see, that we actually managed to find the lowest linearity value of 3.0 after 9 total prototypes, and that adding more measurements made the model more sophisticated.

Comparing with the ground truth

Since this is all simulated data, I can provide insight into the "true" model behind our hypothetical speaker:

For sound pressure level:
im1
For response linearity:
img2

It turns out, that the optimization algorithm was able to find the global maximum for SPL in 7 attempts. It never found the true global minimum for response linearity in 20 tries, but came pretty close and found very low values in the parameter space given.

Let me hear what you think about this approach and what aspects you wish to discuss. I hope that this could be an interesting way of working, and think that it suits this project very well since the fabrication via CNC-routing makes it possible to quickly fine-tune and iterate over designs.
Edit: It turns out that I am mistaken. I rechecked the data, and the value of minimum linearity of 3.0 that was found in the 9th try is actually the minimum within the parameter space. Based on the color scales I had assumed that the lowest value was for Speaker(19, 9, 1), but that also happens to have a linearity of 3.0.

@TooDissing
Copy link
Collaborator Author

TooDissing commented Mar 20, 2022

@emiltb this looks really great! And there's a lot too digest as well :-)

Currently building a cabinet based on the most recent simulation that comes pretty close to the set design goals and will provide measurement data, when I have them available.

There's already some very well documented models for how the acoustics works and how the cabinet volume - in theory - affects the transfer function of the speaker output. But there's many more parameters that comes in play - many are fixed in this setup, but some can be tuned.

I started watching the webinar you linked above - it seems like a great approach - and will need to dig a little deeper into the subject, before I can start discussing the variable parameters and what to tune for with this approach.

Something that will impact the result a lot are the room as well as the speaker placement.

Will for sure look more into this, as this is a very cool approach. Let's see what is possible and how we can benefit from it.

@TooDissing TooDissing self-assigned this Mar 21, 2022
@emiltb
Copy link

emiltb commented Mar 26, 2022

It's very interesting if knowledge from the existing models can be somehow be incorporated to design better experiments. I sent an e-mail last week to one of my former colleagues at Danish Technological Institute since I had some questions about the Brownie Bee app (mainly regarding producing one model with several input parameters and several output parameters, instead of having to creating a number of separate models as I illustrated above - long story short, it is implemented and possible to do). The BOOST Væksten project which is funded by The Danish Industry Foundation, is run by DTI with the goal of increasing the knowledge about the methodology and creating more cases illustrating how the tool can be used. This means that they are very interested in this project and are therefore very curious to hear more about it and discuss how it the tool could be used and how they might be able to help. They have asked for a meeting where it could be discussed - I'll definitely talk with them anyways, but I was wondering whether you @TooDissing would be interested in participating? It would be valuable to have someone with more knowledge about speaker design than me to put some perspective on the primary aspects of the optimization problem. Could you send me an email at [email protected] if you are interested? Then we can set something up.

@TooDissing
Copy link
Collaborator Author

First cabinet is now build with the tuning created for the 80Hz target. And just merged in the PR with all the updates to the design files.

Preliminary measurements and voicing have been performed and the sound is promising - yes I'm biased, but I feel that it does sound pretty decent 😎

@TooDissing
Copy link
Collaborator Author

Started performing further simulations using the Brownie Bee app as an assistant. It is pretty hard to get the scores calculated correctly. More testing are needed to properly evaluate this tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
original project scope Scope that is part of the original project scope
Projects
Status: In Progress
Development

No branches or pull requests

2 participants