PreSenseRadar / OpenRadar

An open source library for interacting with and processing radar data, specialized for MIMO mmWave radars
Apache License 2.0
604 stars 198 forks source link

Half of ADC data is missing #56

Open ekurtgl opened 1 year ago

ekurtgl commented 1 year ago

When I start framing with mmwave studio and this module, the recorded openradar .bin file is only half of the size of the mmwave file. 50% of ADC samples are missing. Is there a solution for this problem? The data do not look good with the missing samples. Thanks in advance!

felipeparralejo commented 1 year ago

Maybe you are not converting from binary to int16? If you read from the binary file obtained with mmWave Studio you can use NumPy: np.frombuffer(data, dtype=np.int16) where data is your frame

ekurtgl commented 1 year ago

I don't think that is the problem. The acquired data have half the size of that is recorded with mmWave Studio. The issue can easily be reproduced by making two recordings: one with mmWave Studio, one with OpenRadar module. OpenRadar recorded data will have half the size of that is recorded with mmWave Studio.

felipeparralejo commented 1 year ago

This seems weird because I usually make recordings with mmWave Studio and also with OpenRadar, and the data have exactly the same size. I save the frames in Python using Pickle, and the file size obtained is exactly equal to the file recorded with mmWave Studio. Try reinstalling your OpenRadar module.

With respect to my previous answer, I think that originally the OpenRadar module did not convert the binary data from uint16 to int16, which is necessary. Check your data type after recording a frame and use np.frombuffer(frame, dtype=np.int16) if needed.

Hope this helps

ekurtgl commented 1 year ago

I save the data in the same way: np.frombuffer(frame, dtype=np.int16), but into a .bin file. Are you using real or complex-valued stream? I use complex adc data format in my configuration. I am guessing this module might be optimized for real-valued streams. I will definitely try to implement your method. Thank you for the suggestion.

felipeparralejo commented 1 year ago

I use a complex 1x stream. I have just realized that some radar parameters are hard coded in the adc.py file from the OpenRadar module (Ctrl+Click on the DCA1000 module will lead to the file). Parameters like the number of ADC samples, Rx and Tx antennas and the number of chirp loops are written in the dictionary ADC_PARAMS. I changed those values to the ones I configured my device with. Try having a look at this.

You can see what I am talking about here https://github.com/PreSenseRadar/OpenRadar/blob/master/mmwave/dataloader/adc.py (line 45)

ekurtgl commented 1 year ago

I was using 2x complex stream and changed adc.py accordingly, but will have a look it again and try with 1x complex data as well. Thank you so much for your suggestion!