pounder_test/dsp/src/lib.rs

28 lines
498 B
Rust
Raw Normal View History

2020-12-04 02:09:54 +08:00
#![cfg_attr(not(test), no_std)]
#![cfg_attr(feature = "nightly", feature(asm, core_intrinsics))]
2020-11-22 23:45:32 +08:00
pub type Complex<T> = (T, T);
2020-12-08 02:22:09 +08:00
/// Round up half.
///
/// # Arguments
///
/// `x` - Value to shift and round.
/// `shift` - Number of bits to right shift `x`.
///
/// # Returns
///
/// Shifted and rounded value.
pub fn shift_round(x: i32, shift: i32) -> i32 {
(x + (1 << (shift - 1))) >> shift
}
2020-11-22 23:45:32 +08:00
pub mod iir;
2020-11-23 06:34:38 +08:00
pub mod lockin;
2020-12-04 02:09:54 +08:00
pub mod pll;
2020-12-08 02:22:09 +08:00
pub mod trig;
2020-12-05 16:56:41 +08:00
pub mod unwrap;
#[cfg(test)]
2020-12-05 18:44:09 +08:00
mod testing;