NMSIS-DSP  Version 1.5.0
NMSIS DSP Software Library
Transform Functions

Modules

 Complex FFT Functions
 
 DCT Type IV Functions
 
 MFCC
 
 Real FFT Functions
 
 Transform Buffer Sizes
 

Detailed Description

NMSIS-DSP provides CFFT and RFFT for different architectures. The implementation of those transforms may be different for the different architectures : different algorithms, different capabilities of the instruction set.

All those variants are not giving exactly the same results but they are passing the same tests with same SNR checks and same threshold for the sample errors.

The APIs for the RISC-V Vector (RVV) variants are different : some additional temporary buffers are required.

Float16 versions are provided but they are not very accurate and should only be used for small FFTs.

Transform initializations

There are several ways to initialize the transform functions. Below explanations are using q15 as example but the same explanations apply to other datatypes.

For the scalar version, you can just use a pre-initialized constant data structure and use it in the riscv_cfft_... function. For instance, &riscv_cfft_sR_q15_len256 for a 256 Q15 CFFT.

If your CPU platform support RISC-V Vector extension, you must use an initialization function. If you know the size of your FFT (or other transform) you can use a specific initialization function for this size only : like riscv_cfft_init_256_q15 for a 256 Q15 complex FFT.

By using a specific initialization function, you give an hint to the linker and it will be able to remove all unused initialization tables (some compilation and link flags must be used for the linker to be able to do this optimization. It is compiler dependent).

If you don't know the size you'll need at runtime, you need to use a function like riscv_cfft_init_q15. If you use such a function, all the tables for all FFT sizes (up to the NMSIS-DSP maximum of 4096) will be included in the build !

On RVV, there is another possibility. You can use riscv_cfft_init_dynamic_q15. This function will allocate a buffer at runtime and compute at runtime all the tables that are required for a specific FFT size. This initialization is also supported by RFFT. The computation to initialize all the tables can take lot of cycles (since several cos and sin must be computed)

Size of buffers according to the target architecture and datatype:
They are described on the page transform buffers.