Advertisement
Guest User

CMSIS DSP

a guest
Sep 16th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. void calc_cos(float32_t* src, float32_t per, uint32_t pt){
  2.     float32_t pi32 = PI / per;
  3.     for(uint32_t volatile i=0; i<pt; i++){
  4.         src[i] = 10000.0 * arm_cos_f32( i / pi32 );
  5.     };
  6. };
  7.  
  8.  
  9. void calc_dfft(float32_t* src, uint32_t pt){
  10.     arm_status status = arm_cfft_init_f32(&a, pt);
  11.     arm_cfft_f32(&a, srcv, 0, 1);
  12.     arm_cmplx_mag_f32(srcv, dstv, 128);
  13. };
  14.  
  15. calc_cos(srcv, 1.0, 256);
  16. calc_dfft(srcv, 256);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement