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.

Converting Radar Studio dump file (.bin) to .mat

Other Parts Discussed in Thread: AWR1443, AWR1642, IWR1443BOOST

Hi There,

Using the Radar studio software (v1.7.4.0) from TSW1400 High speed data capture card, MMWave-DevPack, and AWR1443 Evaluation module (radar), I have been able to dump the radar data to a .bin file. I need to process data in Matlab and need to convert the .bin file to the .mat file. Could you please let me know how I can convert the .bin file to a readable format (i.e. .mat or .csv).

Thanks,

Ed

  • Hello,

    For some TSW1400 actions, following the Radar Studio user guide, for Post Processing.  Once the captured file is collected.

    If you have properly written an output file, you can use the attached file, to read the file at a location.   If you putr in the configuration, you can parse and process the data.  (ie the Chirp configuration and setup has to match the Config section.

    Regards,

    Joe Quintal

    read_Post_process_ADC_Capture_data_LVDS.m

  • Yes, That works.

    Thanks a lot.

    Ed
  • In this code, "dat = reshape(dat,8,[]);
    dat = dat([1,3,5,7,2,4,6,8],:);
    cdat = dat(1:4,:) + 1i*dat(5:8,:);" means that the variable "n_rx" must be 4?

    The number in the adc_data.bin shoule be read by every 8 numbers for the reason that the n_rx is four?

  • Hello RJ,

    In the code below:

    dat = reshape(dat,8,[]);
    dat = dat([1,3,5,7,2,4,6,8],:);
    cdat = dat(1:4,:) + 1i*dat(5:8,:);
    cdat = cdat*norm_factor;
    cdat = reshape(cdat, n_adc_samples,n_rx, n_tx, n_chirps,1);%Samples_Per_Chirp*2 for I and Q

    The 1st row of cdat before 'reshape' is data from RX1, the 2nd row of cdat before 'reshape' is data from RX2, and so as 3rd and 4th row.

    After you do reshape for cdat, and you read it as cdat(:,1,1,1,1), the first 4 data will be each first data in rx1, rx2, rx3, and rx4. Then the data format will be wrong.

    I also have the question that how to set n_rx. Do I have set is as 4 even if I set only 1 Rx1 in RadarStudio?

    I want to confirm that is my understanding correct.

    Thanks,

    Zhaoyu

  • Hi Zhaoyu,

    The capture card 'TSW1400' is always configured with 4 LVDS lanes which is where the '8' in the script comes from.

    If you enable all four Rx, ADC data will come on all four LVDS lanes. This is the most common use-case and what the matlab script was designed for. If you enable 1 Rx, but leave 4 LVDS lanes on. ADC Data will be redistributed to all 4 LVDS Lanes.We do not have the scripts for that case.

    If you wish to enable only 1 Rx channel and still use the attached script. I would suggest that you enable only 1 LVDS lane - (for e.g if you are using channel 4, enable LVDS lane 4). ADC data will be pumped through that lane alone. The TSW1400 will show zeros on the other lanes, and valid ADC data on the active lane.

    Regards,
    Anil

  • Hello

    Thank you for your matlab script provided. But I have a question about the script.
    According to 'mmWave_sensor_raw_data_capture_using_TSW1400_board_v3.pdf', before reshape processing, each row of cdat is the data of a rx channel, but after cdat = reshape(cdat, n_adc_samples,n_rx, n_tx, n_chirps,1), this will confused, is that correct?
  • Hi ShahEd Shahir
    I am a beginner of radar. How do I convert radar data into bin files? I'm using AWR1642.
    Thanks
  • The data that is sent to Matlab by the TSW1400, configures matlab parameters. I have only tested 4 Rx.
    This is part of the Static Config tab in Radar Studio, the data path config, and the chirp under Sensor Config.
    I have only tested 4Rx.
  • Hello,
    The TSW1400, with HSDpro software, will capture xWR1443 or xwr1642 data from the Devpack, and BOOST EVM. The Radar Studio, dfp, which can be downloaded from TI .com will create a captured .bin file. There is online training on using the EVM, Devpack, and TSW1400 with Radar Studio under 'mmwave training'.

    The software that runs the TSW1400, captures the LVDS data from the radar sensor xWR1443 or xWR1642.

    Using the OOB data capture demo software, you could reconstruct dfe iq output data.

    Regards,
    Joe Quintal
  • Hello RJ,

    I am aware of the setting of 4 RX.

    As I mentioned in my previous reply, I consider that the use of 'reshape' is wrong.

    In the code below:

    dat = reshape(dat,8,[]); 
    dat = dat([1,3,5,7,2,4,6,8],:);
    cdat = dat(1:4,:) + 1i*dat(5:8,:);
    cdat = cdat*norm_factor;
    cdat = reshape(cdat, n_adc_samples,n_rx, n_tx, n_chirps,1);%Samples_Per_Chirp*2 for I and Q

    The 1st row of cdat before 'reshape' is data from RX1, the 2nd row of cdat before 'reshape' is data from RX2, and so as 3rd and 4th row.

    After you do reshape for cdat, and you read it as cdat(:,1,1,1,1), the first 4 data will be each first data in rx1, rx2, rx3, and rx4. Then the data format will be wrong.

    Could you please check the use of 'reshape'?

    Thanks.

    Zhaoyu

  • Hello,
    I have forwarded your comments to the script developer. The only suggestion I have, is to use a kapton tape covered aluminum strip to cover a receiver, and check your matlab output file. As you block the receiver, you should have a lower power level for that Receiver channel. You can then modify your script to work for your setup.

    Regards,
    Joe Quintal
  • Thank you, RJ.

    If you have any information from script developer, please tell me.

    BR,

    Zhaoyu

  • Hello,

    I also think that something is not perfectly correct in the given Matlab script. I am using a similar setup for IWR1443boost and I have acquired already quite a few raw datasets for various settings and acquisition modes (Complex1, Complex2, Real). I can read the data in Matlab using your script after a slight modification, and the imported data corresponds to the given number of samples, chirps, frames, Tx and Rx. The timing looks also correct. But when I compare the same data visualized in Radar Studio and independently in Matlab, I always see a big difference between time-domain waveforms and range profiles respectively. In the frequency/range domain I observe strange spurs even in the "mirror" spectrum between the Nyquist frequency and the sampling frequency, which indicates something is incorrect physically. In my processing I simply read the data and apply FFT with a Hanning window, same as in Radar Studio by default. To illustrate this I am attaching two Figures for the same dump file acquired for 1 Tx / 4 Rx in Complex1 mode, 30 dB backoff Tx power, 24 dB receiver gain, 10 frames of 64 chirps each, 256 sampes per chirp at 5 MHz rate. The same one chirp is visualized in time and range domains. I set norm_factor = 1 in your script to have the same amplitude level in the time domain as in Radar Studio. Perhaps indeed the problem hides in using "reshape" function. Thanks a lot in advance for your explanation.

    Best regards,

    Timofey

  • The developer does not have a corrected matlab script. The suggestion is to test with the EVM, and adapt the script to your needs.
    Some customers have modified this script after disabling specific Rx and seeing the radar adc buffer data in the appropriate frequency bin and receiver.
    Regards,
    Joe Quintal
  •  Hello Joe,

    let me give a hint to the developer. The data becomes correct in MATLAB when you assign the acquired signal samples to the receivers firstly, then to the chirps, then to the frames, and then to the transmitters in case of MIMO. This means Rx1-I-Nsample / Rx1-Q-Nsample / Rx2-I-Nsample / Rx2-Q-Nsample / Rx3-I-Nsample / Rx3-Q-Nsample / Rx4-I-Nsample / Rx4-Q-Nsample... The use of loops instead of "reshape" helps too. The attached Figure shows the same waveforms as in Radar Studio, see Figures above for comparison. My range profile is normalized in a different way but the spectral shape is the same.

    Regards,

    Timofey

  • I have checked with the developer, there are no corrections to the script yet.
    Please debug by covering a received with cardboard wrapped tin foli, and determining the channel that is being attenuated.
    Regards,
    Joe Quintal