[STM32U5] 【NUCLEO-U575ZI-Q测评】dsp库fft性能测试

[复制链接]
4107|48
 楼主| dql2015 发表于 2023-2-21 22:36 | 显示全部楼层 |阅读模式
NUCLEO-U575ZI-Q采用的是M33核,根据官网资料介绍:
The Cortex®-M33 core features a single-precision FPU (floating-point unit), that supports all the Arm® single-precision data-processing instructions and all the data types.
The Cortex®-M33 core also implements a full set of DSP (digital signal processing) instructions and a MPU (memory protection unit) that enhances the application security.
cc.png

M33核采用ARMv8M架构,
11.png

将STM32CubeU5中的DSP库arm_ARMv8MMLldfsp_math.lib添加到工程中,其中ARMv8MMLldfsp含义如下:
Cortex-M33 内核,l 表示小端格式,f 表示带 FPU 单元,sp 表示 Single Precision 单精度浮点。
aa.png

RTE开启event recorder调试支持:
bb.png

fft测试函数:
  1. #include "arm_math.h"
  2. #include "arm_const_structs.h"
  3. #include "main.h"

  4. #define TEST_LENGTH_SAMPLES 1024
  5. static float32_t testOutput_f32[TEST_LENGTH_SAMPLES*2];
  6. static float32_t testInput_f32[TEST_LENGTH_SAMPLES*2];
  7. static float32_t Phase_f32[TEST_LENGTH_SAMPLES*2];

  8. void arm_cfft_f32_app(void)
  9. {
  10.         arm_status status = ARM_MATH_SUCCESS;
  11.         uint32_t fftSize = TEST_LENGTH_SAMPLES;
  12.         uint32_t refIndex = 213, testIndex = 0;
  13.         uint32_t ifftFlag = 0;
  14.         uint32_t doBitReverse = 1;
  15.         float32_t maxValue;
  16.         uint16_t i;
  17.         //按照实部,虚部,实部,虚部..... 的顺序存储数据
  18.         for(i=0; i<TEST_LENGTH_SAMPLES; i++)
  19.         {
  20.                 //波形是由直流分量,50000Hz 正弦波组成,波形采样率 1024,初始相位 60°
  21.                 testInput_f32[i*2] = 1 + cos(2*3.1415926f*50000*i/1024 + 3.1415926f/3) + cos(2*3.1415926f*1000*i/1024 + 3.1415926f/2) + cos(2*3.1415926f*12000*i/1024 + 3.1415926f/6);
  22.                 testInput_f32[i*2+1] = 0.0;
  23.         }
  24.         for(i=0; i<TEST_LENGTH_SAMPLES; i++)
  25.         {
  26.         printf("%d %f %f\r\n",i,testInput_f32[i*2],testInput_f32[i*2+1]);
  27.         }

  28.         uint32_t start = DWT->CYCCNT;
  29.        
  30.         EventStartA(0);
  31.         arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32, ifftFlag, doBitReverse);
  32.         EventStopA(0);
  33.        
  34.         uint32_t end = DWT->CYCCNT;
  35.         float t = (end - start)*1.0/160;
  36.         printf("t=%fus %fms\r\n",t,t/1e3);

  37.         arm_cmplx_mag_f32(testInput_f32, testOutput_f32, TEST_LENGTH_SAMPLES);

  38.         arm_max_f32(testOutput_f32, fftSize, &maxValue, &testIndex);

  39.         printf("maxValue=%f testIndex=%d\r\n",maxValue,testIndex);
  40. }
调试效果,可以看到进行1024点浮点fft运算耗时1ms左右
屏幕截图 2023-02-21 222253.png
网友测试stm32f407进行fft运算的性能:
屏幕截图 2023-02-21 204024.png

总结:M33核比M4核在dsp性能上似乎没有太多优势。


yangxiaor520 发表于 2023-2-22 07:43 来自手机 | 显示全部楼层
M4和M4F的性能要强些。
abotomson 发表于 2023-3-3 21:05 | 显示全部楼层
进行fft内存不够怎么办               
ulystronglll 发表于 2023-3-3 21:37 | 显示全部楼层
利用CMSISDSP库做FFT运算
sdCAD 发表于 2023-3-3 21:59 | 显示全部楼层
是否含有浮点FFT的运算函数               
hilahope 发表于 2023-3-3 22:26 | 显示全部楼层
STM32F0系列有DSP库支持吗?
plsbackup 发表于 2023-3-4 13:00 | 显示全部楼层
stm32f4的DSP库可以做4096点FFT吗
yorkbarney 发表于 2023-3-4 20:06 | 显示全部楼层
如何使用 DSP算法库FFT和IFFT
sanfuzi 发表于 2023-3-10 10:36 | 显示全部楼层
怎么调用fft 库函数               
软核硬核 发表于 2023-3-10 14:12 | 显示全部楼层
这个DSP能力和内核有关系吧?
Pretext 发表于 2023-3-10 14:13 | 显示全部楼层
看样子确实没什么区别。
芯路例程 发表于 2023-3-10 14:14 | 显示全部楼层
好像还没F4开启FPU来的快。
10299823 发表于 2023-3-10 17:50 | 显示全部楼层
计算512点fft到底需要多少时间
AloneKaven 发表于 2023-3-10 22:23 | 显示全部楼层
hilahope 发表于 2023-3-3 22:26
STM32F0系列有DSP库支持吗?

F0系列应该没有DSP库
deliahouse887 发表于 2023-3-11 20:03 | 显示全部楼层
stm32f4的DSP库可以做4096点FFT吗
wwppd 发表于 2023-3-14 14:14 | 显示全部楼层
如何使用STM32提供的DSP库进行FFT
bartonalfred 发表于 2023-3-14 15:06 | 显示全部楼层
有FFT运算模块吗               
mollylawrence 发表于 2023-3-18 10:55 | 显示全部楼层
FFT是如何实现信号的倒序输入
febgxu 发表于 2023-3-18 14:35 | 显示全部楼层
如何使用 DSP算法库FFT和IFFT
Henryko 发表于 2023-4-2 16:21 | 显示全部楼层
还没F4开启FPU来的快
您需要登录后才可以回帖 登录 | 注册

本版积分规则

104

主题

384

帖子

8

粉丝
快速回复 在线客服 返回列表 返回顶部