From 75c4120258966d3a22d21157659697c0fa66d2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Sun, 13 Dec 2020 12:36:23 +0100 Subject: [PATCH] cossin: buffer test data output --- dsp/src/trig.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dsp/src/trig.rs b/dsp/src/trig.rs index ecef4d4..5a99232 100644 --- a/dsp/src/trig.rs +++ b/dsp/src/trig.rs @@ -86,15 +86,16 @@ mod tests { let mut sum: Complex = (0., 0.); let mut demod: Complex = (0., 0.); - // use std::{fs::File, io::prelude::*, path::Path}; - // let mut file = File::create(Path::new("data.csv")).unwrap(); + // use std::{fs::File, io::{BufWriter, prelude::*}, path::Path}; + // let mut file = BufWriter::new(File::create(Path::new("data.bin")).unwrap()); const PHASE_DEPTH: usize = 20; for phase in 0..(1 << PHASE_DEPTH) { let phase = (phase << (32 - PHASE_DEPTH)) as i32; let have = cossin(phase); - // writeln!(file, " {},{}", have.0, have.1).unwrap(); + // file.write(&have.0.to_le_bytes()).unwrap(); + // file.write(&have.1.to_le_bytes()).unwrap(); let have = (have.0 as f64 / AMPLITUDE, have.1 as f64 / AMPLITUDE);