Crates.io | aether_primitives |
lib.rs | aether_primitives |
version | 0.1.0 |
source | src |
created_at | 2018-11-21 17:12:39.40693 |
updated_at | 2018-11-21 17:12:39.40693 |
description | Helpers for common SDR and signal generation operations |
homepage | https://github.com/razorheadfx/aether_primitives |
repository | https://github.com/razorheadfx/aether_primitives |
max_upload_size | |
id | 97995 |
size | 58,991 |
Aether is designed to ease development of SDR applications by providing convenient (low-level) building blocks for common operations.
Core operations are implemented in the form of the VecOps trait implemented for Vecs/Slices of the C compatible num::Complexcf32
for short).
// #[macro_use] // includes the assert_evm macro
// extern crate aether_primitives;
// use aether_primitives::{cf32, vecops::VecOps};
// The main sample type is cf32 which is a type alias for num::Complex<f32>
let mut v = vec![cf32::new(2.0, 2.0); 100];
let twos = v.clone();
let ones = vec![cf32::new(1.0, 1.0); 100];
let correct = vec![cf32::new(1.0, -1.0); 100];
v.vec_div(&twos)
.vec_mul(&twos)
.vec_zero() // zero the vector
.vec_add(&ones)
.vec_sub(&twos)
.vec_clone(&ones)
.vec_mutate(|c| c.im = -1.0)
.vec_conj()
.vec_mirror(); // mirror swaps elements around the midpoint of the array
/// ensure each element's error vector magnitude vs the correct vector is below -80dB
assert_evm!(&v, &correct, -80.0);
dyn <Trait>
) will be avoided.fft_chfft
)