struct RealFFT¶
Real-valued FFT implementation using Cooley-Tukey algorithm.
If you're looking to create an FFT-based FX, look to the FFTProcessable
trait used in conjunction with FFTProcess instead. This struct is a
lower-level implementation that provides
FFT and inverse FFT on fixed windows of real values. FFTProcessable structs will enable you to
send audio samples (such as in a custom struct's .next() fn) into and out of
an FFT, doing some manipulation of the magnitudes and phases in between. (FFTProcessable
has this RealFFT struct inside of it.)
Traits: AnyType, Copyable, Movable, UnknownDestructibility
RealFFT Parameters
| Name | Type | Description |
|---|---|---|
| size | Int |
Size of the FFT (must be a power of two). |
| num_chans | Int |
Number of channels for SIMD processing. |
RealFFT Functions¶
struct RealFFT . fn init¶
Initialize the RealFFT struct.
All internal buffers and lookup tables are set up here based on the Parameters.
fn init Signature
fn init Returns
: Self
Static Method
This is a static method.
struct RealFFT . fn fft¶
fn fft Signature
fn fft Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | List |
— | — |
struct RealFFT . fn fft¶
fn fft Signature
fft(mut self, input: List[SIMD[DType.float64, num_chans]], mut mags: List[SIMD[DType.float64, num_chans]], mut phases: List[SIMD[DType.float64, num_chans]])
fn fft Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| input | List |
— | — |
| mags | List |
— | — |
| phases | List |
— | — |
struct RealFFT . fn ifft¶
fn ifft Signature
fn ifft Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| output | List |
— | — |
struct RealFFT . fn ifft¶
fn ifft Signature
ifft(mut self, mags: List[SIMD[DType.float64, num_chans]], phases: List[SIMD[DType.float64, num_chans]], mut output: List[SIMD[DType.float64, num_chans]])
fn ifft Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| mags | List |
— | — |
| phases | List |
— | — |
| output | List |
— | — |
(Functions that are not associated with a Struct)
fn log2_int¶
Compute log base 2 of an integer (assuming n is power of 2).
Signature
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| n | Int |
— | — |
Returns
Type: Int
Documentation generated with mojo doc from Mojo version 0.25.6.1