use realfft::{RealFftPlanner, FftNum, RealToComplex}; fn main() { let mut planner: RealFftPlanner = RealFftPlanner::new(); //let rfft = planner.plan_fft_forward(4); let rfft = planner.plan_fft_forward(40); let mut scratch = rfft.make_scratch_vec(); let mut out_data = rfft.make_output_vec(); //let mut in_data = [1., 0.4, 0.3, -1.]; let mut in_data = [1.; 40]; //let mut in_data = [ rfft.process_with_scratch(&mut in_data, &mut out_data, &mut scratch).unwrap(); println!("{:?}", &out_data); let scale = 1./40.; for elem in out_data { println!("{}", elem.norm_sqr().sqrt() * scale); println!("{}", elem.l1_norm() * scale); //println!("{}", elem * scale); } }