| 通过运行1个1024点的傅里叶FFT运算来评测STM32F769(STM32官网)浮点运算能力,详细代码等请参考https://www.stmcu.org.cn/module/forum/thread-608108-1-1.html(NUCLEO-F412ZG评测(3):浮点运算能力)一贴。 
   
 工程添加DSP库
 
 
 
   
 启用浮点运算
 
 每执行100次FFT反转1次GPIOJ-5(LED2),通过示波器读取翻转脉宽。
 
 
 复制代码while (1)
  {
  for(i=0;i<100;i++)
  FFT_read();
  GPIOJ->ODR ^=0X0020;
  }
运行结果耗时:复制代码<div>#include "arm_math.h"
#include "arm_const_structs.h"</div><div>static void FFT_read(void)
{uint16_t i;
arm_cfft_radix4_instance_f32 scfft;
arm_cfft_radix4_init_f32(&scfft,BUFFER_SIZE,0,1);
for(i=0;i<FFT_LENGTH;i++)
        {
        inputbuf[2*i]=100+10*arm_sin_f32(2*PI*i*50/FFT_LENGTH)+30*arm_sin_f32(2*PI*i*200/FFT_LENGTH)+10*arm_cos_f32(2*PI*i*400/FFT_LENGTH);  
  inputbuf[2*i+1]=0;                                
  }
   arm_cfft_radix4_f32(&scfft,inputbuf);     
   arm_cmplx_mag_f32(inputbuf,outputbuf,BUFFER_SIZE);
    }
STM32F769    1.5mS;
 STM32F446   4mS;
 STM32F412  18mS;
 
 
 
 
   
 
 当禁止STM32F769浮点运算时,耗时为18mS。可见STM32的浮点运算大大提高了系统性能。
 
 
 
 
 | 
有浮点运算时是1.5mS
谢谢分享