This is the development version of the documentation. It may change before the next release. See 0.6.x for the latest release.
radiation_pressure
srcradiation_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
radiation_pressure(&src, &mut dst);radiation_pressure(src, dst)Modulation.RadiationPressure(src, dst);radiation_pressure
Section titled “radiation_pressure”| 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.
Example
Section titled “Example”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);from autd3.units import Hzfrom autd3_modulation import SineOption, modulation_buffer, radiation_pressure, sine
src = modulation_buffer()sine(150 * Hz, SineOption(), src)
dst = modulation_buffer()
radiation_pressure(src, dst)using AUTD3;using static AUTD3.Units;
var src = Modulation.ModulationBuffer();Modulation.Sine(150 * Hz, new SineOption(), src);
var dst = Modulation.ModulationBuffer();
Modulation.RadiationPressure(src, dst);