loudspeaker modeling in Simscape™ and Simulink®

Demonstrating the Modeling of a Loudspeaker Using Simscape as well as using Simulink
3 Downloads
Updated 21 Feb 2024

View License

The demonstration provides a detailed simulation of a loudspeaker's internal workings, extending up to the diaphragm, while excluding the enclosure and the air interactions at the front of the loudspeaker. The example showcases the feasibility of replicating the Simscape™ loudspeaker functionality as a behavioral model implemented in Laplace domain in Simulink®.
For those interested in further exploration, a search for "MATLAB loudspeaker" on the internet will lead to a resource titled "Loudspeaker Modeling with Simscape™," which has been available since 2021. Subsequent discussions in the professional community have centered on the computational performance of these models.
The comparative analysis is facilitated by the concurrent modeling of the loudspeaker in both Simulink® and Simscape™, allowing for a direct assessment of execution speeds. The model is structured such that Simulink® constitutes the upper portion, while the lower portion is rendered in Simscape™. The scopes integrated within the model confirm that the outputs of both implementations are consistent.
To quantitatively evaluate the temporal efficiency, one might partition the model and independently measure the execution time of each section. This method provides a clear metric for comparing the performance of the two simulation approaches. Here is a summary of the findings regarding the speed of execution:
1, There is no significant difference between Simulink® and Simscape™ implementations.
2, Using an analog signal source is faster than using a discrete signal source when the solver is in variable step mode.
3, No significant time difference in running the models in accelerator mode or even the rapid accelerator mode.
4, With a discrete signal source the model can then be executed with a solver that is in a fixed-step mode. Running in fixed-step mode is signifcantly faster than in variable step mode.
5, With the models in fixed-step mode they can be compiled into a standalone executable which runs at least 10x faster.

Cite As

Francis Tiong (2024). loudspeaker modeling in Simscape™ and Simulink® (https://www.mathworks.com/matlabcentral/fileexchange/159963-loudspeaker-modeling-in-simscape-and-simulink), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with R2023a and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.1

Added content to the Description.

1.0.0