Skip to content

electroacoustics.piston

Radiation of a rigid circular piston set in an infinite baffle.

The baffled circular piston is the canonical acoustic radiator: a flat rigid disc of radius a vibrating with a uniform normal velocity in an otherwise rigid infinite plane. It is the model behind a loudspeaker cone in a large cabinet, the open end of a duct, and the reference source for the radiation efficiency of any finite vibrating surface, so its two results, the radiation impedance the air presents to the piston and the directivity of the far field, are the base of the electroacoustics domain (Beranek & Mellow, Acoustics: Sound Fields, Transducers and Vibration 2nd ed., §4.4; Bies, Hansen & Howard, Engineering Noise Control 5th ed.).

Radiation impedance. The reaction force of the air on the piston is with the mechanical radiation impedance

where is the wavenumber, the characteristic impedance of air and S the piston area. The dimensionless piston resistance and reactance functions are (Beranek & Mellow Eq. (4.30))

with J1 the Bessel function of the first kind and H1 the Struve function, both of order one, evaluated at .

  • Low frequency (): so the radiated power rises as , and . The reactance is mass-like, with the radiation (accreted) mass (Beranek & Mellow Eq. (4.32)): the piston drags an extra of air, equivalent to a layer thick over its face.
  • High frequency (): and , so : the piston radiates as if into an infinite tube and the air loads it purely resistively.

Directivity. The far-field pressure of the baffled piston varies with the polar angle theta from the axis as (Beranek & Mellow Eq. (4.42))

The main lobe narrows as ka grows; its first null is at (the first zero of J1), which exists only once . The directivity factor Q (on-axis intensity over the intensity of a point source of equal power radiating into the full sphere) and the directivity index follow from integrating over the radiating hemisphere,

which tends to ( dB, the half-space baffle gain) at low ka and to () at high ka.

Auto-generated from the source docstrings by scripts/generate_api_docs.py (make api-docs). Do not edit by hand.

piston_directivity(
ka: float | np.floating[Any] | np.integer[Any],
theta: float | np.floating[Any] | np.integer[Any],
) -> float
piston_directivity(
ka: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],
theta: NumericArrayLike,
) -> NDArray[np.float64]
piston_directivity(
ka: float | np.floating[Any] | np.integer[Any],
theta: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],
) -> NDArray[np.float64]
piston_directivity(
ka: NumericArrayLike,
theta: NumericArrayLike,
) -> float | NDArray[np.float64]

Far-field directivity .

The pressure amplitude of a baffled circular piston relative to its on-axis value (Beranek & Mellow Eq. (4.42)), normalized so .

Parameters

Name Description
ka Wavenumber-radius product ka (scalar or array).
theta Polar angle from the axis, rad (scalar or array). Broadcast against ka.

Returns: D; a float when ka and theta are both numbers; an array of their broadcast shape when one is a sequence or an array, a zero-dimensional one included.

Raises

Exception When
TypeError if ka or theta holds a text or a value that is not a real number.
piston_directivity_pattern(
ka: NumericArrayLike,
*,
angles_rad: NumericArrayLike | None = None,
) -> PistonDirectivity

Far-field directivity pattern of one or more baffled circular pistons.

Samples the directivity (Beranek & Mellow Eq. (4.42)) at every ka over a polar-angle grid and bundles it into a PistonDirectivity that exposes .plot(). The main lobe narrows as ka grows; its first null appears once ka passes the first zero of J1 ().

Parameters

Name Description
ka Wavenumber-radius product(s) ka (scalar or 1-D array), each non-negative.
angles_rad Polar angles theta from the axis, rad (1-D). None (default) uses 361 points spanning the front hemisphere -90 deg to +90 deg, 0.5 deg apart.

Returns: A PistonDirectivity.

Raises

