SetSilencer
SetSilencer is a command that configures a Silencer, which linearly interpolates abrupt changes in phase and intensity to suppress output noise.
There are two interpolation methods: FixedCompletionTime, which specifies the interpolation completion time, and FixedUpdateRate, which specifies the update amount per interpolation step.
SetSilencer::default();
SetSilencer::disable();
SetSilencer::new(FixedCompletionTime { intensity, phase, strict_mode,});
SetSilencer::new(FixedUpdateRate { intensity, phase });SetSilencer()
SetSilencer.disable()
SetSilencer( FixedCompletionTime( intensity, phase, strict_mode, ))
SetSilencer(FixedUpdateRate(intensity, phase))new SetSilencer();
SetSilencer.Disable();
new SetSilencer(new FixedCompletionTime{ Intensity = intensity, Phase = phase, StrictMode = strictMode,});
new SetSilencer(new FixedUpdateRate(intensityRate, phaseRate));SetSilencer::default() is equivalent to passing the default of FixedCompletionTime.
SetSilencer::disable() disables interpolation by the Silencer (equivalent to completing interpolation in 25 μs).
FixedCompletionTime
Section titled “FixedCompletionTime”Specifies the completion time until the target value is reached. Each update step is in units of the ultrasound period (25 µs), and it is an error if the specified time is not an integer multiple of it.
| Field | Type | Default | Description |
|---|---|---|---|
intensity |
Duration |
250 µs |
Completion time until the intensity reaches the target |
phase |
Duration |
1000 µs |
Completion time until the phase reaches the target |
strict_mode |
bool |
true |
Whether to error when the completion time does not fit within the modulation/STM sampling period |
FixedUpdateRate
Section titled “FixedUpdateRate”Fixes the update amount per interpolation step (every 25 μs).
| Field | Type | Description |
|---|---|---|
intensity |
NonZeroU16 |
Update amount of intensity per step |
phase |
NonZeroU16 |
Update amount of phase per step |
Example
Section titled “Example”use autd3_rs::commands::{Clear, SetSilencer, Synchronize};use autd3_rs::geometry::{Autd3, Geometry};use autd3_rs::Client;use autd3_rs::udp::TransportOption;
let geometry = Geometry::new(vec![Autd3::default()]);let option = TransportOption::default();let mut client = Client::open(&geometry, &option).await?;client.send(Clear).await?;client.send(Synchronize).await?;
client.send(SetSilencer::default()).await?;import asyncio
from autd3 import Client, TransportOptionfrom autd3.commands import Clear, SetSilencer, Synchronizefrom autd3.geometry import Autd3, Geometry
async def main() -> None: geometry = Geometry([Autd3()]) with await Client.open(geometry, TransportOption()) as client: await client.send(Clear()) await client.send(Synchronize())
await client.send(SetSilencer())
asyncio.run(main())using System.Threading.Tasks;using AUTD3;
var geometry = new Geometry(new[] { new Autd3() });using var client = await Client.OpenAsync(geometry, new TransportOption());await client.SendAsync(new Clear());await client.SendAsync(new Synchronize());
await client.SendAsync(new SetSilencer());