Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Greedy

Greedy Algorithm with Brute-Force Search, Gain for multiple focal points based on the paper by Suzuki et al.1.

use autd3::prelude::*;
use autd3_gain_holo::{EmissionConstraint, Pa, Greedy, GreedyOption, abs_objective_func};
use std::num::NonZeroU8;

fn main() {
let x1 = 0.;
let y1 = 0.;
let z1 = 0.;
let x2 = 0.;
let y2 = 0.;
let z2 = 0.;
let _ = 
Greedy::new(
    vec![
        (Point3::new(x1, y1, z1), 5e3 * Pa),
        (Point3::new(x2, y2, z2), 5e3 * Pa),
    ],
    GreedyOption {
        phase_quantization_levels: NonZeroU8::new(16).unwrap(),
        constraint: EmissionConstraint::Uniform(Intensity::MAX),
        objective_func: abs_objective_func,
    },
);
}
#include <autd3.hpp>
#include "autd3/gain/holo.hpp"

using namespace autd3;
using gain::holo::Pa;

int main() {
const auto x1 = 0.0;
const auto y1 = 0.0;
const auto z1 = 0.0;
const auto x2 = 0.0;
const auto y2 = 0.0;
const auto z2 = 0.0;
auto g = gain::holo::Greedy(
    std::vector<std::pair<Point3, gain::holo::Amplitude>>{
        {Point3(x1, y1, z1), 5e3 * Pa},
        {Point3(x2, y2, z2), 5e3 * Pa},
    },
    gain::holo::GreedyOption{
        .phase_quantization_levels = 16,
        .constraint = gain::holo::EmissionConstraint::Uniform(
            std::numeric_limits<Intensity>::max())});
  return 0;
}
using AUTD3Sharp.Gain.Holo;

using AUTD3Sharp;
using AUTD3Sharp.Utils;
using static AUTD3Sharp.Units;
var x1 = 0.0f;
var y1 = 0.0f;
var z1 = 0.0f;
var x2 = 0.0f;
var y2 = 0.0f;
var z2 = 0.0f;
new Greedy(
    foci: [
             (new Point3(x1, y1, z1), 5e3f * Pa),
             (new Point3(x2, y2, z2), 5e3f * Pa)
    ],
    option: new GreedyOption
    {
        PhaseQuantizationLevels = 16,
        EmissionConstraint = EmissionConstraint.Uniform(Intensity.Max),
    }
);
import numpy as np
from pyautd3 import Intensity
from pyautd3.gain.holo import Greedy, EmissionConstraint, GreedyOption, Pa

x1 = 0.0
y1 = 0.0
z1 = 0.0
x2 = 0.0
y2 = 0.0
z2 = 0.0
Greedy(
    foci=[(np.array([x1, y1, z1]), 5e3 * Pa), (np.array([x2, y2, z2]), 5e3 * Pa)],
    option=GreedyOption(
        phase_quantization_levels=16,
        constraint=EmissionConstraint.Uniform(Intensity.MAX),
    ),
)

phase_quantization_levels is the discretization depth of the phase, the default is as above. For details on the parameters, refer to the paper1.


  1. Suzuki, Shun, et al. “Radiation Pressure Field Reconstruction for Ultrasound Midair Haptics by Greedy Algorithm with Brute-Force Search.” IEEE Transactions on Haptics (2021). ↩2