Exception When
TypeError if angles_rad or ka holds a text or a value that is not a real number.
piston_reactance(x: float | np.floating[Any] | np.integer[Any]) -> float
piston_reactance(
x: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],
) -> NDArray[np.float64]
piston_reactance(x: NumericArrayLike) -> float | NDArray[np.float64]

Piston reactance function (H1 Struve order 1).

The imaginary part of the normalized radiation impedance of a baffled circular piston (Beranek & Mellow Eq. (4.30)). It rises as (mass-like) at low and decays to 0 at high x.

Parameters

Name Description
x Argument (scalar or array), dimensionless.

Returns: X1(x); a float for a number; an array for a sequence or an array, a zero-dimensional one included.

Raises

Exception When
TypeError if x holds a text or a value that is not a real number.
piston_resistance(x: float | np.floating[Any] | np.integer[Any]) -> float
piston_resistance(
x: Sequence[float] | Sequence[np.floating[Any]] | Sequence[np.integer[Any]] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any]],
) -> NDArray[np.float64]
piston_resistance(x: NumericArrayLike) -> float | NDArray[np.float64]

Piston resistance function .

The real part of the normalized radiation impedance of a baffled circular piston, as a function of (Beranek & Mellow Eq. (4.30)). It rises as at low x and tends to 1 at high x.

Parameters

Name Description
x Argument (scalar or array), dimensionless.

Returns: R1(x); a float for a number; an array for a sequence or an array, a zero-dimensional one included.

Raises

Exception When
TypeError if x holds a text or a value that is not a real number.
PistonDirectivity(
angles_rad: NDArray[np.float64],
ka: NDArray[np.float64],
directivity: NDArray[np.float64],
directivity_db: NDArray[np.float64],
)

Far-field directivity pattern of a baffled circular piston.

Bundles the far-field directivity (Beranek & Mellow Eq. (4.42)) of one or more baffled circular pistons over a shared polar-angle grid, so the classic beam pattern can be drawn with plot. The maths is piston_directivity; this is a thin, plottable bundle around it.

Attributes

