Skip to content

Controlling Output Intensity

Patterns such as focus have an intensity parameter that controls the output intensity with 8 bits. For example, the following code sets this intensity to about half of its maximum value.

let mut patterns = geometry.pattern_buffer();
autd3_rs_pattern::focus(
&geometry,
target,
wavelength,
&autd3_rs_pattern::FocusOption {
intensity: Intensity(0x80),
..Default::default()
},
&mut patterns,
);

AUTD3 controls the output sound pressure with PWM, and by default the conversion is such that the intensity parameter is roughly linearly proportional to the output sound pressure. Strict linearity is not guaranteed due to individual differences between transducers and other factors, but the output sound pressure can be assumed to increase monotonically with intensity.

For details on the conversion formula to PWM and pulse width, and how to change it, refer to Pulse Width and Output Sound Pressure.

Modulation works by temporally modulating the intensity parameter of a Pattern. Therefore, the actual intensity used is the value obtained by multiplying the intensity parameter specified by Pattern and the like by the modulation data (8 bit) from Modulation and dividing by 255.