Skip to content

naive

src

The Naive method is an algorithm that applies back-propagation to the target sound pressure vector. It does not iterate and is fast, but it does not correct for interference between focal points, so a weak sound field may be generated.

naive(
&NalgebraBackend,
&geometry,
&foci,
wavelength,
&option,
&mut dst,
)?;
Parameter Type Description
geometry &Geometry Device layout
foci &[AmplitudeTarget] Sequence of focal points (position and target amplitude)
wavelength Length Wavelength
option &NaiveOption Additional options (see below)
dst &mut [[Emission; _]] Output buffer

For the common elements (AmplitudeTarget / TransducerMask / LinAlgBackend, etc.), see the Holo overview.

NaiveOption {
constraint,
directivity,
mask,
parallel,
}
Field Type Default
constraint EmissionConstraint Clamp(MIN, MAX)
directivity Directivity Sphere
mask TransducerMask AllEnabled
parallel bool true

For the meaning of each field, see the Holo overview.

parallel decides whether the quantization of the result is spread over several host threads (a GPU backend ignores it).

use autd3_rs::geometry::{Autd3, Geometry, offset};
use autd3_rs::units::{m, mm, s};
use autd3_rs::value::Intensity;
use autd3_rs_pattern::wavelength;
use autd3_rs_pattern_holo::{
AmplitudeTarget, Directivity, EmissionConstraint, NaiveOption, NalgebraBackend, Pa,
TransducerMask, naive,
};
let geometry = Geometry::new(vec![Autd3::default()]);
let mut dst = geometry.pattern_buffer();
naive(
&NalgebraBackend,
&geometry,
&[
AmplitudeTarget {
point: geometry.center() + offset(-30.0 * mm, 0.0 * mm, 150.0 * mm),
amplitude: 2.5e3 * Pa,
},
AmplitudeTarget {
point: geometry.center() + offset(30.0 * mm, 0.0 * mm, 150.0 * mm),
amplitude: 2.5e3 * Pa,
},
],
wavelength(340.0 * m / s),
&NaiveOption {
constraint: EmissionConstraint::Clamp(Intensity::MIN, Intensity::MAX),
directivity: Directivity::Sphere,
mask: TransducerMask::AllEnabled,
parallel: true,
},
&mut dst,
)?;