Ir al contenido

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(
frequencies: NumericArrayLike,
wells: Sequence[MetadiffuserWell | None],
*,
depth_m: float,
period_m: float,
angles_deg: NumericArrayLike = (-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_deg: float = 0.0,
n_repetitions: int | np.integer[Any] = 1,
resonator_geometry: Literal['square', 'slit'] = 'slit',
fluid: Fluid = ...,
) -> DiffusionSpectrum

Normalized 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_m Panel depth L common to all slits, in metres.
period_m Well pitch d along the panel face, in metres.
angles_deg Receiver reflection angles theta, in degrees.
source_angle_deg Angle of incidence psi, in degrees.
n_repetitions 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.
fluid State of the air the panel radiates into and the slits and resonators are filled with (Fluid); its speed of sound c0 also carries the far field.

Returns: A DiffusionSpectrum carrying the raw d(f) and the normalised d_n(f).

Raises

Exception When
TypeError if depth_m or period_m is not a single number, or resonator_geometry is not a text, or frequencies holds a text or a value that is not a real number.
metadiffuser_polar_response(
frequency: float,
wells: Sequence[MetadiffuserWell | None],
*,
depth_m: float,
period_m: float,
angles_deg: NumericArrayLike = (-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_deg: float = 0.0,
n_repetitions: int | np.integer[Any] = 1,
resonator_geometry: Literal['square', 'slit'] = 'slit',
fluid: Fluid = ...,
) -> DiffuserPolarResponse

Far-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_deg) 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_m Panel depth L common to all slits, in metres.
period_m Well pitch d along the panel face, in metres; it is the well_width of the far-field model.
angles_deg Receiver reflection angles theta, in degrees.
source_angle_deg Angle of incidence psi of the source, in degrees; also applied to the local slit reflection.
n_repetitions 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.
fluid State of the air the panel radiates into and the slits and resonators are filled with (Fluid); its speed of sound c0 also carries the far field.

Returns: A DiffuserPolarResponse.

Raises

Exception When
TypeError if frequency is not a single number, or resonator_geometry is not a text.
metadiffuser_reflection(
frequency: NumericArrayLike,
wells: Sequence[MetadiffuserWell | None],
*,
depth_m: float,
period_m: float,
angle_rad: float = 0.0,
resonator_geometry: Literal['square', 'slit'] = 'slit',
fluid: Fluid = ...,
) -> MetadiffuserResult

Per-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_rad enters only through the front air impedance.

Parameters

Name Description
frequency Frequency f, in hertz (scalar or array).
wells Sequence of MetadiffuserWell (or None for a flat rigid strip) describing one period of the panel face.
depth_m Panel depth L common to all slits, in metres.
period_m Well pitch d along the panel face, in metres.
angle_rad 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.
fluid State of the air the panel radiates into and the slits and resonators are filled with (Fluid): 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.

Raises

Exception When
TypeError if depth_m or period_m is not a single number, or frequency holds a text or a value that is not a real number, or resonator_geometry is not a text.
MetadiffuserResult(
frequencies: NDArray[np.float64],
reflection: NDArray[np.complex128],
absorption: NDArray[np.float64],
well_absorption: NDArray[np.float64],
*,
wells: tuple[MetadiffuserWell | None, ...],
depth_m: float,
period_m: float,
)

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_m, period_m) so plot_geometry can draw the panel section.

MetadiffuserResult.plot(
ax: Axes | None = None,
*,
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> Axes

Plot the per-well and face-averaged absorption spectra.

Requires matplotlib (the [plot] extra); returns the Axes.

Parameters

Name Description
language The language of the labels: "en" or "es".
MetadiffuserResult.plot_geometry(
ax: Axes | None = None,
*,
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> Axes

Draw the panel cross-section to scale (slits and resonators).

Requires matplotlib (the [plot] extra); returns the Axes.

Parameters

Name Description
language The language of the labels: "en" or "es".
MetadiffuserWell(
*,
slit_height_m: float,
resonators: Sequence[HelmholtzResonator],
)

One slit of a metadiffuser panel.

slit_height_m 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(
wells: Sequence[Any],
*,
ax: Axes | None = None,
depth_m: float,
period_m: float,
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> Axes

Draw 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_m Panel depth L, in metres.
period_m Well pitch d, in metres.
language Label language, "en" (default) or "es".
kwargs Forwarded to the slit rectangles.

Returns: The axes.

Raises

Exception When
ValueError for a depth or period that is not finite and positive, fewer than two wells, or a slit height that is not smaller than the period.
TypeError if depth_m or period_m is not a single number.