materials.diffusers.metadiffuser
La referencia de la API se publica en inglés en los dos idiomas: se genera a partir de los docstrings del código, que son su texto original.
Metadiffusers: deep-subwavelength Schroeder-like sound diffusers.
A metadiffuser is a rigidly backed slotted panel whose slits are each loaded
by an array of Helmholtz resonators (Jimenez, Cox, Romero-Garcia and Groby,
Metadiffusers: Deep-subwavelength sound diffusers, Sci. Rep. 7, 5389,
2017). The resonators slow the sound inside each slit, so the slit reaches
its quarter-wavelength condition at a fraction of the depth a plain well
would need; by giving every slit a different geometry the panel presents a
spatially dependent complex reflection coefficient R_n(f) along its
face. Tuning that profile to a Schroeder phase grating reproduces the
scattering of a quadratic-residue or primitive-root diffuser from a panel
1/46 to 1/20 of the design wavelength thick, and driving single slits to
critical coupling adds the perfectly absorbing 0 state that ternary
sequences require.
Each slit is modelled with the transfer-matrix chain of
slit_helmholtz_absorber
(visco-thermal effective parameters, resonator end corrections and slit
radiation correction); the panel is locally reacting, so the wells do not
couple internally and the far field follows from the Fraunhofer integral of
the per-well reflection sequence
(predict_diffuser_polar_response)
reduced to the ISO 17497-2 directional diffusion coefficient.
Auto-generated from the source docstrings by
scripts/generate_api_docs.py(make api-docs). Do not edit by hand.
metadiffuser_diffusion_spectrum
Section titled “metadiffuser_diffusion_spectrum”metadiffuser_diffusion_spectrum( frequencies: ArrayLike, wells: Sequence[MetadiffuserWell | None], *, depth: float, period: float, angles: ArrayLike = (-90, -85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90), source_angle: float = 0.0, periods: int = 1, resonator_geometry: str = 'slit', air: AirProperties = ...,) -> DiffusionSpectrumNormalized diffusion-coefficient spectrum d_n(f) of a metadiffuser.
Evaluates the far-field polar response at each frequency with
metadiffuser_polar_response, forms the ISO 17497-2 directional
diffusion coefficient band by band and normalises it against a flat
rigid reference of the same footprint (all wells ) with
normalized_diffusion_coefficient,
exactly as the paper reports delta_n.
Parameters
| Name | Description |
|---|---|
frequencies | Frequencies of the spectrum, in hertz (1-D). |
wells | Sequence of MetadiffuserWell (or None for a flat rigid strip) describing one period of the panel face. |
depth | Panel depth L common to all slits, in metres. |
period | Well pitch d along the panel face, in metres. |
angles | Receiver reflection angles theta, in degrees. |
source_angle | Angle of incidence psi, in degrees. |
periods | Number of repetitions N_p of the single period. |
resonator_geometry | "slit" (default) for the paper’s two-dimensional resonators, "square" for square-duct necks and cavities. |
air | State of the air the panel radiates into and the slits and resonators are filled with (AirProperties); its speed of sound c0 also carries the far field. |
Returns: A DiffusionSpectrum carrying the raw d(f) and the normalised d_n(f).
metadiffuser_polar_response
Section titled “metadiffuser_polar_response”metadiffuser_polar_response( frequency: float, wells: Sequence[MetadiffuserWell | None], *, depth: float, period: float, angles: ArrayLike = (-90, -85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90), source_angle: float = 0.0, periods: int = 1, resonator_geometry: str = 'slit', air: AirProperties = ...,) -> DiffuserPolarResponseFar-field polar response of a metadiffuser at one frequency.
Computes the per-well complex reflection sequence at frequency with
metadiffuser_reflection (the panel is locally reacting, so the
slit chains see the incidence angle source_angle) and evaluates the
Fraunhofer far field and ISO 17497-2 directional diffusion coefficient
with
predict_diffuser_polar_response.
Parameters
| Name | Description |
|---|---|
frequency | Frequency of the prediction f, in hertz. |
wells | Sequence of MetadiffuserWell (or None for a flat rigid strip) describing one period of the panel face. |
depth | Panel depth L common to all slits, in metres. |
period | Well pitch d along the panel face, in metres; it is the well_width of the far-field model. |
angles | Receiver reflection angles theta, in degrees. |
source_angle | Angle of incidence psi of the source, in degrees; also applied to the local slit reflection. |
periods | Number of repetitions N_p of the single period; the grating lobes of a Schroeder-like design require periods >= 2. |
resonator_geometry | "slit" (default) for the paper’s two-dimensional resonators, "square" for square-duct necks and cavities. |
air | State of the air the panel radiates into and the slits and resonators are filled with (AirProperties); its speed of sound c0 also carries the far field. |
Returns: A DiffuserPolarResponse.
metadiffuser_reflection
Section titled “metadiffuser_reflection”metadiffuser_reflection( frequency: ArrayLike, wells: Sequence[MetadiffuserWell | None], *, depth: float, period: float, angle: float = 0.0, resonator_geometry: str = 'slit', air: AirProperties = ...,) -> MetadiffuserResultPer-well reflection spectra of a metadiffuser panel (Sci. Rep. Eq. (6)).
Runs the rigidly backed slit transfer-matrix chain of
slit_helmholtz_absorber
once per well: each MetadiffuserWell becomes a slit of height
h_n and depth L loaded by its M resonators on the lattice
, and None wells are flat rigid strips with
.
The panel is locally reacting, so a well’s reflection does not depend on
its neighbours and the incidence angle enters only through the front
air impedance.
Parameters
| Name | Description |
|---|---|
frequency | Frequency vector f, in hertz. |
wells | Sequence of MetadiffuserWell (or None for a flat rigid strip) describing one period of the panel face. |
depth | Panel depth L common to all slits, in metres. |
period | Well pitch d along the panel face, in metres. |
angle | Polar angle of incidence theta, in radians. |
resonator_geometry | "slit" (default) for the paper’s two-dimensional resonators, "square" for square-duct necks and cavities. |
air | State of the air the panel radiates into and the slits and resonators are filled with (AirProperties): its speed of sound c0, density rho0, viscosity eta, Prandtl number Pr, ratio of specific heats gamma and static pressure P0. |
Returns: A MetadiffuserResult with one reflection row per well.
MetadiffuserResult
Section titled “MetadiffuserResult”MetadiffuserResult( frequency: Real, reflection: Complex, absorption: Real, well_absorption: Real, wells: tuple[MetadiffuserWell | None, ...] | None = None, depth: float | None = None, period: float | None = None,)Spectra of a metadiffuser panel, one reflection row per well.
reflection has shape (N, len(frequency)) with the complex
pressure reflection factor of each well (flat strips are exactly 1),
absorption is the face-averaged energy absorption
and
well_absorption the per-well
. The trailing fields retain the geometry the
prediction was run with (wells, depth, period) so
plot_geometry can draw the panel section; they default to
None for hand-built results.
MetadiffuserResult.plot()
Section titled “MetadiffuserResult.plot()”MetadiffuserResult.plot( ax: Axes | None = None, *, language: str = 'en', **kwargs: Any,) -> AxesPlot the per-well and face-averaged absorption spectra.
Requires matplotlib (pip install phonometry[plot]); returns the
Axes.
MetadiffuserResult.plot_geometry()
Section titled “MetadiffuserResult.plot_geometry()”MetadiffuserResult.plot_geometry( ax: Axes | None = None, *, language: str = 'en', **kwargs: Any,) -> AxesDraw the panel cross-section to scale (slits and resonators).
Requires matplotlib (pip install phonometry[plot]); returns the
Axes.
Raises
| Exception | When |
|---|---|
| ValueError | If the result does not retain its geometry. |
MetadiffuserWell
Section titled “MetadiffuserWell”MetadiffuserWell( slit_height: float, resonators: tuple[HelmholtzResonator, ...],)One slit of a metadiffuser panel.
slit_height is the slit opening h_n along the panel face and
resonators the Helmholtz resonators loading the slit, ordered from
the panel face towards the rigid backing; the resonator lattice step is
for a panel of depth L and M resonators. All
lengths are in metres. A None entry in a well sequence stands for a
flat rigid strip of the panel face (), the +1 state of
ternary-sequence designs.
plot_metadiffuser_panel_geometry
Section titled “plot_metadiffuser_panel_geometry”plot_metadiffuser_panel_geometry( wells: Sequence[Any], ax: Axes | None = None, *, depth: float, period: float, language: str = 'en', **kwargs: Any,) -> AxesDraw one period of a metadiffuser panel, to scale.
Side cut of the slotted panel (Sci. Rep. 7:5389 Fig. 1(b)): the face
runs along the top with the sound arriving from above, the wells
repeat horizontally at the pitch d, and each well is a slit of
height h_n descending the panel depth, loaded by its resonators
at the lattice step a = L / M shelved sideways into the septum;
None wells are flat rigid strips; rigid back wall underneath.
Parameters
| Name | Description |
|---|---|
wells | The well sequence of metadiffuser_reflection (MetadiffuserWell or None per well). |
ax | Existing axes, or None to create a figure. |
depth | Panel depth L, in metres. |
period | Well pitch d, in metres. |
language | Label language, "en" (default) or "es". |
kwargs | Forwarded to the slit rectangles. |
Returns: The axes.