Part Number:AWR2243
尊敬的工程师们:
现在我只连接了master一个设备如下两张图所示
现分别设置一发一收、一发四收、两发四收进行数据的采集,请问如何用TI官方给的算法读取出雷达块呢?具体请给出调用示例,不胜感激。
PS:收集到的数据路径为:‘E:\company\data\2022_1_17_cascade\1T1R_5120F_2C_1ms\master_0000_data.bin’,官方给定的代码如下所示:
%% read raw adc data with MIMO function [radar_data_Rxchain] = read_ADC_bin_TDA2_separateFiles(fileNameCascade,frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices)dataFolder =fileNameCascade.dataFolderName;fileFullPath_master = fullfile(dataFolder,fileNameCascade.master);fileFullPath_slave1 = fullfile(dataFolder,fileNameCascade.slave1);fileFullPath_slave2 = fullfile(dataFolder,fileNameCascade.slave2);fileFullPath_slave3 = fullfile(dataFolder,fileNameCascade.slave3);[radar_data_Rxchain_master] = readBinFile(fileFullPath_master, frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices); [radar_data_Rxchain_slave1] = readBinFile(fileFullPath_slave1, frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices); [radar_data_Rxchain_slave2] = readBinFile(fileFullPath_slave2, frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices); [radar_data_Rxchain_slave3] = readBinFile(fileFullPath_slave3, frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices); % Arranged based on Master RxChannels, Slave1 RxChannels, slave2 RxChannels, slave3 RxChannels % The RX channels are re-ordered according to "TI_Cascade_RX_ID" defined in % "module_params.m" radar_data_Rxchain(:,:,1:4,:) = radar_data_Rxchain_master; radar_data_Rxchain(:,:,5:8,:) = radar_data_Rxchain_slave1; radar_data_Rxchain(:,:,9:12,:) = radar_data_Rxchain_slave2; radar_data_Rxchain(:,:,13:16,:) = radar_data_Rxchain_slave3; end function [adcData1Complex] = readBinFile(fileFullPath, frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices) Expected_Num_SamplesPerFrame = numSamplePerChirp*numChirpPerLoop*numLoops*numRXPerDevice*2; fp = fopen(fileFullPath, 'r'); fseek(fp,(frameIdx-1)*Expected_Num_SamplesPerFrame*2, 'bof'); adcData1 = fread(fp,Expected_Num_SamplesPerFrame,'uint16'); neg= logical(bitget(adcData1, 16)); adcData1(neg)= adcData1(neg) - 2^16; %% adcData1 = adcData1(1:2:end) + sqrt(-1)*adcData1(2:2:end); adcData1Complex = reshape(adcData1, numRXPerDevice, numSamplePerChirp, numChirpPerLoop, numLoops); adcData1Complex = permute(adcData1Complex, [2 4 1 3]); fclose(fp); end
罗
Yihong Luo:
目前针对单芯片模式,我将代码中有关master部分单独拿出来,但依旧无法正确读取出来。
除了上述问题,在多芯片模式下又是如何直接调用官方代码呢?
,
Chris Meng:
你好,
其中的采样点数,chirp循环个数等值都正确配置了么?
Mimo demo 的配置和代码是对应的,建设参考。
,
Yihong Luo:
您好,
谢谢您的回复!
当时雷达参数配置为:主芯片一发一收,5120Frames,每一个Frame设置2个chirp,每一个chirp的采样点数位256,因此我调用函数的格式为:
radar_data_Rxchain_master = readBinFile( ‘E:\company\data\2022_1_17_cascade\1T1R_5120F_2C_1ms\master_0000_data.bin’, 0, 256, 2, 5120, 1, 1);
PS:只调用一次readBinFile.m函数读取主芯片数据。
当运行到第37行代码(adcData1 = adcData1(1:2:end) + sqrt(-1)*adcData1(2:2:end);)后进行验证,结果如下图所示:
这显然是不正确的。
请问应当如何正确调用函数呢?
感谢百忙之中能给予回复。
罗
,
Chris Meng:
Yihong Luo 说: readBinFile( ‘E:\company\data\2022_1_17_cascade\1T1R_5120F_2C_1ms\master_0000_data.bin’, 0, 256, 2, 5120, 1, 1);
第二个参数是frameIdx,你设置为0,但下面的代码里有frameIdx-1的操作,这里有问题吧。代码都有源码,建议你单步仔细调试和阅读一下。
function [adcData1Complex] = readBinFile(fileFullPath, frameIdx,numSamplePerChirp,numChirpPerLoop,numLoops, numRXPerDevice, numDevices)Expected_Num_SamplesPerFrame = numSamplePerChirp*numChirpPerLoop*numLoops*numRXPerDevice*2;fp = fopen(fileFullPath, 'r');fseek(fp,(frameIdx-1)*Expected_Num_SamplesPerFrame*2, 'bof');adcData1 = fread(fp,Expected_Num_SamplesPerFrame,'uint16');neg = logical(bitget(adcData1, 16));adcData1(neg) = adcData1(neg) – 2^16;%% adcData1 = adcData1(1:2:end) + sqrt(-1)*adcData1(2:2:end);adcData1Complex = reshape(adcData1, numRXPerDevice, numSamplePerChirp, numChirpPerLoop, numLoops);adcData1Complex = permute(adcData1Complex, [2 4 1 3]);fclose(fp);end
,
Yihong Luo:
您好,
感谢您的回复!
关于frameIdx,此参数设置对读取.bin文件没有影响。
本人调用的就是TI的源码!但是在多次调整参数一步一步debug后读出来的数据长度无法与实际匹配,因此一直存在困惑。
关于本人上一回帖的问题,目前认为是丢帧导致的。还请您多指教!
罗
,
Chris Meng:
你好,
在mmwave_studio_cascade_user_guide.pdf里有下面的known issue:
,
Yihong Luo:
感谢您的回复