Frame rate and data format from the X4M03

Discussion in 'X4M03' started by NicolasE, Oct 22, 2018.

  1. NicolasE

    NicolasE New Member

    Hello,

    First of all thanks for that very cool piece of kit. I want to use the X4M03 to build scanning radar. This means that I want to scan in different directions to build an image of the environment. As I have a lot of scanning points, I am trying to increase the FPS of the Xethru radar (then my total frame rate will be equal to Xethru FPS times number of directions). I believe I managed to get a theoretical FPS of the Xethru around 1200 (using examples from different posts here). Hozver when I check it it is quite lower on my computer. I am using Python and I think I found the limiting factor. It seems to be when I "transform" the data from the radar into a Python array.
    Starting from the simple_xep_plot, I used the time library as follows:
    Code:
    for i in range(10):
        start=time.time()
        d=r.read_message_data_float()
        step=time.time()
        frame=np.array(d.data)
        stop=time.time()
        print("import %s,create array %s"%(step-start,stop-step))
    And the result gives:
    Code:
    import 0.001997232437133789,create array 0.00799560546875
    import 0.0009739398956298828,create array 0.006995201110839844
    import 0.0,create array 0.006996631622314453
    import 0.0,create array 0.003996610641479492
    import 0.0,create array 0.0039708614349365234
    import 0.0,create array 0.004023551940917969

    Anyone had this issue? Do you know a way to convert the data faster or should I use C code instead (I saw the variable d is a swig object which seems to be linked to C code)?

    Thanks for your help

    Nico
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Nico,

    Sorry for the late replay.
    I agree with your test that proving limitation from the python script. You should try C code on a powerful computer,
    As a comparison, you may know that our existing X4M200/X4M300 only use 17FPS running on Cortex-M7 MCU. The DPS algorithm should use less than 1/FPS time to finish one processing. A high FPS will also decrease the integration time of one frame radar data, which result in lower SNR. You need to find a balance on FPS choosing. The X4 user guide might be a good reference.
    https://www.xethru.com/community/resources/xethru-x4-radar-user-guide.149/
     
  3. NicolasE

    NicolasE New Member

    Hello Charlie,

    Thanks for your reply.
    I will have a go at C code then or even Matlab (as my problem seems to be with array manipulation rather than the radar FPS itself). I am also wondering if there is another function to get data rather than read_message_data_float(). Maybe if I could get binary data instead, it would be faster to play with.
    Regarding the FPS I am already playing with the parameters (the user guide has been very helpful!) and it should not be my limiting factor for now, it is really the array transformation.

    Regards

    Nico