pub struct RealFft { /* private fields */ }Expand description
A planned FFT for real input of length n. The spectrum of a real signal is conjugate
symmetric, so only the n/2 + 1 non-negative-frequency bins are returned.
For even n the signal is packed into a complex sequence of half the length (even samples as
real parts, odd samples as imaginary parts), transformed, and untangled with one twiddle per
bin. For n of a few thousand or more this takes a quarter to a third less time than a complex
FFT of the real data; for n up to about a thousand the O(n) packing and untangling cost as
much as the shorter FFT saves (and more for very short signals). Odd lengths use a full
complex transform. The forward transform is unscaled; RealFft::inverse divides by n, so it
exactly inverts RealFft::forward.
Implementations§
Source§impl RealFft
impl RealFft
pub fn new(n: usize) -> Result<Self, ErrorsJSL>
pub fn is_empty(&self) -> bool
Sourcepub fn spectrum_len(&self) -> usize
pub fn spectrum_len(&self) -> usize
The number of spectrum bins, n/2 + 1.