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.

41 lines
949 B

  1. #ifndef __ALGORITHM__
  2. #define __ALGORITHM__
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6. #include <stdint.h>
  7. #include <stdbool.h>
  8. #include <math.h>
  9. #include "QRS.h"
  10. static const uint32_t MEAN_SIZE = SAMPLING_RATE;
  11. static uint32_t mean_count;
  12. static float mean_sum;
  13. static float mean;
  14. static const uint32_t RMS_SIZE = SAMPLING_RATE;
  15. static uint32_t rms_count;
  16. static float rms_sum;
  17. static float rms;
  18. static const uint32_t CV_SIZE = SAMPLING_RATE;
  19. static uint32_t cv_count;
  20. static float sd;
  21. static float cv;
  22. static float current_max;
  23. static float current_min;
  24. static int max_point;
  25. static int min_point;
  26. static SignalPoint peak;
  27. static bool is_detecting_emi;
  28. static bool init_flag = false;
  29. extern float CalculateMean(float);
  30. extern float CalculateRootMeanSquare(float);
  31. extern float CalculateCoefficientOfVariation(float);
  32. extern void InitPeakDetect(float,bool);
  33. extern SignalPoint PeakDetect(float,int,float,bool*);
  34. #endif