#fft #dsp #numeric #num-complex

chfft

Fastest Fourier Transform library implemented with pure Rust

11 releases

0.3.4 Jun 18, 2020
0.3.2 Sep 16, 2019
0.2.4 May 26, 2018
0.2.3 Mar 23, 2018
0.1.1 Aug 31, 2017

#454 in Math

Download history 79/week @ 2023-12-18 84/week @ 2023-12-25 94/week @ 2024-01-01 109/week @ 2024-01-08 108/week @ 2024-01-15 402/week @ 2024-01-22 163/week @ 2024-01-29 142/week @ 2024-02-05 479/week @ 2024-02-12 340/week @ 2024-02-19 95/week @ 2024-02-26 82/week @ 2024-03-04 139/week @ 2024-03-11 175/week @ 2024-03-18 105/week @ 2024-03-25 243/week @ 2024-04-01

675 downloads per month
Used in 7 crates (6 directly)

MPL-2.0 license

105KB
2.5K SLoC

chfft

crates.io badge Build Status docs.rs Coverage Status

Fastest Fourier Transform library implemented with pure Rust.

How-to Use

See the crate documentation for more details.

Features

  • CFft1D - Perform a complex-to-complex one-dimensional Fourier transform.

  • CFft2D - Perform a complex-to-complex two-dimensional Fourier transform.

  • Dct1D - Perform a discrete cosine transform.

  • RFft1D - Perform a real-to-complex one-dimensional Fourier transform.

  • Mdct1D - Perform a Modified discrete cosine transform.

Examples

use num_complex::Complex;
use chfft::CFft1D;

fn main() {
    let input = [Complex::new(2.0, 0.0), Complex::new(1.0, 1.0),
                 Complex::new(0.0, 3.0), Complex::new(2.0, 4.0)];
    let mut fft = CFft1D::<f64>::with_len(input.len());
    let output = fft.forward(&input);
    println!("the transform of {:?} is {:?}", input, output);
}

Dependencies

~275KB