51uwb.cn

 找回密码
 立即注册
12
返回列表 发新帖
楼主: ABC
打印 上一主题 下一主题

BP400如何获取CIR

[复制链接]

35

主题

1003

帖子

4228

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4228
沙发
发表于 2023-5-13 08:56:37 | 只看该作者
代码参考如下:主要定义声明:

  1. static dwt_rxdiag_t rx_diag;
  2. #define ACCUM_DATA_LEN 50
  3. static uint8 accum_data[ACCUM_DATA_LEN];
  4. int max(int a, int b)
  5. {
  6.         if(a>b)
  7.                 return a;
  8.         else
  9.                 return b;
  10. }

  11. int min(int a, int b)
  12. {
  13.         if(a < b)
  14.                 return a;
  15.         else
  16.                 return b;
  17. }

  18. void dwNLOS_ExtractAndPrintCIR()
  19. {
  20.         uint8 cir[5]={0};
  21.         for(int i = 0;i<1016;i++)
  22.         {
  23.                 dwt_readaccdata(cir, 5, 4*i);
  24.                 int16 real =0;
  25.                 int16 imag =0;
  26.                 double amp=0;
  27.                 real =  (int16)cir[2] << 8 | (int16)cir[1];/*printf("%i,",real);*/
  28.                 imag =  (int16)cir[4] << 8 | (int16)cir[3]; /*printf("%u\n",imag);*/
  29.                 printf("index:%d,real:%i,imag:%i\r\n",i, real,imag);
  30.         }
  31. }
复制代码
在UWB接收完信号执行如下代码

  1.         /* Read diagnostics data. */
  2.                                                                 dwt_readdiagnostics(&rx_diag);
  3.                                                                  /* Read accumulator */
  4.                                                                 dwNLOS_ExtractAndPrintCIR();
  5.                                                                 printf("Count of preamble symbols accumulated: %d \r\n",rx_diag.rxPreamCount);
  6.                                                                 printf("Index of first path is %d \r\n", rx_diag.firstPath / 64);
  7.                                                                 printf("CIR max growth CIR: % d \r\n",rx_diag.maxGrowthCIR);
  8.                                                                 printf("LDE max value of noise: %d \r\n", rx_diag.maxNoise);
  9.                                                                 printf("Std of noise is %d \r\n",rx_diag.stdNoise);
  10.                                                                 printf("First Path AMP2: %d \r\n",rx_diag.firstPathAmp2);
  11.                                                                 printf("First Path AMP3: %d \r\n",rx_diag.firstPathAmp3);
  12.                                                                 printf("First Path AMP1: %d \r\n",rx_diag.firstPathAmp1);
复制代码


回复

使用道具 举报

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

本版积分规则

bphero Inc.  

GMT+8, 2024-6-29 19:56 , Processed in 0.009859 second(s), 3 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

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