Skip to content

Emission

Forward pressure-field simulator. See the Emission user guide for modes and examples.

Emission

Emission(
    transducer,
    *,
    c=1540.0,
    rho=1.0,
    fs=100000000.0,
    alpha0=None,
    freq_power=1.0,
    excitation=None,
    transfer_function=None,
    monochromatic=False,
    fast_attenuation=True,
    method=None,
    verbose=True,
)

Bases: SimulationBase

Compute emitted acoustic pressure fields (monochromatic or transient).

Parameters:

Name Type Description Default
transducer TransducerBase

Transducer with geometry, delays, apodization and optional impulse response.

required
c float

Speed of sound (m/s).

1540.0
rho float

Medium density (kg/m^3).

1.0
fs float

Sampling frequency (Hz).

100e6
alpha0 float or None

Attenuation in dB/(MHz^y·cm). None = no attenuation.

None
freq_power float

Power-law exponent y.

1.0
excitation ndarray or None

Drive pulse: None (the output is the SIR itself), (L,) global, or (L, E) one pulse per element. Convolved with transducer.impulse_response.

None
transfer_function callable or None

Extra frequency response TF(freq_hz) -> array, multiplied in the frequency domain (applied at fc in monochromatic mode).

None
monochromatic bool

True → pressure amplitude |P(r, fc)| = ρ·ωc·|H(r, ωc)| (Pa per 1 m/s of velocity amplitude) at the centre frequency; no pulse.

False
fast_attenuation bool

Attenuation path origin: True → transducer centre (one path per point); False → each element's centre (per-element paths, accurate near field).

True
method str or None

SIR source: "spectral", "temporal" (= "sdi"), "fst", "auto"; None picks the faster for the mode (see the module docstring).

None
verbose bool

Print diagnostic information during simulation.

True

__call__

__call__(
    field_points_mm, *, method=None
) -> tuple[ndarray, dict]

Compute the pressure field at given field points.

Modes (instance state): monochromatic=True → |P(r, fc)|; otherwise the transient field ρ₀·∂v/∂t ⊛ h for the global (L,) or per-element (L, E) excitation, or the SIR itself when excitation is None. Field II equivalents: calc_h (no excitation), calc_hp (excitation + impulse).

Parameters:

Name Type Description Default
field_points_mm dict or (N, 3) ndarray

Grid spec dict (mm) or raw point array (mm).

required
method str or None

Override self.method for this call.

None

Returns:

Name Type Description
pressure ndarray

Monochromatic: amplitude (Nx, Ny, Nz) / (N,). Transient: signed pressure (Nt, Nx, Ny, Nz) / (Nt, N) (compression > 0, rarefaction < 0; take abs or an envelope for field maps).

coords dict

"x", "y", "z" for a grid; "t0", "dt" when transient.

Raises:

Type Description
ValueError

If a per-element excitation does not have one column per element.

set

set(name: str, value)

Update a simulation parameter at runtime.

Parameters:

Name Type Description Default
name str

A key of _SETTABLE, "transfer_function" or "transducer".

required
value object

New value for the parameter.

required

Raises:

Type Description
ValueError

If name is not a recognized parameter, or an unknown method.

TypeError

If value has the wrong type.

compute_deltak

compute_deltak(field_points_mm, *, method='auto')

Per-patch trapezoid width Δk (in samples) for every field point.

SIR-accuracy diagnostic: Δk is how many time samples each patch's trapezoidal SIR spans at this geometry. The far-field/sampling approximation degrades when Δk is too small (a patch barely resolved in time), and the auto method switches FST→SDI above 8 + 2T/M. Inspect this to check a chosen no_sub_x/no_sub_y resolves every patch.

Parameters:

Name Type Description Default
field_points_mm dict or (N, 3) numpy.ndarray

Grid spec dict (mm) or raw point array (mm), as in __call__.

required
method str

SIR method ("auto", "FST", "sdi") — only affects which patches the kernel would take the SDI path for; Δk itself is method-independent.

"auto"

Returns:

Type Description
(P, M) numpy.ndarray

Trapezoid width in samples for each field point P and patch M.