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.

AWR1642BOOST: AWR1642boost with MATLAB script

Part Number: AWR1642BOOST

Hello Team, 

I got an error of "Not enough input arguments.

Error in rawDataReader (line 163)
if(debugPlot)"

and my Matlab script of "C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\MatlabExamples\singlechip_raw_data_reader_example" is:

"

% Start example UI and update time domain/range Profile plots

if(debugPlot)
% Start up processing display page
ui.figHandle = initDisplayPage(setupJSON.mmWaveDevice);
% load and Plot the first frame
dp_updateFrameData(1);
ui_updateFramePlot();
% Wait for UI interactions
while (~EXIT_KEY_PRESSED)
pause(0.01);
end
close(ui.figHandle);
end
%close and delete handles before exiting
for idx = 1: numBinFiles
fclose(Params.fid_rawData(idx));
end
close all;
end".
Please help me how to remove this error. 

My second question is this the result of raw data by name of "rawDataFilename.mat" but I got 1x2047 mat files and how I can identify which is my raw data or all the files are the raw data and I can combine them in 1 file. I'm bit confused about it.

My third question: from the output of mmwave studio I got 6 bin files. Then I used the matlab script as mentioned above. so the results means that mat files are the combination of 6 files of just 1 file as mentioned in 

16xxsetup.json file as attached with this thread.

all files are attached please have al look.

Thank you.

Kind Regards,

