package ooura
- License: BSD-3-Clause
- Repository: https://github.com/Omair-R/OOURA_ODIN/tree/main/ooura
Index
Types (2)
Constants (0)
This section is empty.
Variables (0)
This section is empty.
Procedure Groups (1)
Types
FFT1d_Plan ¶
FFT1d_Plan :: struct($FT: FFT1d_Type) { … // See source for fields }
Instances of this structure maintain information and work arrays nessecary for performing the FFT routines. It is automatically populated and does not require any manual reassignments of its internal properties. Please, do not manually manipulate it.
Related Procedures With Parameters
- delete_fft1d_plan
- execute_fft1d_plan_c
- execute_fft1d_plan_f
- execute_fft1d_plan (procedure groups)
Related Procedures With Returns
FFT1d_Type ¶
FFT1d_Type :: enum untyped integer {
DFT,
RDFT,
DCT,
DST,
DFCT,
DFST,
}
DFT: Discrete Fourier Transform
RDFT: Real Discrete Fourier Transform
DCT: Discrete Cosine Transform
DST: Discrete Sine Transform
DFCT: Cosine Transform of RDFT (Real Symmetric DFT)
DFST: Sine Transform of RDFT (Real Anti-symmetric DFT)
Related Procedures With Parameters
Constants
This section is empty.
Variables
This section is empty.
Procedures
dct1d ¶
dct1d :: proc(x: []f64, inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []f64, ok: bool) #optional_ok {…}
This is a simple procedure for executing the 1D Discrete Cosine Transform (DCT) based on the FFT algorithm. It is a simplified interface that doesn't require the instancing and maintenance of an FFT1_Plan. Use this when you're performing the transform for a specific size only once. In case you require multiple transforms to be done on multiple signals, create a plan and use that instead.
Inputs:
x: The real signal to be transformed.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
delete_fft1d_plan ¶
delete_fft1d_plan :: proc(fft_plan: FFT1d_Plan($FT), allocator := context.allocator) -> (err: runtime.Allocator_Error) {…}
Frees the memory allocated for the fft1d plan.
Inputs:
fft_plan: The FFT1d_Plan instance whose allocated memory will be freed.
allocator: .
Returns:
err: The allocator error.
dfct1d ¶
dfct1d :: proc(x: []f64, inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []f64, ok: bool) #optional_ok {…}
This is a simple procedure for executing the 1D Real Symmetric DFT (DFCT) based on the FFT algorithm. It is a simplified interface that doesn't require the instancing and maintenance of an FFT1_Plan. Use this when you're performing the transform for a specific size only once. In case you require multiple transforms to be done on multiple signals, create a plan and use that instead.
Inputs:
x: The real signal to be transformed. (The length should be a power of 2 + 1)
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
dfst1d ¶
dfst1d :: proc(x: []f64, inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []f64, ok: bool) #optional_ok {…}
This is a simple procedure for executing the 1D Real Anti-symmetric DFT (DFST) based on the FFT algorithm. It is a simplified interface that doesn't require the instancing and maintenance of an FFT1_Plan. Use this when you're performing the transform for a specific size only once. In case you require multiple transforms to be done on multiple signals, create a plan and use that instead.
Inputs:
x: The real signal to be transformed. (The length should be a power of 2 - 1)
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
dft1d ¶
dft1d :: proc(x: []complex128, inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []complex128, ok: bool) #optional_ok {…}
This is a simple procedure for executing the 1D Discrete Fourier Transform(DFT) based on the FFT algorithm. It is a simplified interface that doesn't require the instancing and maintenance of an FFT1_Plan. Use this when you're performing the transform for a specific size only once. In case you require multiple transforms to be done on multiple signals, create a plan and use that instead.
Inputs:
x: The complex signal to be transformed.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
dst1d ¶
dst1d :: proc(x: []f64, inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []f64, ok: bool) #optional_ok {…}
This is a simple procedure for executing the 1D Discrete Sine Transform(DST) based on the FFT algorithm. It is a simplified interface that doesn't require the instancing and maintenance of an FFT1_Plan. Use this when you're performing the transform for a specific size only once. In case you require multiple transforms to be done on multiple signals, create a plan and use that instead.
Inputs:
x: The real signal to be transformed.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
execute_fft1d_plan_c ¶
execute_fft1d_plan_c :: proc(x: []complex128, fft_plan: FFT1d_Plan($FT), inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []complex128, ok: bool) #optional_ok {…}
Executes a 1D fft plan that expects complex input/output arrays.
Use of this procedure is discouraged in favour of the procedure group.
Inputs:
x: The complex signal to be transformed.
fft_plan: The FFT1d_Plan that holds the necessary execution data.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: an optional boolean for error handling.
Related Procedure Groups
execute_fft1d_plan_f ¶
execute_fft1d_plan_f :: proc(x: []f64, fft_plan: FFT1d_Plan($FT), inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []f64, ok: bool) #optional_ok {…}
Executes a 1D fft plan that expects real input/output arrays.
Use of this procedure is discouraged in favour of the procedure group.
Note: Use of the DFCT requires an input of size n+1 and DFST requires n-1.
Inputs:
x: The real signal to be transformed.
fft_plan: The FFT1d_Plan that holds the necessary execution data.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
Related Procedure Groups
is_power2 ¶
is_power2 :: proc(n: untyped integer) -> bool {…}
is_power4 ¶
is_power4 :: proc(n: untyped integer) -> bool {…}
is_power8 ¶
is_power8 :: proc(n: untyped integer) -> bool {…}
make_fft1d_plan ¶
make_fft1d_plan :: proc(n: untyped integer, $fft_type: FFT1d_Type, allocator := context.allocator, location := #caller_location) -> (plan: FFT1d_Plan($FT), ok: bool) #optional_ok {…}
Allocates the necessary memory for the a 1D fft plan, based on the type and size provided. The plan is just a structure of necessary work arrays that the library needs to perform the transforms.
For efficiency you may reuse the plan if you're planning to perform multiple similar transforms.
Inputs:
n: The size of the signal transformed. must be a power of 2.
fft_type: The type of transform based on the FFT1d_Type enum.
allocator: .
location: .
Returns:
plan: The 1D fft plan.
ok: an optional boolean for error handling.
rdft1d ¶
rdft1d :: proc(x: []complex128, inverse: bool = false, allocator := context.allocator, location := #caller_location) -> (result: []complex128, ok: bool) #optional_ok {…}
This is a simple procedure for executing the 1D Real DFT based on the FFT algorithm. It is a simplified interface that doesn't require the instancing and maintenance of an FFT1_Plan. Use this when you're performing the transform for a specific size only once. In case you require multiple transforms to be done on multiple signals, create a plan and use that instead.
Inputs:
x: The complex signal to be transformed.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
Procedure Groups
execute_fft1d_plan ¶
execute_fft1d_plan :: proc{ execute_fft1d_plan_c, execute_fft1d_plan_f, }
Executes a 1D fft plan.
Note: Use of the DFCT requires an input of size n+1 and DFST requires n-1.
Inputs:
x: The real/complex signal to be transformed.
fft_plan: The FFT1d_Plan that holds the necessary execution data.
inverse: Specifies the direction of the transform. (no scaling is required)
allocator: .
location: .
Returns:
result: The transformed signal as per the direction chosen.
ok: An optional boolean for error handling.
Source Files
Generation Information
Generated with odin version dev-2025-10 (vendor "odin") Linux_amd64 @ 2025-10-12 13:06:00.762867810 +0000 UTC