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(intensity: intensityRate, phase: 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::SetSilencer;use autd3_rs::geometry::{Autd3, Geometry};use autd3_rs::{Client, ClientConfig};use autd3_rs_link_nop::Nop;
let geometry = Geometry::new(vec![Autd3::default()]);let client = Client::open(&geometry, Nop, ClientConfig::default()).await?;
let mut builder = client.datagram_builder();builder.push(SetSilencer::default());let frames = builder.build()?;for frame in &frames { client.send_checked(frame).await?;}
client.close().await?;import asyncio
from autd3 import Client, ClientConfigfrom autd3.commands import SetSilencerfrom autd3.geometry import Autd3, Geometryfrom autd3_link_nop import Nop
async def main() -> None: geometry = Geometry([Autd3([0.0, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0])]) client = await Client.open(geometry, Nop(), ClientConfig())
builder = client.datagram_builder() builder.push(SetSilencer()) frames = builder.build() for frame in frames: await client.send_checked(frame)
await client.close()
asyncio.run(main())using System.Numerics;using System.Threading.Tasks;using AUTD3;using AUTD3.Link;using Nop = AUTD3.Link.Nop;
var geometry = new Geometry(new[] { new Autd3(Vector3.Zero) });var client = await Client.OpenAsync(geometry, new Nop(), new ClientConfig());
var builder = client.DatagramBuilder();builder.Push(new SetSilencer());var frames = builder.Build();foreach (var frame in frames){ await client.SendCheckedAsync(frame);}
await client.CloseAsync();