TI中文支持网
TI专业的中文技术问题搜集分享网站

AWR2243: How to use MATLAB to read raw data collected by radar

Part Number:AWR2243

Dear Engineers
          I can’t use read_ADC_bin_TDA2_separateFiles.m (path: ’C:\Users\Administrator\Desktop\work\data\adc_data’) to read the radar collection data, please give your suggestions.
          code shows as below

%  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
%
%
%Redistribution and use in source and binary forms, with or without
%modification, are permitted provided that the following conditions
%are met:
%
%Redistributions of source code must retain the above copyright
%notice, this list of conditions and the following disclaimer.
%
%Redistributions in binary form must reproduce the above copyright
%notice, this list of conditions and the following disclaimer in the
%documentation and/or other materials provided with the
%distribution.
%
%Neither the name of Texas Instruments Incorporated nor the names of
%its contributors may be used to endorse or promote products derived
%from this software without specific prior written permission.
%
%THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
%"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
%LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
%A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
%OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
%SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
%LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
%DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
%THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
%(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
%OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%

%% 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;%fileNameCascade.dataFolderNamefileFullPath_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

          Each parameter setting is shown in the figure below

           

          The raw data collected by radar  storage location is

 

          When I use this function as :Rxchain = read_ADC_bin_TDA2_separateFiles('C:\Users\Administrator\Desktop\work\data\adc_data',1,256,128,8, 4, 4),the System error is:   

            Where is my problems or How to deal with this question?
            Thanks again for your kind help!
                                                                                                          Luo

Shine:

请检查一下单引号,逗号是不是英文的?路径用反斜杠试试。

,

Yihong Luo:

单引号和逗号都是英文格式的,路径改成反斜杠后也是同样的错误。

,

Chris Meng:

你好,

在mmwave studio 3.0.0.14里,有MIMO 的Matlab例程,包括配置,采集,数据处理,建设你参考一下。

赞(0)
未经允许不得转载:TI中文支持网 » AWR2243: How to use MATLAB to read raw data collected by radar
分享到: 更多 (0)