Silencer
AUTD3 has a silencer to mute the output. The silencer suppresses the rapid change in the drive signal of the transducer and mutes the output.
Theory
The silencer is based on the paper by Suzuki et al.1.
As a rough outline,
- Amplitude modulation of ultrasound produces audible sound.
- When driving an ultrasound transducer, phase changes cause amplitude fluctuations.
- Therefore, audible noise is generated.
- Amplitude fluctuations can be suppressed by linearly interpolating phase changes and changing them stepwise.
- Therefore, noise can be reduced by doing fine interpolation.
- The silencer is a method to reduce noise by doing fine interpolation.
Silencer Config
To configure the silencer, send Silencer
to the controller.
The silencer is enabled by default.
To disable the silencer, send Silencer::disable
.
use autd3::prelude::*;
#[allow(unused_variables)]
fn main() {
let config = Silencer::default();
let config = Silencer::disable();
}
#include<autd3.hpp>
int main() {
{
const auto config = autd3::Silencer();
}
{
const auto config = autd3::Silencer::disable();
}
return 0; }
using AUTD3Sharp;
{
var config = new Silencer();
}
{
var config = Silencer.Disable();
}
from pyautd3 import Silencer
config = Silencer()
config = Silencer.disable()
To configure the silencer more finely, you need to choose from the following two modes.
The default is fixed completion time mode.
Fixed update rate mode
Phase change by Silencer in Fixed update rate mode
Silencer changes the phase linearly and stepwise to mute the output. In other words, it is almost equivalent to passing the phase time series data through a (simple) moving average filter. However, it differs in that it takes into account the fact that the phase data is periodic.
For example, consider the case where the period of the ultrasound is . In other words, corresponds to and corresponds to . Here, suppose that the phase changes from to at time . The phase change by Silencer is as follows.
On the other hand, suppose that the phase changes from to at time . The phase change by Silencer is as follows. This is because is closer to than in terms of the phase.
That is, Silencer updates the phase as follows for the current and the target value .
Where is the update amount per step (step
of Silencer
).
And the update frequency is .
Small makes the phase change smoother and reduces noise.
According to this implementation, the behavior is different from the moving average filter. One is when the phase change amount shown above is larger than , and the other is when the phase changes again in the middle. Examples of phase changes at this time are shown below.
intensity change by Silencer in Fixed update rate mode
intensity modulation of ultrasound produces audible sound. So, AM noise can be reduced by applying a filter to the intensity parameter .
Unlike the phase, the intensity parameter is not periodic with respect to the period . Therefore, the intensity parameter is updated as follows for the current and the target value .
Configure fixed update rate mode
To configure the fixed update rate mode, do as follows. The arguments correspond to described above.
use std::num::NonZeroU16;
use autd3::prelude::*;
#[allow(unused_variables)]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Silencer::new(
FixedUpdateRate {
intensity: NonZeroU16::new(1).unwrap(),
phase: NonZeroU16::new(1).unwrap(),
}
);
Ok(())
}
#include<autd3.hpp>
int main() {
const auto config =
autd3::Silencer{autd3::FixedUpdateRate{.intensity = 1, .phase = 1}};
return 0; }
using AUTD3Sharp;
var config = new Silencer(new FixedUpdateRate
{
Intensity = 1,
Phase = 1
});
from pyautd3 import Silencer, FixedUpdateRate
config = Silencer(FixedUpdateRate(intensity=1, phase=1))
Fixed completion time mode
In fixed completion time mode, change of phase/intensity is completed in a fixed duration.
Configure fixed completion time mode
To configure the fixed completion time mode, do as follows.
use autd3::prelude::*;
#[allow(unused_variables)]
fn main() {
let config = Silencer::new(
FixedCompletionTime {
intensity: std::time::Duration::from_micros(250),
phase: std::time::Duration::from_micros(250),
}
);
}
#include<chrono>
#include<autd3.hpp>
int main() {
const auto config = autd3::Silencer{
autd3::FixedCompletionTime{.intensity = std::chrono::microseconds(250),
.phase = std::chrono::microseconds(250)}};
return 0; }
using AUTD3Sharp;
var config = new Silencer(new FixedCompletionTime
{
Intensity = Duration.FromMicros(250),
Phase = Duration.FromMicros(250)
});
from pyautd3 import Duration, FixedCompletionTime, Silencer
config = Silencer(
FixedCompletionTime(
intensity=Duration.from_micros(250),
phase=Duration.from_micros(250),
),
)
The default values are for phase change and for intensity change.
In this mode, an error is returned if the phase/intensity change of Modulation
, FociSTM
, or GainSTM
cannot be completed in the time specified by Silencer.
That is, the following conditions must be satisfied.
- Silencer's intensity change completion time sampling period of
Modulation
- Silencer's intensity change completion time sampling period of
FociSTM
/GainSTM
- Silencer's phase change completion time sampling period of
FociSTM
/GainSTM
If you set strict_mode
to false
, you can ignore these restrictions, but it's not recommended.
use autd3::prelude::*;
#[allow(unused_variables)]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Silencer::default().with_strict_mode(false);
Ok(())
}
#include<autd3.hpp>
int main() {
const auto config = autd3::Silencer().with_strict_mode(false);
return 0; }
using AUTD3Sharp;
var config = new Silencer().WithStrictMode(false);
from pyautd3 import Silencer
config = Silencer().with_strict_mode(False)
Suzuki, Shun, et al. "Reducing amplitude fluctuation by gradual phase shift in midair ultrasound haptics." IEEE transactions on haptics 13.1 (2020): 87-93.