Breathing Pattern Extraction and From that Heart beat extraction

Discussion in 'XeThru Explorer' started by Aditya Ayachit, Dec 7, 2016.

  1. Aditya Ayachit

    Aditya Ayachit New Member

    Hi Xethru team,
    I am kind of novice in the field of Radio engineering and have set out on a very ambitious project for extracting the Heart Beat Rate. And from that we would like to finally extract emotions.
    So I want to have a PC utility which would connect to a Xethru respiration module and show the heart rate and from that then the emotions.
    So the first step that I know is to implement the HID interface.
    Now, What I want to know is what data can I expect at the output of this HID interface.
    And Could you help me in pointing to the resources for extracting the breathing Pattern data from this data?
    Looking forward to a positive response from your end.

    Thanks in advance.

    Kind Regards,
    Aditya Ayachit
  2. Olav Liseth

    Olav Liseth Administrator Staff Member

    Aditya Ayachit likes this.
  3. Aditya Ayachit

    Aditya Ayachit New Member

    Dear Olav,
    I appreciate your feedback greatly.
    In accordance of your suggestions I have downloaded the Python drivers and took the required trials.
    On running, I am getting the message "Reset module failed"

    Then I changed a setting to get the verbose response.
    This is what I got:
    Starting XeThru sensor...
    Transmitting: 0x7d 0x22 0x5f 0x7e
    Received: 0x7d 0x10 0x6d
    Reset module failed

    My analy
    sis is as below:

    0x7d: Start --> Correct!
    0x22: XTS_SPC_MOD_RESET --> Correct!
    0x5f: == 0x7D xor 0x22 --> Correct!
    0x7e: END --> Correct!

    Analysis of Recieve frame:
    0x7d: Start --> Correct!
    0x10: XTS_SPR_ACK --> Correct!
    0x6D: == 0x7D xor 0x10 --> Correct!
    0x7e: -------------------------------NOT RECEIVED!!!!!

    Also to note when this command is passed the sound of USB port disconnection is heard.
    Now is the device going for reset before 0.5 seconds as informed in Pg. 2 of the protocol document?

    Looking forward to a reply from your end.

    Kind Regards,
    Aditya Ayachit
  4. Olav Liseth

    Olav Liseth Administrator Staff Member

    Aditya Ayachit likes this.
  5. Aditya Ayachit

    Aditya Ayachit New Member

    HI Olav,
    Thanks for the information.
    I downloaded and tried out the code suggeted by you. It reports multiple errors. Which version of Python has been used for development?
    THanks in Advance.

    Kind Regards,
    Aditya Ayachit
  6. Aditya Ayachit

    Aditya Ayachit New Member

    And here is the error messages I am receiving.

    Starting XeThru sensor...
    Traceback (most recent call last):
    File "C:\Proff\Clients\Javier Bravo\JO-07-1617\Milestone2-HID Implementation\xethru-python-driver-X2M200\", line 6, in <module>
    sensor = xethru.Xethru("COM8", XTS_ID_APP_RESP, detection_zone_min = 0.5, detection_zone_max = 0.7, led_mode = XT_UI_LED_MODE_FULL)
    File "C:\Proff\Clients\Javier Bravo\JO-07-1617\Milestone2-HID Implementation\xethru-python-driver-X2M200\", line 77, in __init__
    if not self.__set_detection_zone(detection_zone_min, detection_zone_max):
    File "C:\Proff\Clients\Javier Bravo\JO-07-1617\Milestone2-HID Implementation\xethru-python-driver-X2M200\", line 366, in __set_detection_zone
    data = self.__append_float(data, min)
    File "C:\Proff\Clients\Javier Bravo\JO-07-1617\Milestone2-HID Implementation\xethru-python-driver-X2M200\", line 487, in __append_float
    TypeError: ord() expected string of length 1, but int found

    Kind Regards.
    Aditya Ayachit
  7. Hi :)

    The driver has been made for Python 2.7. There is a change to Python 3 where struct.pack will return a byte object instead of the expected string object from 2.7.
    I will update the driver to support Python 3 in the future as I don't think there are any big obstacles, but for your immediate needs you should try to use Python 2.7 instead.

    Aditya Ayachit likes this.
  8. Aditya Ayachit

    Aditya Ayachit New Member

    Dear Marius Lind,
    I greatly appreciate your prompt response. I will attempt the same exercise with the 2.7 version and get back to you if there are any further issues.
    Thanks again.
    To you, Olav and the entire Xethru team... Merry Christmas and happy new year.

    Kind Regards,
    Aditya Ayachit