czt/
lib.rs

1//! [Chirp Z-transform][1].
2//!
3//! [1]: https://en.wikipedia.org/wiki/Chirp_Z-transform
4
5extern crate dft;
6extern crate num_complex;
7extern crate num_traits;
8
9use num_complex::Complex;
10
11mod transform;
12
13pub use transform::Transform;
14
15/// A complex number with 32-bit parts.
16#[allow(non_camel_case_types)]
17pub type c32 = Complex<f32>;
18
19/// A complex number with 64-bit parts.
20#[allow(non_camel_case_types)]
21pub type c64 = Complex<f64>;
22
23/// Perform the transform.
24///
25/// The function is a shortcut for `Transform::transform`.
26#[inline(always)]
27pub fn transform<D: ?Sized, T>(data: &D, m: usize, w: Complex<T>, a: Complex<T>) -> Vec<Complex<T>>
28    where D: Transform<T>
29{
30    Transform::transform(data, m, w, a)
31}