This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR1443BOOST: adc_data.bin数据读取缺失

Part Number: IWR1443BOOST
Other Parts Discussed in Thread: DCA1000EVM

你好,我使用IWR1443BOOST+DCA1000EVM+mmwave studio捕获原始ADC数据,采样点数为每个chirp采集256个点。采样形式为复数形式。得到如下图表所示:

得到16个大小为1048576KB的.bin文件和一个大小为517765KB的.bin文件。

按照文件存储格式计算,每个样本存储大小为16bit,我这里设置的采集的样本为复数,1048576KB应该是解析得到每个通道存储有1018576*8192(1KB=8192bit)/2(实部虚部)/4(四个通道)/16(每个样本为16bit)=67108864个复数,517765KB应该是每个通道存储有517765*8192bit/2/4/16=3313960)个复数。

可是我使用matlab读取大小1048576KB的.bin时只得到每个通道47108860个复数,而517765KB大小的这个.bin文件解析得到的数却是对的?这是为什么?

  • 可是我使用matlab读取大小1048576KB的.bin时只得到每个通道47108860个复数

    建议你debug一下你的matlab代码,看看为什么数据会少。

  • 我的代码是TI文档“Mmwave Radar Device ADC Raw Data Capture"中的源码

    %%% This script is used to read the binary file produced by the DCA1000
    %%% and Mmwave Studio
    %%% Command to run in Matlab GUI - readDCA1000('<ADC capture bin file>')
    function [retVal] = readDCA1000(fileName)
    %% global variables
    % change based on sensor config
    numADCBits = 16; % number of ADC bits per sample
    numLanes = 4; % do not change. number of lanes is always 4 even if only 1 lane is used. unused lanes
    isReal = 0; % set to 1 if real only data, 0 if complex dataare populated with 0 %% read file and convert to signed number

    % read .bin file
    fid = fopen(fileName,'r');
    % DCA1000 should read in two's complement data
    adcData = fread(fid, 'int16');
    % if 12 or 14 bits ADC per sample compensate for sign extensionnumLanes
    if numADCBits ~= 16
    l_max = 2^(numADCBits-1)-1;
    adcData(adcData > l_max) = adcData(adcData > l_max) - 2^numADCBits;
    end
    fclose(fid);

    %% organize data by LVDS lane
    % for real only data
    if isReal
    % reshape data based on one samples per LVDS lane
    adcData = reshape(adcData, numLanes, []);
    %for complex data
    else
    % reshape and combine real and imaginary parts of complex number
    adcData = reshape(adcData, numLanes*2, []);
    adcData = adcData([1,2,3,4],:) + sqrt(-1)*adcData([5,6,7,8],:);
    end
    %% return receiver data
    retVal = adcData;

    应该不会出错呀?

    而且只有在解析满了1G的.bin文件的时候才出错,少于1G的.bin文件解析又是没问题的?

  • 你好,

    你的截图里不是47108860?这个adc_data_1在代码里没有出现?

  • 哦这个数字是前面打错了,6打错为4了。这个adc_data_1是我把变量另存为的名字。

  • 然后我就干脆不对.bin中的数据进行reshape和排序了,使用的fid = fopen(‘文件路径’,’rb’)直接打开查看.bin数据。

    按照IWR1443BOOST的数据存储格式,如下图

    它的存储格式是lane1的sample1的实数、lane2的sample1的实数、lane3的sample1的实数、lane4的sample1的实数、lane1的sample1的虚数、lane2的sample1的虚数、lane3的sample1的虚数、lane4的sample1的虚数、lane1的sample2的实数、lane2的sample22的实数、lane3的sample2的实数、lane4的sample2的实数、lane1的sample2的虚数、lane2的sample2的虚数、lane3的sample2的虚数、lane4的sample2的虚数.。。。

    按照这个顺序依次存储。

    也就是说在采样时,一个采样点,四个通道、实部虚部总共存储有8个数。

    每个数大小为6bit,1G=1048576KB的.bin文件应该有1048576*8192bit/16=536870912个数。可是我现在打开.bin查看只有536870880个数,

    也就是说丢了32/8=4个采样点的数据?

    为什么呢?

  • 你好,

    你能否点击1G的bin文件,右键属性,看看具体到byte的字节数?

  • 谢谢,确实是这个地方的问题。