硬汉嵌入式论坛

 找回密码
 立即注册
查看: 3375|回复: 0
收起左侧

[DSP] 新版DSP库浮点FFT推荐使用混合基函数arm_cfft_f32,而基2函数arm_cfft_radix2_f32和基4函数arm_cfft_radix4_f32将废弃

[复制链接]

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107101
QQ
发表于 2021-5-22 09:55:45 | 显示全部楼层 |阅读模式

ARM说明:



  1. Earlier releases of the library provided separate radix-2 and radix-4
  2.                    algorithms that operated on floating-point data.  These functions are still
  3.                    provided but are deprecated.  The older functions are slower and less general
  4.                    than the new functions.

  5. DSP库的早期发行版提供了单独的radix-2和radix-4对浮点数据进行运算的算法。 这些功能仍然提供,但已弃用。 相比新版函数,老版的功能较慢且通用性较低
复制代码


arm_cfft_f32采用的是混合基,基8配合基2,基8配合基4或者基8

  1. void arm_cfft_f32(
  2.   const arm_cfft_instance_f32 * S,
  3.         float32_t * p1,
  4.         uint8_t ifftFlag,
  5.         uint8_t bitReverseFlag)
  6. {
  7.   uint32_t  L = S->fftLen, l;
  8.   float32_t invL, * pSrc;

  9.   if (ifftFlag == 1U)
  10.   {
  11.     /* Conjugate input data */
  12.     pSrc = p1 + 1;
  13.     for (l = 0; l < L; l++)
  14.     {
  15.       *pSrc = -*pSrc;
  16.       pSrc += 2;
  17.     }
  18.   }

  19.   switch (L)
  20.   {
  21.   case 16:
  22.   case 128:
  23.   case 1024:
  24.     arm_cfft_radix8by2_f32 ( (arm_cfft_instance_f32 *) S, p1);
  25.     break;
  26.   case 32:
  27.   case 256:
  28.   case 2048:
  29.     arm_cfft_radix8by4_f32 ( (arm_cfft_instance_f32 *) S, p1);
  30.     break;
  31.   case 64:
  32.   case 512:
  33.   case 4096:
  34.     arm_radix8_butterfly_f32 ( p1, L, (float32_t *) S->pTwiddle, 1);
  35.     break;
  36.   }

  37.   if ( bitReverseFlag )
  38.     arm_bitreversal_32 ((uint32_t*) p1, S->bitRevLength, S->pBitRevTable);

  39.   if (ifftFlag == 1U)
  40.   {
  41.     invL = 1.0f / (float32_t)L;

  42.     /* Conjugate and scale output data */
  43.     pSrc = p1;
  44.     for (l= 0; l < L; l++)
  45.     {
  46.       *pSrc++ *=   invL ;
  47.       *pSrc    = -(*pSrc) * invL;
  48.       pSrc++;
  49.     }
  50.   }
  51. }
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-17 21:02 , Processed in 0.233302 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表