Fahad Ayaz

  • Hi,

    I apologize for the delay.

    Is the purpose to capture raw data?

    I remember in a different thread we provided you with a LUA script to use with mmWave Studio to capture raw data.


    Are you at this point able to capture raw data?

    Thank you

    Cesar

  • Hi Cesar,

    No worries at all. Thank you for your response.

    > Actually I'm able to get raw radar data through mmWave studio. Also post processed data as well.

    >  I have two questions related to this.

    1) When I used the script as provided path below and run the matlab script and provide the bin file and conf file(setup.json and mmwave.json)  it gives me 2 mat files (a) rawDatafilename.mat and (b) rawDatacube.mat. Also with an error of as mentioned above (If Debug File Error). So first question is how I can remove the error?, to get the plots.

    and my Matlab script of "C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\MatlabExamples\singlechip_raw_data_reader_example" is:

    2) As attached above figures: These are the figures from mat files which I discussed in Q1. So my second question is as you see in mat files I have diferent results some are: rfParams, Data and dim.

    I know about the two but the third one which is Data when I open it, it gives me several variables as shown above ( adcVariablesdata.data) so my question is I'm confused about these several files which belongs to which category and how I can manage it by combining all these files together or what else I can do?

    I hope you understand now. 

    Kind regards,

    Fahad

  • Hi,

    The readme file shows an example how to call this matlab script. Are you providing all arguments?

    C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\MatlabExamples\singlechip_raw_data_reader_example\readme.txt

    Based on the matlab script, one can see the content of the rawdata. As you can see the data is the rawADCData that was read from the bin file.

    thank you

    Cesar

            adcRawData.rfParams = Params.RFParams;
            adcRawData.data = rawADCData;
            adcRawData.dim.numFrames = Params.NFrame;
            adcRawData.dim.numChirpsPerFrame = Params.adcDataParams.numChirpsPerFrame;
            adcRawData.dim.numRxChan = Params.NChan;
            adcRawData.dim.numSamples = Params.NSample;

  • Hi cesar,

    I think you didn't understand my questions properly.

    > I don't know which argument I should provide to remove the error???

    > I know that is the RawAdcdata. But you can see in figure I have different variables under Rawadcdata.mat file. Which one is my Rawdata all of these 262144x1 all these files are my data or I can emerge them?

    Thank you

  • Hi,

    Could you please send me your files so I can try them?

    1) Json file

    2) Raw data bin file

    thank you

    Cesar

  • Files are so big enough so I'm unable to share is there any other way like email etc

    Thank you

    Fahad

  • Hi cesar,

    I'm still waiting for your reply on this can you please help me about this.

    Kind regards,

    Fahad

  • Hi,

    Let me check with the systems team

    thank you

    Cesar

  • Hi,

    I have uploaded the zip file please have a look do let me know then. This include Json files.

    1.zip.rar

    Thank you 

    Fahad

  • Hi,

    I have found this appnote that should be helpful as well

    https://www.ti.com/lit/an/swra581b/swra581b.pdf

    Thank you

    Cesar

  • Hi

    In this AppNote you will find a matlab script that will help you parse the raw date (Section 9.2)

    Let us know if you have any questions

    thank you

    Cesar

  • Hi,

    I used that script for AWR1642BOOST but again got some errors.

    Error using reshape
    Size arguments must be real integers.

    Error in readDCA1000 (line 29)
    LVDS = reshape(adcData, numADCSamples*numRX, numChirps);

    I tried a lot but never resolve the issue.

    Kind regards,

    Fahad

  • Hi,

    What are the arguments you pass to the script?

    Thank you

    Cesar

  • Hi Cesar,

    Please find the below script and error. 

    %%% 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(~)
    %% global variables
    % change based on sensor config
    numADCSamples = 256; % number of ADC samples per chirp
    numADCBits = 16; % number of ADC bits per sample
    numRX = 4; % number of receivers
    numLanes = 2; % do not change. number of lanes is always 2
    isReal = 1; % set to 1 if real only data, 0 if complex data0
    %% read file
    % read .bin file
    fid = fopen('datacard_record_Raw_0.bin','r');
    adcData = fread(fid, 'int16');
    % if 12 or 14 bits ADC per sample compensate for sign extension
    if numADCBits ~= 16
    l_max = 2^(numADCBits-1)-1;
    adcData(adcData > l_max) = adcData(adcData > l_max) - 2^numADCBits;
    end
    fclose(fid);
    fileSize = size(adcData, 1);
    % real data reshape, filesize = numADCSamples*numChirps
    if isReal
    numChirps = fileSize/numADCSamples/numRX;
    filesize = numADCSamples*numChirps;
    LVDS = zeros(1, fileSize);
    %create column for each chirp
    LVDS = reshape(adcData, numADCSamples*numRX, numChirps);
    %each row is data from one chirp
    LVDS = LVDS.';
    else
    % for complex data
    %filesize = 2 * numADCSamples*numChirps
    numChirps = fileSize/2/numADCSamples/numRX;
    filesize = 2 * numADCSamples*numChirps;
    LVDS = zeros(1, fileSize/2);
    %combine real and imaginary part into complex data
    %read in file: 2I is followed by 2Q
    counter = 1;
    for i=1:4:fileSize-1
    LVDS(1,counter) = adcData(i) + sqrt(-1)*adcData(i+2);
    LVDS(1,counter+1) = adcData(i+1)+sqrt(-1)*adcData(i+3);
    counter = counter + 2;
    end
    % create column for each chirp
    LVDS = reshape(LVDS, numADCSamples*numRX, numChirps);
    %each row is data from one chirp
    LVDS = LVDS.';
    end
    %organize data per RX
    adcData = zeros(numRX,numChirps*numADCSamples);
    for row = 1:numRX
    for i = 1: numChirps
    adcData(row, (i-1)*numADCSamples+1:i*numADCSamples) = LVDS(i, (row-1)*numADCSamples+1:row*numADCSamples);
    end
    end
    retVal = adcData;

    And call the function like:

    >> readDCA1000('datacard_record_Raw_0.bin')

    and got the error.


    Error using reshape
    Size arguments must be real integers.

    Error in readDCA1000 (line 29)
    LVDS = reshape(adcData, numADCSamples*numRX, numChirps);

    Kind regards,

    Fahad

  • Hi

    Please make sure that the script is configured based on your chirp configuration.

    Right now the configuration is not correct. I think your configuration is complex data not real

    thank you

    Cesar

    % change based on sensor config
    numADCSamples = 256; % number of ADC samples per chirp
    numADCBits = 16; % number of ADC bits per sample
    numRX = 4; % number of receivers
    numLanes = 2; % do not change. number of lanes is always 2
    isReal = 1; % set to 1 if real only data, 0 if complex data0