Sine
Modulation
to transform the square of the sound pressure to a sine wave.
Specify the frequency as an integer in the constructor.
use autd3::prelude::*;
#[allow(unused_variables)]
fn main() {
let m = Sine::new(150 * Hz);
}
#include<autd3.hpp>
int main() {
autd3::Sine m(150 * autd3::Hz);
return 0; }
using AUTD3Sharp.Modulation;
using static AUTD3Sharp.Units;
var m = new Sine(150u * Hz);
from pyautd3 import Hz, Sine
m = Sine(150 * Hz)
Set intensity and offset
Sine
applies AM so that the waveform of the sound pressure is
Here, and can be specified by with_intensity
and with_offset
, respectively (defaults are 0xFF
and 0x80
).
use autd3::prelude::*;
#[allow(unused_variables)]
fn main() {
let m = Sine::new(150 * Hz)
.with_intensity(0xFF)
.with_offset(0xFF / 2);
}
#include<autd3.hpp>
int main() {
const auto m =
autd3::Sine(150 * autd3::Hz).with_intensity(0xFF).with_offset(0xFF / 2);
return 0; }
using AUTD3Sharp;
using AUTD3Sharp.Modulation;
using static AUTD3Sharp.Units;
var m = new Sine(150u * Hz)
.WithIntensity(0xFF)
.WithOffset(0xFF / 2);
from pyautd3 import Hz, Sine
m = Sine(150 * Hz).with_intensity(0xFF).with_offset(0xFF // 2)