Name Description
angles_rad Polar angles theta from the axis, rad.
ka Wavenumber-radius products ka, one per pattern (a 1-D array).
directivity Linear directivity , normalized so , as a (len(ka), len(angles)) array; row i is the pattern for ka[i].
directivity_db Directivity in dB, , same shape as directivity (the side-lobe nulls floor at a large negative value rather than -inf).
PistonDirectivity.plot(
ax: PolarAxes | None = None,
*,
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> PolarAxes

Plot the far-field directivity (beam) pattern on a polar axes.

Draws the directivity in dB against the polar angle: one curve per ka value as a single family (still one concept, the directivity pattern). A polar axes is created when ax is None. Requires matplotlib (the [plot] extra).

Parameters

Name Description
ax Existing (polar) axes, or None to create a figure.
language Label language, "en" (default) or "es".
kwargs Forwarded to the Axes.plot call when the result holds a single ka; ignored for a multi-ka family so one user color or label cannot collapse the per-curve styling.

Returns: The polar axes.

Raises

Exception When
ValueError If ax is not a polar axes.
plot_piston_geometry(
radius: float,
*,
ax: Axes | None = ...,
angles_rad: NumericArrayLike,
directivity: NumericArrayLike,
lobe_label: str | None = ...,
language: Literal['en', 'es'] = ...,
**kwargs: Any,
) -> Axes
plot_piston_geometry(
radius: float,
*,
ax: Axes | None = ...,
lobe_label: str | None = ...,
language: Literal['en', 'es'] = ...,
**kwargs: Any,
) -> Axes

Draw a baffled piston to scale, optionally with a directivity lobe.

The rigid baffle is the vertical wall, the piston the plate of radius a set into it; when angles_rad/directivity are given the normalised far-field lobe is overlaid on the radiation side.

Parameters

Name Description
radius Piston radius a, in metres.
ax Existing axes, or None to create a figure.
angles_rad Far-field angles, in radians (0 on axis), matching directivity.
directivity Linear directivity values in [0, 1].
lobe_label Optional legend label for the lobe (e.g. the ka).
language Label language, "en" (default) or "es".
kwargs Forwarded to the piston rectangle.

Returns: The axes.

Raises

Exception When
ValueError for a non-positive radius, only one of the lobe pair, a lobe whose two arrays disagree, or a non-finite value in either of them.
TypeError if radius is not a single number, or angles_rad or directivity holds a text or a value that is not a real number.
radiating_piston(
radius: float,
frequencies: NumericArrayLike,
*,
speed_of_sound: float = 343.0,
density: float = 1.206,
angles_rad: NumericArrayLike | None = None,
) -> RadiatingPistonResult

Radiation impedance and directivity of a rigid baffled circular piston.

Evaluates the piston resistance and reactance , the mechanical radiation impedance , the low-frequency radiation mass and the directivity index over the given frequencies (Beranek & Mellow §4.4). Pass angles_rad to also sample the far-field directivity pattern .

Parameters

Name Description
radius Piston radius a, m.
frequencies Frequencies f, Hz (scalar or 1-D array), all > 0.
speed_of_sound Speed of sound c, m/s (default 343).
density Air density , kg/m3 (default 1.206).
angles_rad Optional polar angles theta from the axis, rad, at which to sample the directivity pattern.

Returns: A RadiatingPistonResult.

Raises

Exception When
TypeError if density, radius or speed_of_sound is not a single number, or angles_rad or frequencies holds a text or a value that is not a real number.
RadiatingPistonResult(
frequencies: NDArray[np.float64],
ka: NDArray[np.float64],
resistance: NDArray[np.float64],
reactance: NDArray[np.float64],
radiation_resistance: NDArray[np.float64],
radiation_reactance: NDArray[np.float64],
radiation_mass: float,
directivity_index: NDArray[np.float64],
angles_rad: NDArray[np.float64] | None,
directivity: NDArray[np.float64] | None,
radius: float,
speed_of_sound: float,
density: float,
)

Radiation impedance and directivity of a baffled circular piston.

Attributes

Name Description
frequencies Frequencies f, Hz.
ka Wavenumber-radius product ka at each frequency.
resistance Normalized piston resistance (real part of ).
reactance Normalized piston reactance (imaginary part of ).
radiation_resistance Mechanical radiation resistance , N s/m.
radiation_reactance Mechanical radiation reactance , N s/m.
radiation_mass Low-frequency accreted air mass , kg (a single value; the mass limit of radiation_reactance / omega).
directivity_index Directivity index , dB.
angles_rad Polar angles of directivity, rad, or None if not requested.
directivity Far-field directivity as a (n_freq, n_angle) array, or None if angles_rad was not given.
radius Piston radius a, m.
speed_of_sound Speed of sound c, m/s.
density Air density , kg/m3.
RadiatingPistonResult.plot(
ax: Axes | None = None,
*,
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> Axes

Plot the normalized piston resistance and reactance against ka.

Reproduces the classic Beranek & Mellow figure: R1 rising to 1 and X1 peaking then decaying, over the ka range of the result. Requires matplotlib (the [plot] extra).

Parameters

Name Description
language Label language, "en" (default) or "es".
RadiatingPistonResult.plot_geometry(
ax: Axes | None = None,
*,
frequency_index: int | np.integer[Any] = -1,
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> Axes

Draw the baffled piston to scale, with its directivity lobe.

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

Parameters

Name Description
ax Existing axes, or None to create a figure.
frequency_index Index of the frequency whose far-field lobe is overlaid (default: the highest); ignored when the result carries no directivity.
language Label language, "en" (default) or "es".
kwargs Forwarded to the piston rectangle.

Raises

Exception When
TypeError if frequency_index is not a single number.
ValueError if frequency_index does not index one of the computed frequencies, when the result carries a directivity.