Skip to content

SIR kernels

The two building blocks every simulator uses: the spatial impulse response of a set of rectangular patches, either sampled in time or in closed form in frequency. They describe the same far-field trapezoid and are linked by rfft(h[n]) ≈ fs·H(ω), so Emission and Reception can use either (method=) and add their transfer functions (excitation, attenuation, obliquity) in one frequency domain.

  • compute_h_sir — h(r, t) on a time grid (FST or SDI kernel).
  • compute_h_sir_spectrum — H(r, ω) at any frequencies: per patch A/(2πl)·D(θ)·sinc(ωΔt1/2)·sinc(ωΔt2/2)·e^{-jω(t_c−t0)}, exact, no sampling.

compute_h_sir_spectrum

compute_h_sir_spectrum(
    points,
    centers,
    wx,
    wy,
    apod,
    delays,
    inv_c,
    t0,
    omega,
    *,
    eu=None,
    ev=None,
    soft_baffle=False,
)

Closed-form spatial impulse response spectrum H(r, ω) of one aperture.

Sum over patches of A/(2πl)·D(θ)·sinc(ωΔt1/2)·sinc(ωΔt2/2)·e^{-jω(t_c−t0)} — the Fourier transform of the far-field trapezoidal SIR, evaluated exactly at the requested frequencies. rfft of the sampled SIR h[n] (origin t0) ≈ fs·H.

Parameters:

Name Type Description Default
points (P, 3) numpy.ndarray

Field points in metres.

required
centers (M, 3) numpy.ndarray

Patch centres in metres.

required
wx (M,) numpy.ndarray

Patch widths along the two in-plane axes (metres).

required
wy (M,) numpy.ndarray

Patch widths along the two in-plane axes (metres).

required
apod (M,) numpy.ndarray

Apodization weight per patch.

required
delays (M,) numpy.ndarray

Firing delay per patch (seconds).

required
inv_c float

Inverse speed of sound 1/c (s/m).

required
t0 float

Time origin (seconds) the phase is referenced to.

required
omega (N_ω,) numpy.ndarray

Angular frequencies 2πf (rad/s), uniformly spaced (one value is allowed).

required
eu (M, 3) numpy.ndarray or None

Patch in-plane unit vectors; the normal is eu × ev. None → flat patches in the xy-plane facing +z.

None
ev (M, 3) numpy.ndarray or None

Patch in-plane unit vectors; the normal is eu × ev. None → flat patches in the xy-plane facing +z.

None
soft_baffle bool

Soft (pressure-release) baffle: weight each patch by cosθ = max(0, n·u). False is the rigid baffle (no obliquity).

False

Returns:

Type Description
(P, N_ω) numpy.ndarray

SIR spectrum H in metres (complex64).

compute_h_sir

compute_h_sir(
    P,
    M,
    T,
    dt,
    time_grid,
    points,
    centers,
    wx,
    wy,
    inv_c,
    fs,
    apodization_sub_elem,
    delays_sub_elem,
    method_flag=1,
    eu=None,
    ev=None,
    return_deltak=False,
    soft_baffle=False,
)

Compute the SIR impulse response for field points and patches.

Parameters:

Name Type Description Default
P int

Number of field points.

required
M int

Number of transducer sub-patches.

required
T int

Number of time samples.

required
dt float

Time step size.

required
time_grid ndarray

Array of time samples.

required
points (ndarray, shape(P, 3))

Coordinates of field points.

required
centers (ndarray, shape(M, 3))

Coordinates of patch centres.

required
wx (ndarray, shape(M))

Per-patch width in x-direction.

required
wy (ndarray, shape(M))

Per-patch width in y-direction.

required
inv_c float

Inverse of the speed of sound (1/c).

required
fs float

Sampling frequency in Hz.

required
apodization_sub_elem (ndarray, shape(M))

Apodization weights per patch.

required
delays_sub_elem (ndarray, shape(M))

Delay values per patch in seconds.

required
method_flag int

Computation method: 0 FST, 1 SDI, 2 auto. Default 1.

1
eu (ndarray, shape(M, 3))

Local u-tangent unit vectors per patch. None = global x-axis.

None
ev (ndarray, shape(M, 3))

Local v-tangent unit vectors per patch. None = global y-axis.

None
return_deltak bool

If True, include range_k_matrix (per-patch trapezoid width in samples, shape (P, M)) in the returned info dict. Default False skips that allocation — most callers never read it.

False
soft_baffle bool

Soft (pressure-release) baffle: weight each patch by cosθ. Default False is the rigid baffle.

False

Returns:

Type Description
tuple

(h_out, info_struct) where h_out is shape (P, T) and info_struct is a dict with min_time, max_time, and (only when return_deltak=True) range_k_matrix.