Skip to content

Holo

Holo is a set of Pattern computations for generating multiple focal points (control points) simultaneously. It optimizes the phase and amplitude of each transducer so that the target sound pressure is obtained at the specified multiple points.

The provided algorithms are as follows.

  • Naive — single-step back-propagation
  • GS — Gerchberg-Saxton method
  • GS-PAT — GS-PAT method
  • Greedy — combinatorial optimization that greedily determines the phase

A struct representing a focal point. It holds a position point and a target amplitude amplitude.

The target amplitude Amplitude is constructed by multiplying an f32 by an amplitude unit.

The amplitude obtained from the optimization may be an intensity that the transducer cannot output as-is. Therefore, a constraint is specified for converting the amplitude obtained from the optimization into the transducer intensity to be output.

Multiply(f32) Normalizes by the maximum value, multiplies by a coefficient, and clamps
Clamp(Intensity, Intensity) Clamps the amplitude to the specified range

It is specified via the constraint field of each Option. The default is Clamp(Intensity::MIN, Intensity::MAX) for all of naive / gs / gspat. greedy does not optimize the intensities, so it has no constraint and takes the intensities as an input.

The directivity model of the transducer. Either the omnidirectional Sphere (default) or the real-hardware directivity T4010A1 can be chosen. It is specified via the directivity field of each Option.

Selects the transducers to include in the optimization. It is specified via the mask field of the naive / gs / gspat Options (the default is AllEnabled). greedy has no mask; transducers whose intensity is 0 are left out of the search.

  • TransducerMask::AllEnabled — uses all transducers (default).
  • TransducerMask::Masked(&[Vec<bool>]) — specifies enabled/disabled for each transducer individually.

naive / gs / gspat delegate linear algebra operations to the LinAlgBackend trait. NalgebraBackend, which computes on the CPU, is used as the standard implementation. The backend is passed as the first argument of each function.

greedy does not use matrix operations, so it does not take a backend.

Python / C# are fixed to NalgebraBackend and do not take a backend argument.

WgpuBackend is a backend that performs calculations on the GPU (Rust only).