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
|
transfer_function
|
callable or None
|
Extra frequency response |
None
|
monochromatic
|
bool
|
True → pressure amplitude |
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: |
None
|
verbose
|
bool
|
Print diagnostic information during simulation. |
True
|
__call__
¶
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 |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
pressure |
ndarray
|
Monochromatic: amplitude |
coords |
dict
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If a per-element excitation does not have one column per element. |
set
¶
Update a simulation parameter at runtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A key of |
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
¶
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 |
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. |