Skip to content
/ acoucalc Public

A python package for transfer matrix acoustic simulations.

Notifications You must be signed in to change notification settings

vyhyb/acoucalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

acoucalc

This library is ment to provide a simple way to calculate acoustic behaviour of multilayered absorbers using the transfer matrix method, as described in Allard and Atalla (2009).

So far, it is possible to calculate the surface impedance and the absorption using the Johnson-Champoux-Allard model as well as the more simple Delany-Bazley model.

Installation

It is currently not possible to install this library using pip or conda, please use the latest released package instead and install using pip locally.

Documentation

Documentation can be found here.

Usage

The following example shows how to calculate the absorption coefficient of a simple absorber using the JCA model.

import numpy as np
import matplotlib.pyplot as plt

from acoucalc.models import air, jca
from acoucalc.layers import tm_fluid
from acoucalc.core import (
    initial_pv,
    add_layer, 
    surface_impedance, 
    pressure_refl_factor, 
    absorption_coefficient
)

freqs = np.linspace(63, 4000, 1000)
thichness_air = 0.1
thickness_porous = 0.05

pv_init = initial_pv(1, 0, freqs)

effective_density_air, bulk_modulus_air = air(freqs)
tm = tm_fluid(thichness_air, effective_density_air, bulk_modulus_air, freqs)
pv_air = add_layer(pv_init, tm)

eff_density, bulk_modulus = jca(
        flow_resistivity=12000,
        porosity=0.95,
        tortuosity=1.1,
        viscous_char_length=100e-6,
        thermal_char_length=200e-6,
        f=freqs
    )

tm = tm_fluid(thickness_porous, eff_density, bulk_modulus, freqs)
pv = add_layer(pv_air, tm)
z = surface_impedance(pv)
r = pressure_refl_factor(z)
alpha = absorption_coefficient(r)

plt.semilogx(freqs, alpha)
plt.xlabel('Frequency [Hz]')
plt.ylabel('Absorption coefficient')
plt.show()

Acknowledgments

This library was created thanks to the FAST-S-24-8572 project.

Github Copilot was used to generate parts of the documentation and code.

Author

Contributing

Pull requests are welcome. For any changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU GPLv3

References

  • [1] J.-F. Allard and N. Atalla, Propagation of sound in porous media, 2nd ed. Wiley, 2009.
  • [2] T. J. Cox and P. D’Antonio, Acoustic absorbers and diffusers: Theory, design and application, 3rd ed. Taylor, 2017. doi: 10.4324/9781482266412.

About

A python package for transfer matrix acoustic simulations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages