基于stm32的血压算法

  • M3_451193
    了解作者
  • 142.1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-05 08:42
    上传日期
基于stm32的血压算法,精度还可以,需要的话可以直接移植使用,方便大家。
49636939Blood-pressure-monitor-program.zip
内容介绍
//***************************************************************************** // THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR // REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, // INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR // COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. // TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET // POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY // INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR // YOUR USE OF THE PROGRAM. // // IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, // CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY // THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED // OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT // OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. // EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF // REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS // OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF // USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S // AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF // YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS // (U.S.$500). // // Unless otherwise stated, the Program written and copyrighted // by Texas Instruments is distributed as "freeware". You may, // only under TI's copyright in the Program, use and modify the // Program without any charge or restriction. You may // distribute to third parties, provided that you transfer a // copy of this license to the third party and the third party // agrees to these terms by its first use of the Program. You // must reproduce the copyright notice and any other legend of // ownership on each copy or partial copy, of the Program. // // You acknowledge and agree that the Program contains // copyrighted material, trade secrets and other TI proprietary // information and is protected by copyright laws, // international copyright treaties, and trade secret laws, as // well as other intellectual property laws. To protect TI's // rights in the Program, you agree not to decompile, reverse // engineer, disassemble or otherwise translate any object code // versions of the Program to a human-readable form. You agree // that in no event will you alter, remove or destroy any // copyright notice included in the Program. TI reserves all // rights not specifically granted under this license. Except // as specifically provided herein, nothing in this agreement // shall be construed as conferring by implication, estoppel, // or otherwise, upon you, any license or other right under any // TI patents, copyrights or trade secrets. // // You may not use the Program in non-TI devices. //***************************************************************************** //***************************************************************************** // MSP430FG437 based pulse oximeter demonstration // V. Chan and S. Underwood // Texas Instruments Hong Kong Ltd. // May 2005 //***************************************************************************** #include <msp430xG43x.h> #include "stdint.h" #define seg_a 0x01 #define seg_b 0x02 #define seg_c 0x10 #define seg_d 0x04 #define seg_e 0x80 #define seg_f 0x20 #define seg_g 0x08 #define seg_h 0x40 #define NUM_0 (seg_a | seg_b | seg_c | seg_d | seg_e | seg_f) #define NUM_1 (seg_b | seg_c) #define NUM_2 (seg_a | seg_b | seg_d | seg_e | seg_g) #define NUM_3 (seg_a | seg_b | seg_c | seg_d | seg_g) #define NUM_4 (seg_b | seg_c | seg_f | seg_g) #define NUM_5 (seg_a | seg_c | seg_d | seg_f | seg_g) #define NUM_6 (seg_a | seg_c | seg_d | seg_e | seg_f | seg_g) #define NUM_7 (seg_a | seg_b | seg_c) #define NUM_8 (seg_a | seg_b | seg_c | seg_d | seg_e | seg_f | seg_g) #define NUM_9 (seg_a | seg_b | seg_c | seg_d | seg_f | seg_g) #define NUM_A (seg_a | seg_b | seg_c | seg_e | seg_f | seg_g) #define NUM_B (seg_c | seg_d | seg_e | seg_f | seg_g) #define NUM_C (seg_a | seg_d | seg_e | seg_f) #define NUM_D (seg_b | seg_c | seg_d | seg_e | seg_g) #define NUM_E (seg_a | seg_d | seg_e | seg_f | seg_g) #define NUM_F (seg_a | seg_e | seg_f | seg_g) const unsigned char hex_table[] = { 0xEB, /* "0" LCD segments a+b+c+d+e+f */ 0x60, /* "1" */ 0xC7, /* "2" */ 0xE5, /* "3" */ 0x6C, /* "4" */ 0xAD, /* "5" */ 0xAF, /* "6" */ 0xE0, /* "7" */ 0xEF, /* "8" */ 0xED /* "9" */ // NUM_0,NUM_1,NUM_2,NUM_3,NUM_4,NUM_5,NUM_6,NUM_7, // NUM_8,NUM_9,NUM_A,NUM_B,NUM_C,NUM_D,NUM_E,NUM_F }; int32_t mul16(register int16_t x, register int16_t y); //FIR filter coefficient for //removing 50/60Hz and 100/120Hz //from the signals #if 0 static const int16_t coeffs[9] = { 5225, 5175, 7255, 9453, 11595, 13507, 15016, 15983, 16315 }; #else static const int16_t coeffs[12] = { 688, 1283, 2316, 3709, 5439, 7431, 9561, 11666, 13563, 15074, 16047, 16384 }; #endif //#define FIRST_STAGE_TARGET_HIGH 3900 //#define FIRST_STAGE_TARGET_LOW 3600 //#define FIRST_STAGE_TARGET_HIGH_FINE 4096 //#define FIRST_STAGE_TARGET_LOW_FINE 3500 #define FIRST_STAGE_TARGET_HIGH 3500 #define FIRST_STAGE_TARGET_LOW 3000 #define FIRST_STAGE_TARGET_HIGH_FINE 4096 #define FIRST_STAGE_TARGET_LOW_FINE 2500 #define FIRST_STAGE_STEP 5 #define FIRST_STAGE_FINE_STEP 1 enum scope_type_e { SCOPE_TYPE_OFF = 0, SCOPE_TYPE_HEART_SIGNALS, SCOPE_TYPE_RAW_SIGNALS, SCOPE_TYPE_LED_DRIVE, }; int scope_type = SCOPE_TYPE_HEART_SIGNALS; int ir_dc_offset = 2000; int vs_dc_offset = 2000; int ir_LED_level; int vs_LED_level; int ir_heart_signal; int vs_heart_signal; int ir_heart_ac_signal; int vs_heart_ac_signal; int ir_sample; int vs_sample; unsigned int rms_ir_heart_ac_signal; unsigned int rms_vs_heart_ac_signal; unsigned int sample_count_ir = 0; unsigned int sample_count_vs = 0; int32_t ir_dc_register = 0; int32_t vs_dc_register = 0; int32_t ir_2nd_dc_register = 0; int32_t vs_2nd_dc_register = 0; unsigned long log_sq_ir_heart_ac_signal; unsigned long log_sq_vs_heart_ac_signal; unsigned long sq_ir_heart_ac_signal; unsigned long sq_vs_heart_ac_signal; unsigned int pos_edge = 0; unsigned int edge_debounce; unsigned int heart_beat_counter; unsigned int log_heart_signal_sample_counter; unsigned int heart_signal_sample_counter; unsigned int led_on_always; int32_t ir_pi_last_y = 0; int32_t ir_pi_last_x = 0; int32_t vs_pi_last_y = 0; int32_t vs_pi_last_x = 0; /* The results */ unsigned int heart_rate; unsigned int SaO2; /* Function prototypes */ unsigned long isqrt32(register unsigned long h); int16_t dc_estimator(register int32_t *p, register int16_t x); int16_t ir_filter(int16_t sample); int16_t vs_filter(int16_t sample); void set_LCD(void); void display_word(unsigned int); void display_number(int value, int start, int width); void display_pulse(int on); void display_correcting(int x, int on); void main(void) { double f1; unsigned int i; int32_t x; int32_t y; WDTCTL = WDTPW | WDTHOLD; //Allow a little time for things //like the 32kHz oscillator to //settle for (i = 0; i < 0xFFFF; i++) //dummy loop */; #if 0 SVSCTL |= (SVSON | 0x40); //Wait for adequate
评论
    相关推荐
    • PID算法STM32实现
      PID算法STM32实现,包括纯C实现和PID参数的调节方法和图示等
    • STM32_PID算法源码
      基于STM32F103R8的PID算法例程,完整工程源码,PWM输出控制信号,ADC输入反馈信号,形成闭环控制。
    • 基于STM32的PID算法
      该资源为经典工业控制PID算法STM32源码及思想,详细的解释了PID算法思想及实现,非常适合新手学习,资源整理不易,同学务必珍惜。
    • STM32 PID算法
      PID算法
    • C语言MD5算法STM32单片机亲测可用
      lwip协议栈源码提取 链接:https://pan.baidu.com/s/1Lcwap2cC0fNd7FhY44JhPQ 提取码:w74p
    • STM32 FFT算法实现
      在原子哥的开发板上实现的FFT算法和UCOS。全部资料均来自网络,谢谢原子哥,谢谢网络上无私的朋友
    • stm32加密算法.rar
      STM32加密算法库,包含常见的加密算法,AES、ARC4、ECC、HASH、RAND、RSA、TDES_DES等加密算法
    • stm32 风洞 pid算法程序
      stm32 风洞控制程序 PID
    • stm32 定时器中断算法
      stm32 定时器中断算法,s曲线七段法,可以根据自己应用实例进行更改
    • SIM800C_MQTT.rar
      使用SIM800C模块,使用MQTT协议,连接中国移动onenet平台,能实现数据的订阅、发布、存储等