GainSTM

GainSTM is different from FociSTM in that it can handle arbitrary Gain. However, the number of Gain that can be used is (in extended mode ).

The usage of GainSTM is as follows. This is a sample that rotates a focus on the circumference of a circle with a radius of centered at a point directly above the center of the array. The circumference is sampled at 200 points, rotating at . (That is, the sampling frequency is .)

use autd3::prelude::*;
fn main() {
let center = Point3::new(0., 0., 150.0 * mm);
let point_num = 200;
let radius = 30.0 * mm;
let _ = 
GainSTM {
    gains: (0..point_num)
        .map(|i| {
            let theta = 2.0 * PI * i as f32 / point_num as f32;
            let p = radius * Vector3::new(theta.cos(), theta.sin(), 0.0);
            Focus {
                pos: center + p,
                option: FocusOption::default(),
            }
        })
        .collect::<Vec<_>>(),
    config: 1.0 * Hz,
    option: GainSTMOption {
        mode: GainSTMMode::PhaseIntensityFull,
    },
};
}
#include <ranges>
#include<autd3.hpp>
#include<autd3/link/nop.hpp>
using namespace std::ranges::views;
int main() {
using namespace autd3;
const Point3 center(0, 0, 150);
const auto points_num = 200;
const auto radius = 30.0f;
std::vector<Focus> gains;
std::ranges::copy(iota(0) | take(points_num) | transform([&](auto i) {
                    const auto theta = 2.0f * pi * static_cast<float>(i) /
                                       static_cast<float>(points_num);
                    return Focus(center + radius * Vector3(std::cos(theta),
                                                           std::sin(theta), 0),
                                 FocusOption{});
                  }),
                  std::back_inserter(gains));
GainSTM(gains, 1.0f * Hz,
        GainSTMOption{.mode = GainSTMMode::PhaseIntensityFull});
return 0; }
using AUTD3Sharp;
using AUTD3Sharp.Utils;
using AUTD3Sharp.Gain;
using AUTD3Sharp.Link;
using static AUTD3Sharp.Units;
var center = new Point3(0, 0, 150);
const int pointNum = 200;
const float radius = 30.0f;
new GainSTM(
    gains: Enumerable.Range(0, pointNum).Select(i =>
    {
        var theta = 2.0f * MathF.PI * i / pointNum;
        return new Focus(
            pos: center + radius * new Vector3(MathF.Cos(theta), MathF.Sin(theta), 0),
            option: new FocusOption()
        );
    }),
    config: 1.0f * Hz,
    option: new GainSTMOption
    {
        Mode = GainSTMMode.PhaseIntensityFull
    }
);
import numpy as np
from pyautd3 import Focus, FocusOption, GainSTM, GainSTMMode, GainSTMOption, Hz
center = np.array([0.0, 0.0, 150.0])
point_num = 200
radius = 30.0
GainSTM(
    gains=(
        Focus(
            pos=center + radius * np.array([np.cos(theta), np.sin(theta), 0]),
            option=FocusOption(),
        )
        for theta in (2.0 * np.pi * i / point_num for i in range(point_num))
    ),
    config=1.0 * Hz,
    option=GainSTMOption(
        mode=GainSTMMode.PhaseIntensityFull,
    ),
)

GainSTMMode

GainSTM sends all phase/intensity data, resulting in high latency1. To address this issue, GainSTM has a PhaseFull mode that sends only the phase, reducing the transmission time by half, and a PhaseHalf mode that compresses the phase to 4 bits, reducing the transmission time to a quarter. In these two modes, the maximum intensity is used regardless of the intensity setting of Gain.

The default mode is PhaseIntensityFull, which sends both intensity and phase data.

1

Approximately 75 times the latency of FociSTM<1>