Skip to content

radiation_pressure

src

radiation_pressure applies radiation pressure correction to a modulation waveform. It corrects a waveform computed by sine or similar.

Acoustic radiation pressure is proportional to the square of the sound pressure. Since sine and similar functions specify the amplitude of the sound pressure, taking the square root of each sample is necessary when the radiation pressure should match the target waveform. radiation_pressure performs this correction.

Each sample is rewritten by the following equation.

radiation_pressure(&src, &mut dst);
Parameter Type Description
src &[u8] modulation waveform before correction
dst &mut Vec<u8> buffer to write the corrected waveform

There is also radiation_pressure_inplace, which rewrites in place.

use autd3_rs::units::Hz;
use autd3_rs_modulation::{SineOption, radiation_pressure, sine};
let mut src = Vec::new();
sine(150 * Hz, &SineOption::default(), &mut src)?;
let mut dst = Vec::new();
radiation_pressure(&src, &mut dst);