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: Strange values and plot from range doppler information

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: AWR1642,

Hi,

I am currently working on extracting the range doppler heatmap data from the awr1642 sensor through UART and wanted to plot the data to ensure the data that I received and processed made sense. When I plot the data, I get the plot below that doesn't make much sense to me (not the same as in the provided demo GUI from matlab). The plot is generated while I am seated behind a desk next to the radar.

(X-axis: Range Bins, Y:Axis: Doppler bins, Data plotted: range doppler data sent from radar)

After examining the raw data sent from the radar through Realterm, I noticed that the values of the heatmap were very high (> 10000), seen on the plot as well. Is this expected or am I missing a step while parsing the data?

I used the following matlab code from the ods_3d_visualizer.m demo lab (under C:\ti\mmwave_automotive_toolbox_3_1_0\labs\lab0004_obstacle_detection\gui) to generate an equivalent version in python:

len = numDopplerBins * numRangeBins * 2;
rangeDoppler = bytevec(idx+(1:len));
idx = idx + len;
rangeDoppler = rangeDoppler(1:2:end) + rangeDoppler(2:2:end)*256;
rangeDoppler = reshape(rangeDoppler, numDopplerBins, numRangeBins);
rangeDoppler = fftshift(rangeDoppler,1);

Code in Python:

numBytes = int(2*configParameters["numRangeBins"]*configParameters["numDopplerBins"])

# Convert the raw data to int16 array
payload = byteBuffer[idX:idX + numBytes]
idX += numBytes
# rangeDoppler = payload.view(dtype=np.uint16)
rangeDoppler = (payload[0:payload.size:2] + payload[1:payload.size:2] * 256)

# Convert the range doppler array to a matrix
rangeDoppler = np.reshape(rangeDoppler, (int(configParameters["numDopplerBins"]), int(configParameters["numRangeBins"])),'F') #Fortran-like reshape
rangeDoppler = np.append(rangeDoppler[int(len(rangeDoppler)/2):], rangeDoppler[:int(len(rangeDoppler)/2)], axis=0) # equivalent to fftshift operation in MATLAB

# Generate the range and doppler arrays for the plot
rangeArray = np.array(range(configParameters["numRangeBins"]))*configParameters["rangeIdxToMeters"]
dopplerArray = np.multiply(np.arange(-configParameters["numDopplerBins"]/2 , configParameters["numDopplerBins"]/2), configParameters["dopplerResolutionMps"])

plt.clf()
cs = plt.contourf(rangeArray,dopplerArray,rangeDoppler)
fig.colorbar(cs, shrink=0.9)
fig.canvas.draw()
plt.pause(0.1)

Attached are two files containing the configuration sent to the radar and the other file containing sample data from the radar, extracted by RealTerm in Hex format. If you could help me in figuring out why my range doppler data is off, that would be greatly appreciated.

Configuration file:

1642RangeDoppler.cfg

Sample data:

capture1.txt

Thank you,

Stan

  • In case the image of the plot above is not viewable, I have attached it below:

  • Hello Stan,

    Looks like you are trying to convert Matlab script to Python script. 

    As default application with given GUI, it works fine. So for that conversion you are on your own for find the equivalent mapping of  processing  scripts.

    Regards,

    Jitendra

  • Hi Jitendra, 

    Apologies for the late reply, in the meantime I was looking across different automotive labs for matlab scripts that could plot the range-azimuth heatmaps and trying different things but I was unsuccessful. Would you be able to indicate which lab (and version) or demo would be the best for me to look at it and port the plotting part of the code (i.e. from MATLAB) to python myself? I am working with the awr1642BOOST on SDK 2.0004.

    Note that I also found source code from TI in javascript that plots the heatmaps but I am unfamiliar with javascript.

    Thank you,

    Stan

  • Hello Stan,

    We don't have any python based processing script in TI-Rex or mmWave SDK. But you can find reference Matlab script in mmWave Studio and work on your own to convert that to Python. On internet you can find many literature or code for Radar Signal processing using Python.

    Regards,

    Jitendra

  • Hi Jitendra,

    MATLAB code is acceptable, I plan on doing the conversion myself. My question however is which demo/lab provided by TI should I look into for my own device and SDK version that currently plots range azimuth heatmaps and range doppler heatmaps?

    Thank you,

    Stan

  • Hello Stan,

    mmw demo from mmWave SDK plots azimuth and range/doppler heatmap, please refer those for your development.

    Regards,

    Jitendra