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,
verbose=True,
)
Bases: SimulationBase
Compute emitted acoustic pressure fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transducer
|
TransducerBase
|
Transducer with geometry, delays, and apodization. |
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
|
Excitation pulse. Shape determines dispatch:
|
None
|
transfer_function
|
callable or None
|
Global frequency-domain transfer function |
None
|
monochromatic
|
bool
|
If True, return CW amplitude at fc. |
False
|
fast_attenuation
|
bool
|
If True (default) and |
True
|
verbose
|
bool
|
Print diagnostic information during simulation. |
True
|
__call__
¶
Compute the pressure field at given field points.
Behavior is determined by instance state:
monochromatic=True→ CW amplitude at fc.excitation=None→ pulsed transient (raw / attenuated SIR).excitation=(L,)→ transient with global excitation convolution.excitation=(L, E)→ transient with per-element excitation.
FieldII equivalences (same transducer geometry):
- Mode 2 →
ρ₀ · h(r, t). Equivalent to FieldIIcalc_h; withrho=1.0(eSDIva default) the arrays are numerically identical up to floating-point precision. - Mode 1 →
|H(r, ω_c)|(SIR Fourier magnitude at fc). Equivalent to FieldIIcalc_h→ FFT → extract the fc bin. - Mode 3 →
ρ₀ · d(e ⊛ ir_tx)/dt ⊛ h(r, t)(pulsed acoustic pressure), whereir_tx = tx.impulse_responseif set, else the bare excitationeis used directly (dv_n/dt = de/dt). Equivalent to FieldIIcalc_hpwithxdc_excitation(Th, e)andxdc_impulse(Th, ir_tx)set accordingly. - Mode 4 → same as mode 3, one loop iteration per element.
For modes 1–3, the per-element loop is triggered when
alpha0 is not None and not fast_attenuation. When triggered,
each element's h_sir is computed separately and attenuation uses the
element center as propagation origin (accurate near-field model).
Set fast_attenuation=True to skip the loop and use the TX center
distance (faster approximation).
Mode 4 always uses the per-element loop; attenuation (if set) automatically uses element-center distances at no extra cost.
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
|
SIR computation method: "auto", "FST", or "sdi". |
"auto"
|
Returns:
| Name | Type | Description |
|---|---|---|
pressure |
ndarray
|
Monochromatic: shape |
coords |
dict
|
Keys "x", "y", "z" for structured grid; "t0", "dt" for transient. |
set
¶
Update a simulation parameter at runtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
One of: "c", "rho", "fs", "alpha0", "freq_power", "excitation", "transfer_function", "monochromatic", "fast_attenuation", "verbose", "transducer". |
required |
value
|
object
|
New value for the parameter. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If name is not a recognized parameter. |
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. |