ARM DSP 库的FFT算法点数增加到8192的疑问?
[复制链接]
最近要用到ARM M4的芯片做一个FFT算法,对音频信号做分析;但是ARM 的DSP库最大只有4096个点的FFT算法;
若要做8192的FFT,要生成一个旋转因子表与位反转表,但是位反转表不知道怎么生成?希望有网友帮忙解释一下;
方案一:打算看能不能自己修改出一个8192点的FFT;
调用函数:
void arm_cfft_f32(
const arm_cfft_instance_f32 * S,
float32_t * p1,
uint8_t ifftFlag,
uint8_t bitReverseFlag)
Parameters 参数解释
[in] S points to an instance of the floating-point CFFT structure
[in,out] p1 points to the complex data buffer of size 2*fftLen. Processing occurs in-place
[in] ifftFlag flag that selects transform direction
value = 0: forward transform
value = 1: inverse transform
[in] bitReverseFlag flag that enables / disables bit reversal of output
value = 0: disables bit reversal of output
value = 1: enables bit reversal of output
这其中S里包含旋转因子表与位反转表;
如16点的:
const arm_cfft_instance_f32 arm_cfft_sR_f32_len16 = {
16, twiddleCoef_16, armBitRevIndexTable16, ARMBITREVINDEXTABLE__16_TABLE_LENGTH
};
旋转因子生成有函数,所以8192的也能生成;
/**
* \par
* Example code for Floating-point Twiddle factors Generation:
* \par
* <pre>for(i = 0; i< N/; i++)
* {
* twiddleCoef[2*i]= cos(i * 2*PI/(float)N);
* twiddleCoef[2*i+1]= sin(i * 2*PI/(float)N);
* } </pre>
* \par
* where N = 16 and PI = 3.14159265358979
* \par
* Cos and Sin values are in interleaved fashion
*
*/
const float32_t twiddleCoef_16[32] = {
1.000000000f, 0.000000000f,
0.923879533f, 0.382683432f,
0.707106781f, 0.707106781f,
0.382683432f, 0.923879533f,
0.000000000f, 1.000000000f,
-0.382683432f, 0.923879533f,
-0.707106781f, 0.707106781f,
-0.923879533f, 0.382683432f,
-1.000000000f, 0.000000000f,
-0.923879533f, -0.382683432f,
-0.707106781f, -0.707106781f,
-0.382683432f, -0.923879533f,
-0.000000000f, -1.000000000f,
0.382683432f, -0.923879533f,
0.707106781f, -0.707106781f,
0.923879533f, -0.382683432f
};
反转表,为个表没看懂是怎么生成的,希望有网友帮忙解释一下;
const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH] =
{
//8x2, size 20
8,64, 24,72, 16,64, 40,80, 32,64, 56,88, 48,72, 88,104, 72,96, 104,112
};
|