cossin: buffer test data output

This commit is contained in:
Robert Jördens 2020-12-13 12:36:23 +01:00
parent 4fc1f4397e
commit 75c4120258

View File

@ -86,15 +86,16 @@ mod tests {
let mut sum: Complex<f64> = (0., 0.); let mut sum: Complex<f64> = (0., 0.);
let mut demod: Complex<f64> = (0., 0.); let mut demod: Complex<f64> = (0., 0.);
// use std::{fs::File, io::prelude::*, path::Path}; // use std::{fs::File, io::{BufWriter, prelude::*}, path::Path};
// let mut file = File::create(Path::new("data.csv")).unwrap(); // let mut file = BufWriter::new(File::create(Path::new("data.bin")).unwrap());
const PHASE_DEPTH: usize = 20; const PHASE_DEPTH: usize = 20;
for phase in 0..(1 << PHASE_DEPTH) { for phase in 0..(1 << PHASE_DEPTH) {
let phase = (phase << (32 - PHASE_DEPTH)) as i32; let phase = (phase << (32 - PHASE_DEPTH)) as i32;
let have = cossin(phase); 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); let have = (have.0 as f64 / AMPLITUDE, have.1 as f64 / AMPLITUDE);