Rader 24GHz:调整采样率到16k

2019-07-14
线插在板子上方

received_frame_data函数调用频率

每隔46-47mm被调用一次,即0.047s被调用一次
该函数的调用频率为21.2765Hz左右
而里面有250个sample,不知道是啥意思

void received_frame_data(void* context,
                        int32_t protocol_handle,
                        uint8_t endpoint,
                        const Frame_Info_t* frame_info)
{

        nowTime = GetTickCount();
        timeElapsed = nowTime - lastTime;
        printf("%d\n", timeElapsed);
        lastTime = nowTime;
}

GUI

每个Frame:
1 chirp
250 samples
最小时长 45.608 ms
这与刚才的统计是一致的


image.png

Frame_Info

sample_data //获取到的数据的buffer
frame_number = 104 //不知道为啥一直是104
num_chirps = 1 //这一frame里有多少chirp
num_rx_antennas = 1 //每个chirp获取到 1个 RX 信号(一个天线)
num_samples_per_chirp = 250 //一个chirp里250个sample
rx_mask =1 //标记哪个antenna 被用来获取数据
adc_resolution = 12 //The ADC resolution(分辨率) of the data in sample_data
interleaved_rx =0 //不同天线的数据存在连续存储单元内,每个block存一个天线的数据
data_format = 1 // I和Q数据存在分开的block中

typedef struct
{
    const float*     sample_data;            /**< The buffer containing the
                                                  radar data */
    uint32_t         frame_number;           /**< The running number of the
                                                  data frame. The frame
                                                  counter is, reset every time
                                                  \ref ep_radar_base_set_automatic_frame_trigger
                                                  is called. If automatic
                                                  frame trigger is not active,
                                                  the frame counter may not
                                                  work, and this could be 0.
                                                  */
    uint32_t         num_chirps;             /**< The number of chirps in this
                                                 frame. */
    uint8_t          num_rx_antennas;        /**< The number of RX signals
                                                  that have been acquired with
                                                  each chirp. */
    uint32_t         num_samples_per_chirp;  /**< The number of samples
                                                  acquired in each chirp for
                                                  each enabled RX antenna. */
    uint8_t          rx_mask;                /**< Each antenna is reperesnted
                                                  by a bit in this mask. If
                                                  the bit is set, the
                                                  according RX antenna was
                                                  used to capture data in this
                                                  frame. */
    uint8_t          adc_resolution;         /**< The ADC resolution of the
                                                  data in sample_data. */
    uint8_t          interleaved_rx;         /**< If this is 0, the radar data
                                                  of multiple RX antennas is
                                                  stored in consecutive data
                                                  blocks, where each block
                                                  holds data of one antenna.
                                                  If this is non-zero, the
                                                  radar data of multiple RX
                                                  antennas is stored in one
                                                  data block, where for each
                                                  point in time the samples
                                                  from all RX antennas are
                                                  stored consecutively before
                                                  the data of the next point
                                                  in time follows. */
    Rx_Data_Format_t data_format;            /**< This indicates if the data
                                                  is pDataBuffer is real or
                                                  complex, and if complex data
                                                  is interleaved. */
} Frame_Info_t;
image.png
image.png

data format = 1,说明 I和Q存在分开的数据单元内

解决办法:
文档:ComLib_C_Interface.pdf

image.png
image.png

frame_start = &sample_data[
CHIRP_NUMBER * //?
num_rx_antennas * //1
num_samples_per_chirp */250
((data_format == RADAR_RX_DATA_REAL)? 1 : 2)]; //2

师姐,现在确认了:

  1. 每一个Frame中有一个chirp
  2. 每个chirp中有250个sample(I信号和Q信号各250个)
  3. 每个Frame对应时间为46-47ms,故每秒约21个frame (GUI中称min frame 45.608ms ,46-47ms是上位机实测的结果,很接近,故应该没问题)
  4. 每个chirp时间为1500us(GUI和上位机代码中均有提及)

此时,GUI输出文件中却说采样率为166666,我想是不是这两个采样率定义不同呢?

166666可能指的是模数转换的采样率,即模拟信号每秒采样166666次,然后转换为数字信号
转换结果是一个一个的frame,每个frame的时间约为46ms

而我们一直尝试计算的是已经获得的数字信号(I信号和Q信号)每秒有多少组,这样的话板子默认配置是21左右
理论上“每秒获得的数字信号组数”,即使修改下位机代码,也不太可能直接从21上升到几千;而当前的21,作为这块板子的默认配置,应该也是很OK的
且如果用距离反映呼吸信号的话,每秒21个距离数据应该也足够了
所以师姐要求的上千的采样率的定义是什么呢?是用于算法建模的数据每秒要有上千个,还是硬件获取原始模拟数据时的采样率呢?

如果现在的频率OK的话,我们可以约定一个输出格式,我按照这个格式把结果输出到本地,师姐就可以直接用了

你可能感兴趣的:(Rader 24GHz:调整采样率到16k)