You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
886 B

  1. #ifndef __SO_AND_CHEN__
  2. #define __SO_AND_CHEN__
  3. #include <stdlib.h>
  4. #include <stdbool.h>
  5. #include <stdio.h>
  6. #include <stdint.h>
  7. #include <math.h>
  8. #include "QRS.h"
  9. static const uint32_t enhanced_point = SAMPLING_RATE * 0.35f;
  10. #define signal_window_size 5
  11. static SignalPoint signal_window[signal_window_size];
  12. static uint32_t signal_window_count = 0;
  13. static SignalPoint slop;
  14. static bool so_chen_init_flag = false;
  15. static uint32_t init_count = 0;
  16. static bool maxi_init = false;
  17. static float maxi;
  18. static float slop_threshold = 0;
  19. static SignalPoint qrs_onset_point;
  20. static int qrs_on_set_count = 0;
  21. static int qrs_onset_idx = 0;
  22. static bool qrs_on_set_flag = false;
  23. static SignalPoint max;
  24. static SignalPoint max_slop;
  25. static bool max_init = false;
  26. static float last_maxi = 0;
  27. static uint32_t last_point = 0;
  28. SignalPoint So_Chen_detect(SignalPoint,int,float,float);
  29. #endif