From 96a76022eb048ca365d84a6444eb1825a154d588 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 3 Jan 2023 12:32:35 +0100 Subject: Fix trig table init --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 1c6f520..cafc4f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,8 +88,8 @@ impl DDS { let incr = 1.0f32 / TRIG_TABLE_LEN as f32; for i in 0..TRIG_TABLE_LEN { - let i = f32::cos(incr * i as f32 * 2.0 * PI) * 255.0; - let q = f32::sin(incr * i as f32 * 2.0 * PI) * 255.0; + let i = f32::cos(incr * i as f32 * 2.0 * PI) * 127.0; + let q = f32::sin(incr * i as f32 * 2.0 * PI) * 127.0; match waveform { Waveform::Sine => { -- cgit v1.2.3