Fixing modulation waveform scale
This commit is contained in:
parent
9569df9e82
commit
4780a97528
|
@ -20,7 +20,7 @@ use stabilizer::net::{Action, MqttInterface};
|
||||||
|
|
||||||
// A constant sinusoid to send on the DAC output.
|
// A constant sinusoid to send on the DAC output.
|
||||||
// Full-scale gives a +/- 10.24V amplitude waveform. Scale it down to give +/- 1V.
|
// Full-scale gives a +/- 10.24V amplitude waveform. Scale it down to give +/- 1V.
|
||||||
const ONE: i16 = ((1.0 / 10.24) * u16::MAX as f32) as _;
|
const ONE: i16 = ((1.0 / 10.24) * i16::MAX as f32) as _;
|
||||||
const SQRT2: i16 = (ONE as f32 * 0.707) as _;
|
const SQRT2: i16 = (ONE as f32 * 0.707) as _;
|
||||||
const DAC_SEQUENCE: [i16; design_parameters::SAMPLE_BUFFER_SIZE] =
|
const DAC_SEQUENCE: [i16; design_parameters::SAMPLE_BUFFER_SIZE] =
|
||||||
[ONE, SQRT2, 0, -SQRT2, -ONE, -SQRT2, 0, SQRT2];
|
[ONE, SQRT2, 0, -SQRT2, -ONE, -SQRT2, 0, SQRT2];
|
||||||
|
|
Loading…
Reference in New Issue