1112 views|2 replies

1237

Posts

66

Resources
The OP
 

【NUCLEO-H743ZI】3. DSP basic function test [Copy link]

This post was last edited by dql2016 on 2023-9-28 23:02

Download the latest DSP library from GitHub:

链接已隐藏,如需查看请登录或者注册
. The latest released version is 5.9.0. Add the dsp library based on the serial port printing example.

Add the group Drivers/DSP on the left side of Keil, add the header file path, add the header file path required by DSP, and add the path Drivers\CMSIS\DSP\Include :

Add static library files, STM32H7 is M7 core, double precision floating point, use little endian format, select library Drivers\CMSIS\DSP\Lib\ARM\arm_cortexM7lfdp_math.lib

Add macro definition ARM_MATH_LOOPUNROLL :

Its function is to process small batches of 4 to speed up execution.

Select armcc6 compiler, turn on FPU, STM32H7 supports double precision floating point, turn on Double Precision:

By adding the header file #include "arm_math.h" in main.c, you can call the functions of the DSP library. This completes the porting of the DSP library.

Add test code:

    float32_t   pSrcA;
    float32_t   pSrcB;  
    float32_t   pDst;  
    
    q31_t  pSrcA1;  
    q31_t  pSrcB1;  
    q31_t  pDst1;  

    q15_t  pSrcA2;  
    q15_t  pSrcB2;  
    q15_t  pDst2; 

    q7_t  pSrcA3; 
    q7_t  pSrcB3;  
    q7_t  pDst3;  

    
    /*求和*********************************/
    pSrcA = 0.1f;
    pSrcB = 0.2f;
    arm_add_f32(&pSrcA, &pSrcB, &pDst, 1);
    printf("arm_add_f32 = %f\r\n", pDst);

    pSrcA1 = 1;
    pSrcB1 = 1;
    arm_add_q31(&pSrcA1, &pSrcB1, &pDst1, 1);
    printf("arm_add_q31 = %d\r\n", pDst1);

    pSrcA2 = 2;
    pSrcB2 = 2;
    arm_add_q15(&pSrcA2, &pSrcB2, &pDst2, 1);
    printf("arm_add_q15 = %d\r\n", pDst2);

    pSrcA3 = 30;
    pSrcB3 = 120;
    arm_add_q7(&pSrcA3, &pSrcB3, &pDst3, 1);
    printf("arm_add_q7 = %d\r\n", pDst3);
    printf("***********************************\r\n");

The print results are as expected:

Later, the FFT calculation test can be carried out on this basis.

stm32h743_test.rar (35.43 MB, downloads: 1)

This post is from stm32/stm8

Latest reply

Then I look forward to the subsequent FT calculation test.   Details Published on 2023-9-29 18:14
 

6555

Posts

0

Resources
2
 

Then I look forward to the subsequent FT calculation test.

This post is from stm32/stm8
 
 

1237

Posts

66

Resources
3
 
Jacktang posted on 2023-9-29 18:14 Then I look forward to the subsequent FT calculation test

This post is from stm32/stm8
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list