### Perform In-place 32-point CFFT Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_32.html This example demonstrates how to use the `cfft_32` function to perform an in-place 32-point CFFT. Ensure you have the `microfft` crate imported and `Complex32` type available. ```rust use microfft::{Complex32, complex::cfft_32}; let mut input = [Complex32::default(); 32]; let result = cfft_32(&mut input); ``` -------------------------------- ### Perform 16-point IFFT Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_16.html This example demonstrates how to perform an in-place 16-point Inverse Fast Fourier Transform. Ensure you have the `microfft` crate imported and a mutable array of 16 `Complex32` values. ```rust use microfft::{Complex32, inverse::ifft_16}; let mut input = [Complex32::default(); 16]; let result = ifft_16(&mut input); ``` -------------------------------- ### Compute Real FFT (RFFT) of Sine Wave Samples Source: https://docs.rs/microfft/0.6.0/microfft/index.html Demonstrates generating sine wave samples and computing their Real Fast Fourier Transform using `rfft_16`. Note that the Nyquist frequency component is packed into the imaginary part of the DC bin and must be cleared before amplitude calculation. ```rust use std::convert::TryInto; use std::f32::consts::PI; // generate 16 samples of a sine wave at frequency 3 let sample_count = 16; let signal_freq = 3.; let sample_interval = 1. / sample_count as f32; let mut samples: Vec<_> = (0..sample_count) .map(|i| (2. * PI * signal_freq * sample_interval * i as f32).sin()) .collect(); // compute the RFFT of the samples let mut samples: [_; 16] = samples.try_into().unwrap(); let spectrum = microfft::real::rfft_16(&mut samples); // since the real-valued coefficient at the Nyquist frequency is packed into the // imaginary part of the DC bin, it must be cleared before computing the amplitudes spectrum[0].im = 0.0; // the spectrum has a spike at index `signal_freq` let amplitudes: Vec<_> = spectrum.iter().map(|c| c.norm() as u32).collect(); assert_eq!(&litudes, &[0, 0, 0, 8, 0, 0, 0, 0]); ``` -------------------------------- ### Macro for RFFT Implementations Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/rfft.rs.html A macro to generate `RFft` implementations for various sizes. ```APIDOC ## Macro rfft_impls! ### Description Generates `RFft` implementations for different FFT sizes. ### Usage ```rust rfft_impls! { (RFftN4, CFftN2), (RFftN8, CFftN4), ... } ``` This macro takes a list of tuples, where each tuple contains the name of the RFFT struct and its corresponding CFFT struct. ``` -------------------------------- ### Perform 64-point IFFT Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_64.html Use this snippet to perform an in-place 64-point Inverse Fast Fourier Transform. Ensure you have the `microfft` crate imported and a mutable array of 64 `Complex32` values. ```rust use microfft::{Complex32, inverse::ifft_64}; let mut input = [Complex32::default(); 64]; let result = ifft_64(&mut input); ``` -------------------------------- ### cfft_64 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 64-point CFFT. Requires the 'size-64' feature flag. ```APIDOC ## cfft_64 ### Description Performs an in-place 64-point CFFT. ### Method `cfft_64(input: &mut [Complex32; 64]) -> &mut [Complex32; 64]` ### Parameters - `input` (&mut [Complex32; 64]): A mutable slice of 64 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_64}; let mut input = [Complex32::default(); 64]; let result = cfft_64(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### Compute Real FFT with microfft Source: https://docs.rs/microfft/0.6.0/index.html Generates samples of a sine wave and computes its Real Fast Fourier Transform (RFFT) using `microfft::real::rfft_16`. Note that the Nyquist frequency coefficient is packed into the imaginary part of the DC bin and must be cleared. ```rust use std::convert::TryInto; use std::f32::consts::PI; // generate 16 samples of a sine wave at frequency 3 let sample_count = 16; let signal_freq = 3.; let sample_interval = 1. / sample_count as f32; let mut samples: Vec<_> = (0..sample_count) .map(|i| (2. * PI * signal_freq * sample_interval * i as f32).sin()) .collect(); // compute the RFFT of the samples let mut samples: [_; 16] = samples.try_into().unwrap(); let spectrum = microfft::real::rfft_16(&mut samples); // since the real-valued coefficient at the Nyquist frequency is packed into the // imaginary part of the DC bin, it must be cleared before computing the amplitudes spectrum[0].im = 0.0; // the spectrum has a spike at index `signal_freq` let amplitudes: Vec<_> = spectrum.iter().map(|c| c.norm() as u32).collect(); assert_eq!(&litudes, &[0, 0, 0, 8, 0, 0, 0, 0]); ``` -------------------------------- ### rfft_64 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 64-point Real FFT (RFFT). ```APIDOC ## rfft_64 ### Description Perform an in-place 64-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### Perform a 2-point IFFT Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_2.html Use this snippet to perform an in-place 2-point Inverse Fast Fourier Transform. Ensure you import `Complex32` and `ifft_2` from `microfft`. ```rust use microfft::{Complex32, inverse::ifft_2}; let mut input = [Complex32::default(); 2]; let result = ifft_2(&mut input); ``` -------------------------------- ### Perform In-Place 512-Point CFFT Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_512.html Demonstrates how to use the cfft_512 function to perform an in-place 512-point Complex Fast Fourier Transform. The function modifies the input array directly. ```rust use microfft::{Complex32, complex::cfft_512}; let mut input = [Complex32::default(); 512]; let result = cfft_512(&mut input); ``` -------------------------------- ### CFFT Implementation Macro Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html This macro generates in-place CFFT functions for different sizes. It includes documentation and feature flag configuration for each generated function. Use this macro to define FFT functions for specific sizes. ```rust macro_rules! cfft_impls { ( $( $N:expr => ($cfft_N:ident, $CFftN:ident $(, $feature:expr)?), )* ) => { $( #[doc = concat!("Perform an in-place ", stringify!($N), "-point CFFT.")] #[doc = ""] #[doc = "# Example"] #[doc = ""] #[doc = "```"] #[doc = concat!("use microfft::{Complex32, complex::", stringify!($cfft_N), ");")] #[doc = ""] #[doc = concat!("let mut input = [Complex32::default(); ", stringify!($N), "];")] #[doc = concat!("let result = ", stringify!($cfft_N), "(&mut input);")] #[doc = "```"] $( #[cfg(feature = $feature)] )? #[inline] #[must_use] pub fn $cfft_N(input: &mut [Complex32; $N]) -> &mut [Complex32; $N] { $CFftN::transform(input); input } )* }; } cfft_impls! { 2 => (cfft_2, CFftN2), 4 => (cfft_4, CFftN4, "size-4"), 8 => (cfft_8, CFftN8, "size-8"), 16 => (cfft_16, CFftN16, "size-16"), 32 => (cfft_32, CFftN32, "size-32"), 64 => (cfft_64, CFftN64, "size-64"), 128 => (cfft_128, CFftN128, "size-128"), 256 => (cfft_256, CFftN256, "size-256"), 512 => (cfft_512, CFftN512, "size-512"), 1024 => (cfft_1024, CFftN1024, "size-1024"), 2048 => (cfft_2048, CFftN2048, "size-2048"), 4096 => (cfft_4096, CFftN4096, "size-4096"), 8192 => (cfft_8192, CFftN8192, "size-8192"), 16384 => (cfft_16384, CFftN16384, "size-16384"), 32768 => (cfft_32768, CFftN32768, "size-32768"), } ``` -------------------------------- ### rfft_256 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 256-point Real FFT (RFFT). ```APIDOC ## rfft_256 ### Description Perform an in-place 256-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### CFft Macro for Implementations Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/cfft.rs.html A macro to generate `CFft` implementations for various FFT sizes (N=4 to N=32768). It takes tuples of log2(N), N, the struct name, and the corresponding `Half` type. ```rust macro_rules! cfft_impls { ( $( $I:expr => ($N:expr, $CFftN:ident, $Half:ident), )* ) => { $( #[allow(dead_code)] pub(crate) struct $CFftN; impl CFft for $CFftN { type Half = $Half; const N: usize = $N; const LOG2_N: usize = $I; } )* }; } cfft_impls! { 2 => (4, CFftN4, CFftN2), 3 => (8, CFftN8, CFftN4), 4 => (16, CFftN16, CFftN8), 5 => (32, CFftN32, CFftN16), 6 => (64, CFftN64, CFftN32), 7 => (128, CFftN128, CFftN64), 8 => (256, CFftN256, CFftN128), 9 => (512, CFftN512, CFftN256), 10 => (1024, CFftN1024, CFftN512), 11 => (2048, CFftN2048, CFftN1024), 12 => (4096, CFftN4096, CFftN2048), 13 => (8192, CFftN8192, CFftN4096), 14 => (16384, CFftN16384, CFftN8192), 15 => (32768, CFftN32768, CFftN16384), } ``` -------------------------------- ### cfft_512 Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_512.html Performs an in-place 512-point CFFT. ```APIDOC ## Function cfft_512 ### Signature ```rust pub fn cfft_512(input: &mut [Complex32; 512]) -> &mut [Complex32; 512] ``` ### Description Perform an in-place 512-point CFFT. ### Example ```rust use microfft::{Complex32, complex::cfft_512}; let mut input = [Complex32::default(); 512]; let result = cfft_512(&mut input); ``` ``` -------------------------------- ### RFFT Implementation Macro Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/rfft.rs.html A macro to generate `RFft` implementations for various sizes (N4 to N32768). Each implementation specifies its corresponding `CFft` type. ```rust macro_rules! rfft_impls { ( $( ($RFftN:ident, $CFftN:ident), )* ) => { $( #[allow(dead_code)] pub(crate) struct $RFftN; impl RFft for $RFftN { type CFft = $CFftN; } )* }; } rfft_impls! { (RFftN4, CFftN2), (RFftN8, CFftN4), (RFftN16, CFftN8), (RFftN32, CFftN16), (RFftN64, CFftN32), (RFftN128, CFftN64), (RFftN256, CFftN128), (RFftN512, CFftN256), (RFftN1024, CFftN512), (RFftN2048, CFftN1024), (RFftN4096, CFftN2048), (RFftN8192, CFftN4096), (RFftN16384, CFftN8192), (RFftN32768, CFftN16384), } ``` -------------------------------- ### cfft_64 Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_64.html Performs an in-place 64-point CFFT on an array of Complex32. ```APIDOC ## Function cfft_64 ### Summary ``` pub fn cfft_64(input: &mut [Complex32; 64]) -> &mut [Complex32; 64] ``` ### Description Perform an in-place 64-point CFFT. ### Example ```rust use microfft::{Complex32, complex::cfft_64}; let mut input = [Complex32::default(); 64]; let result = cfft_64(&mut input); ``` ``` -------------------------------- ### cfft_256 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 256-point CFFT. Requires the 'size-256' feature flag. ```APIDOC ## cfft_256 ### Description Performs an in-place 256-point CFFT. ### Method `cfft_256(input: &mut [Complex32; 256]) -> &mut [Complex32; 256]` ### Parameters - `input` (&mut [Complex32; 256]): A mutable slice of 256 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_256}; let mut input = [Complex32::default(); 256]; let result = cfft_256(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### IFFT Implementation Macro Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/ifft.rs.html A macro to generate `IFft` implementations for different FFT sizes, associating each `IFftN` struct with its corresponding `CFftN` struct. ```rust macro_rules! ifft_impls { ( $( ($IFftN:ident, $CFftN:ident), )* ) => { $( pub(crate) struct $IFftN; impl IFft for $IFftN { type CFft = $CFftN; } )* }; } ifft_impls! { (IFftN2, CFftN2), (IFftN4, CFftN4), (IFftN8, CFftN8), (IFftN16, CFftN16), (IFftN32, CFftN32), (IFftN64, CFftN64), (IFftN128, CFftN128), (IFftN256, CFftN256), (IFftN512, CFftN512), (IFftN1024, CFftN1024), (IFftN2048, CFftN2048), (IFftN4096, CFftN4096), (IFftN8192, CFftN8192), (IFftN16384, CFftN16384), (IFftN32768, CFftN32768), } ``` -------------------------------- ### CFftN1 Implementation Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/cfft.rs.html Concrete implementation of `CFft` for an FFT size of 1. It overrides `bit_reverse_reorder` and `compute_butterflies` to do nothing, as they are no-ops for N=1. ```rust pub(crate) struct CFftN1; impl CFft for CFftN1 { type Half = Self; const N: usize = 1; const LOG2_N: usize = 0; #[inline] fn bit_reverse_reorder(x: &mut [Complex32]) { debug_assert_eq!(x.len(), 1); } #[inline] fn compute_butterflies(x: &mut [Complex32]) { debug_assert_eq!(x.len(), 1); } } ``` -------------------------------- ### rfft_16 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 16-point Real FFT (RFFT). ```APIDOC ## rfft_16 ### Description Perform an in-place 16-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### rfft_2 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 2-point Real FFT (RFFT). ```APIDOC ## rfft_2 ### Description Perform an in-place 2-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### rfft_8 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 8-point Real FFT (RFFT). ```APIDOC ## rfft_8 ### Description Perform an in-place 8-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### rfft_16384 Source: https://docs.rs/microfft/0.6.0/src/microfft/real.rs.html Perform an in-place 16384-point RFFT. ```APIDOC ## rfft_16384 ### Description Perform an in-place 16384-point RFFT. ### Method `rfft_16384` ### Parameters #### Input - `input`: `&mut [f32; 16384]` - A mutable slice representing the input real-valued data. ### Return Value - `&mut [Complex32; 8192]` - A mutable slice containing the complex-valued FFT output. ### Example ```rust use microfft::real::rfft_16384; let mut input = [0.0f32; 16384]; let result = rfft_16384(&mut input); ``` ``` -------------------------------- ### ifft_32 Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_32.html Performs an in-place 32-point IFFT. ```APIDOC ## ifft_32 ### Description Performs an in-place 32-point IFFT. ### Signature ```rust pub fn ifft_32(input: &mut [Complex32; 32]) -> &mut [Complex32; 32] ``` ### Parameters * `input` - A mutable reference to a fixed-size array of 32 `Complex32` numbers. ### Returns A mutable reference to the modified `input` array. ### Example ```rust use microfft::{Complex32, inverse::ifft_32}; let mut input = [Complex32::default(); 32]; let result = ifft_32(&mut input); ``` ``` -------------------------------- ### ifft_256 Source: https://docs.rs/microfft/0.6.0/src/microfft/inverse.rs.html Performs an in-place 256-point IFFT. Requires the 'size-256' feature flag. ```APIDOC ## ifft_256 ### Description Performs an in-place 256-point IFFT. Requires the 'size-256' feature flag. ### Function Signature `pub fn ifft_256(input: &mut [Complex32; 256]) -> &mut [Complex32; 256]` ### Parameters * `input` - A mutable slice of `Complex32` with a fixed size of 256. ### Returns A mutable reference to the input slice after the IFFT operation. ### Example ```rust use microfft::{Complex32, inverse::ifft_256}; let mut input = [Complex32::default(); 256]; let result = ifft_256(&mut input); ``` ``` -------------------------------- ### rfft_512 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 512-point Real FFT (RFFT). ```APIDOC ## rfft_512 ### Description Perform an in-place 512-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### rfft_32 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 32-point Real FFT (RFFT). ```APIDOC ## rfft_32 ### Description Perform an in-place 32-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### cfft_4096 Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_4096.html Performs an in-place 4096-point CFFT. ```APIDOC ## Function cfft_4096 ### Summary ``` pub fn cfft_4096(input: &mut [Complex32; 4096]) -> &mut [Complex32; 4096] ``` ### Description Perform an in-place 4096-point CFFT. ### Example ```rust use microfft::{Complex32, complex::cfft_4096}; let mut input = [Complex32::default(); 4096]; let result = cfft_4096(&mut input); ``` ``` -------------------------------- ### Assert FFT Size Feature Configuration Source: https://docs.rs/microfft/0.6.0/src/microfft/lib.rs.html Ensures that at least one of the `size-*` features is enabled for the microfft crate. This is a compile-time assertion to prevent the crate from being used without specifying the desired FFT size. ```rust assert_cfg!( any( feature = "size-4", feature = "size-8", feature = "size-16", feature = "size-32", feature = "size-64", feature = "size-128", feature = "size-256", feature = "size-512", feature = "size-1024", feature = "size-2048", feature = "size-4096", feature = "size-8192", feature = "size-16384", feature = "size-32768", ), "At least one of the `size-*` features of this crate must be set." ); ``` -------------------------------- ### CFftN2 Implementation Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/cfft.rs.html Concrete implementation of `CFft` for an FFT size of 2. It defines `Half` as `CFftN1` and provides a specific `compute_butterflies` implementation for N=2. ```rust pub(crate) struct CFftN2; impl CFft for CFftN2 { type Half = CFftN1; const N: usize = 2; const LOG2_N: usize = 1; #[inline] fn compute_butterflies(x: &mut [Complex32]) { debug_assert_eq!(x.len(), 2); let (x_0, x_1) = (x[0], x[1]); x[0] = x_0 + x_1; x[1] = x_0 - x_1; } } ``` -------------------------------- ### cfft_16 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 16-point CFFT. Requires the 'size-16' feature flag. ```APIDOC ## cfft_16 ### Description Performs an in-place 16-point CFFT. ### Method `cfft_16(input: &mut [Complex32; 16]) -> &mut [Complex32; 16]` ### Parameters - `input` (&mut [Complex32; 16]): A mutable slice of 16 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_16}; let mut input = [Complex32::default(); 16]; let result = cfft_16(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### rfft_4 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 4-point Real FFT (RFFT). ```APIDOC ## rfft_4 ### Description Perform an in-place 4-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### ifft_64 Source: https://docs.rs/microfft/0.6.0/microfft/inverse/index.html Performs an in-place 64-point Inverse Fast Fourier Transform. ```APIDOC ## ifft_64 ### Description Perform an in-place 64-point IFFT. ### Function Signature `fn ifft_64(buffer: &mut [Complex])` ``` -------------------------------- ### rfft_2048 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 2048-point Real FFT (RFFT). ```APIDOC ## rfft_2048 ### Description Perform an in-place 2048-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### rfft_4096 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 4096-point Real FFT (RFFT). ```APIDOC ## rfft_4096 ### Description Perform an in-place 4096-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### cfft_512 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 512-point CFFT. Requires the 'size-512' feature flag. ```APIDOC ## cfft_512 ### Description Performs an in-place 512-point CFFT. ### Method `cfft_512(input: &mut [Complex32; 512]) -> &mut [Complex32; 512]` ### Parameters - `input` (&mut [Complex32; 512]): A mutable slice of 512 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_512}; let mut input = [Complex32::default(); 512]; let result = cfft_512(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### cfft_8 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 8-point CFFT. Requires the 'size-8' feature flag. ```APIDOC ## cfft_8 ### Description Performs an in-place 8-point CFFT. ### Method `cfft_8(input: &mut [Complex32; 8]) -> &mut [Complex32; 8]` ### Parameters - `input` (&mut [Complex32; 8]): A mutable slice of 8 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_8}; let mut input = [Complex32::default(); 8]; let result = cfft_8(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### Perform an in-place 8-point CFFT Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_8.html Use this function to perform an in-place 8-point Complex Fast Fourier Transform. Ensure the input slice has a length of 8. ```rust use microfft::{Complex32, complex::cfft_8}; let mut input = [Complex32::default(); 8]; let result = cfft_8(&mut input); ``` -------------------------------- ### Real FFT Functions Source: https://docs.rs/microfft/0.6.0/microfft/all.html Provides functions for computing the Fast Fourier Transform (FFT) on real numbers for various sizes. ```APIDOC ## Real FFT Functions ### Description Computes the Discrete Fourier Transform (DFT) of a real-valued sequence using the Fast Fourier Transform (FFT) algorithm. Supports various input sizes. ### Functions - `real::rfft_2(buffer)` - `real::rfft_4(buffer)` - `real::rfft_8(buffer)` - `real::rfft_16(buffer)` - `real::rfft_32(buffer)` - `real::rfft_64(buffer)` - `real::rfft_128(buffer)` - `real::rfft_256(buffer)` - `real::rfft_512(buffer)` - `real::rfft_1024(buffer)` - `real::rfft_2048(buffer)` - `real::rfft_4096(buffer)` - `real::rfft_8192(buffer)` ### Parameters - `buffer`: A mutable slice of real numbers to be transformed in-place. ``` -------------------------------- ### cfft_32 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 32-point CFFT. Requires the 'size-32' feature flag. ```APIDOC ## cfft_32 ### Description Performs an in-place 32-point CFFT. ### Method `cfft_32(input: &mut [Complex32; 32]) -> &mut [Complex32; 32]` ### Parameters - `input` (&mut [Complex32; 32]): A mutable slice of 32 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_32}; let mut input = [Complex32::default(); 32]; let result = cfft_32(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### cfft_64 Source: https://docs.rs/microfft/0.6.0/microfft/complex/index.html Performs an in-place 64-point Complex Fast Fourier Transform (CFFT). ```APIDOC ## cfft_64 ### Description Perform an in-place 64-point CFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified in source) ### Request Example (Not specified in source) ### Response (Not specified in source) ``` -------------------------------- ### cfft_8 Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_8.html Performs an in-place 8-point CFFT on an array of Complex32. ```APIDOC ## Function cfft_8 ### Description Perform an in-place 8-point CFFT. ### Signature ```rust pub fn cfft_8(input: &mut [Complex32; 8]) -> &mut [Complex32; 8] ``` ### Parameters * `input` - A mutable reference to a fixed-size array of 8 `Complex32` elements. ### Returns A mutable reference to the modified `input` array. ### Example ```rust use microfft::{Complex32, complex::cfft_8}; let mut input = [Complex32::default(); 8]; let result = cfft_8(&mut input); ``` ``` -------------------------------- ### cfft_2048 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 2048-point CFFT. Requires the 'size-2048' feature flag. ```APIDOC ## cfft_2048 ### Description Performs an in-place 2048-point CFFT. ### Method `cfft_2048(input: &mut [Complex32; 2048]) -> &mut [Complex32; 2048]` ### Parameters - `input` (&mut [Complex32; 2048]): A mutable slice of 2048 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_2048}; let mut input = [Complex32::default(); 2048]; let result = cfft_2048(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### Perform 1024-point CFFT - microfft Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_1024.html Use this snippet to perform an in-place 1024-point Complex Fast Fourier Transform. Ensure the input array is of type Complex32 and has a length of 1024. ```rust use microfft::{Complex32, complex::cfft_1024}; let mut input = [Complex32::default(); 1024]; let result = cfft_1024(&mut input); ``` -------------------------------- ### cfft_256 Source: https://docs.rs/microfft/0.6.0/microfft/complex/index.html Performs an in-place 256-point Complex Fast Fourier Transform (CFFT). ```APIDOC ## cfft_256 ### Description Perform an in-place 256-point CFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified in source) ### Request Example (Not specified in source) ### Response (Not specified in source) ``` -------------------------------- ### ifft_256 Source: https://docs.rs/microfft/0.6.0/microfft/inverse/index.html Performs an in-place 256-point Inverse Fast Fourier Transform. ```APIDOC ## ifft_256 ### Description Perform an in-place 256-point IFFT. ### Function Signature `fn ifft_256(buffer: &mut [Complex])` ``` -------------------------------- ### cfft_16384 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 16384-point CFFT. Requires the 'size-16384' feature flag. ```APIDOC ## cfft_16384 ### Description Performs an in-place 16384-point CFFT. ### Method `cfft_16384(input: &mut [Complex32; 16384]) -> &mut [Complex32; 16384]` ### Parameters - `input` (&mut [Complex32; 16384]): A mutable slice of 16384 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_16384}; let mut input = [Complex32::default(); 16384]; let result = cfft_16384(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### ifft_256 Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_256.html Performs an in-place 256-point IFFT on a mutable slice of Complex32. ```APIDOC ## Function ifft_256 ### Signature ``` pub fn ifft_256(input: &mut [Complex32; 256]) -> &mut [Complex32; 256] ``` ### Description Perform an in-place 256-point IFFT. ### Example ```rust use microfft::{Complex32, inverse::ifft_256}; let mut input = [Complex32::default(); 256]; let result = ifft_256(&mut input); ``` ``` -------------------------------- ### rfft_128 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 128-point Real FFT (RFFT). ```APIDOC ## rfft_128 ### Description Perform an in-place 128-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### rfft_1024 Source: https://docs.rs/microfft/0.6.0/microfft/real/index.html Perform an in-place 1024-point Real FFT (RFFT). ```APIDOC ## rfft_1024 ### Description Perform an in-place 1024-point RFFT. ### Method (Not specified, likely a function call in a Rust SDK) ### Parameters (Not specified) ### Request Example (Not specified) ### Response (Not specified) ``` -------------------------------- ### Perform In-place 2048-point CFFT Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_2048.html Use this function to perform an in-place 2048-point Complex Fast Fourier Transform. Ensure the input slice is exactly 2048 elements long. ```rust use microfft::{Complex32, complex::cfft_2048}; let mut input = [Complex32::default(); 2048]; let result = cfft_2048(&mut input); ``` -------------------------------- ### Inverse FFT Implementations Source: https://docs.rs/microfft/0.6.0/src/microfft/inverse.rs.html Generates in-place IFFT functions for different sizes (powers of two). Each function takes a mutable slice of Complex32 and performs the IFFT. Feature flags can be used to conditionally compile specific sizes. ```rust macro_rules! ifft_impls { ( $( $N:expr => ($ifft_N:ident, $IFftN:ident $(, $feature:expr)?), )* ) => { $( #[doc = concat!("Perform an in-place ", stringify!($N), "-point IFFT.")] #[doc = ""] #[doc = "# Example"] #[doc = ""] #[doc = "```"] #[doc = concat!("use microfft::{Complex32, inverse::", stringify!($ifft_N), "};")] #[doc = ""] #[doc = concat!("let mut input = [Complex32::default(); ", stringify!($N), "];")] #[doc = concat!("let result = ", stringify!($ifft_N), "(&mut input);")] #[doc = "```"] $( #[cfg(feature = $feature)] )? #[inline] #[must_use] pub fn $ifft_N(input: &mut [Complex32; $N]) -> &mut [Complex32; $N] { $IFftN::transform(input); input } )* }; } ifft_impls! { 2 => (ifft_2, IFftN2), 4 => (ifft_4, IFftN4, "size-4"), 8 => (ifft_8, IFftN8, "size-8"), 16 => (ifft_16, IFftN16, "size-16"), 32 => (ifft_32, IFftN32, "size-32"), 64 => (ifft_64, IFftN64, "size-64"), 128 => (ifft_128, IFftN128, "size-128"), 256 => (ifft_256, IFftN256, "size-256"), 512 => (ifft_512, IFftN512, "size-512"), 1024 => (ifft_1024, IFftN1024, "size-1024"), 2048 => (ifft_2048, IFftN2048, "size-2048"), 4096 => (ifft_4096, IFftN4096, "size-4096"), 8192 => (ifft_8192, IFftN8192, "size-8192"), 16384 => (ifft_16384, IFftN16384, "size-16384"), 32768 => (ifft_32768, IFftN32768, "size-32768"), } ``` -------------------------------- ### Perform 64-point CFFT Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_64.html Use this function to perform an in-place 64-point Complex Fast Fourier Transform. Ensure the input is a mutable array of 64 Complex32 elements. ```rust use microfft::{Complex32, complex::cfft_64}; let mut input = [Complex32::default(); 64]; let result = cfft_64(&mut input); ``` -------------------------------- ### cfft_16 Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_16.html Performs an in-place 16-point CFFT (Complex Fast Fourier Transform). ```APIDOC ## Function cfft_16 ### Summary ``` pub fn cfft_16(input: &mut [Complex32; 16]) -> &mut [Complex32; 16] ``` ### Description Perform an in-place 16-point CFFT. ### Example ```rust use microfft::{Complex32, complex::cfft_16}; let mut input = [Complex32::default(); 16]; let result = cfft_16(&mut input); ``` ``` -------------------------------- ### rfft_32768 Source: https://docs.rs/microfft/0.6.0/src/microfft/real.rs.html Perform an in-place 32768-point RFFT. ```APIDOC ## rfft_32768 ### Description Perform an in-place 32768-point RFFT. ### Method `rfft_32768` ### Parameters #### Input - `input`: `&mut [f32; 32768]` - A mutable slice representing the input real-valued data. ### Return Value - `&mut [Complex32; 16384]` - A mutable slice containing the complex-valued FFT output. ### Example ```rust use microfft::real::rfft_32768; let mut input = [0.0f32; 32768]; let result = rfft_32768(&mut input); ``` ``` -------------------------------- ### cfft_4 Source: https://docs.rs/microfft/0.6.0/src/microfft/complex.rs.html Performs an in-place 4-point CFFT. Requires the 'size-4' feature flag. ```APIDOC ## cfft_4 ### Description Performs an in-place 4-point CFFT. ### Method `cfft_4(input: &mut [Complex32; 4]) -> &mut [Complex32; 4]` ### Parameters - `input` (&mut [Complex32; 4]): A mutable slice of 4 Complex32 numbers to perform the FFT on. ### Request Example ```rust use microfft::{Complex32, complex::cfft_4}; let mut input = [Complex32::default(); 4]; let result = cfft_4(&mut input); ``` ### Response Returns a mutable reference to the input slice after the in-place FFT operation. ``` -------------------------------- ### Perform 256-point IFFT Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_256.html Use this function to compute an in-place 256-point Inverse Fast Fourier Transform. Ensure the input slice is exactly 256 elements long. ```rust use microfft::{Complex32, inverse::ifft_256}; let mut input = [Complex32::default(); 256]; let result = ifft_256(&mut input); ``` -------------------------------- ### RFftN2 Implementation Source: https://docs.rs/microfft/0.6.0/src/microfft/impls/rfft.rs.html Specific implementation of `RFft` for N=2. ```APIDOC ## Struct RFftN2 ### Description Implementation of `RFft` for N=2. ### Associated Types * `CFft`: `CFftN1` ``` -------------------------------- ### Perform 64-point RFFT Source: https://docs.rs/microfft/0.6.0/microfft/real/fn.rfft_64.html Use this function to perform an in-place 64-point Real Fast Fourier Transform. Ensure the input array is mutable. ```rust use microfft::real::rfft_64; let mut input = [0.; 64]; let result = rfft_64(&mut input); ``` -------------------------------- ### Perform 16-point CFFT Source: https://docs.rs/microfft/0.6.0/microfft/complex/fn.cfft_16.html Use this snippet to perform an in-place 16-point CFFT. Ensure the input is a mutable array of 16 Complex32 elements. ```rust use microfft::{Complex32, complex::cfft_16}; let mut input = [Complex32::default(); 16]; let result = cfft_16(&mut input); ``` -------------------------------- ### ifft_512 Source: https://docs.rs/microfft/0.6.0/src/microfft/inverse.rs.html Performs an in-place 512-point IFFT. Requires the 'size-512' feature flag. ```APIDOC ## ifft_512 ### Description Performs an in-place 512-point IFFT. Requires the 'size-512' feature flag. ### Function Signature `pub fn ifft_512(input: &mut [Complex32; 512]) -> &mut [Complex32; 512]` ### Parameters * `input` - A mutable slice of `Complex32` with a fixed size of 512. ### Returns A mutable reference to the input slice after the IFFT operation. ### Example ```rust use microfft::{Complex32, inverse::ifft_512}; let mut input = [Complex32::default(); 512]; let result = ifft_512(&mut input); ``` ``` -------------------------------- ### ifft_1024 Source: https://docs.rs/microfft/0.6.0/microfft/inverse/fn.ifft_1024.html Performs an in-place 1024-point IFFT. ```APIDOC ## Function ifft_1024 ### Description Perform an in-place 1024-point IFFT. ### Signature ```rust pub fn ifft_1024(input: &mut [Complex32; 1024]) -> &mut [Complex32; 1024] ``` ### Example ```rust use microfft::{Complex32, inverse::ifft_1024}; let mut input = [Complex32::default(); 1024]; let result = ifft_1024(&mut input); ``` ```