Roy Sandberg / Mbed 2 deprecated BLE_ECG

Dependencies:   BLE_API Queue mbed nRF51822

Fork of BLE_HeartRate by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers qrsdet.h Source File

qrsdet.h

00001 /*****************************************************************************
00002 FILE:  qrsdet.h
00003 AUTHOR: Patrick S. Hamilton
00004 REVISED:    4/16/2002
00005   ___________________________________________________________________________
00006 
00007 qrsdet.h QRS detector parameter definitions
00008 Copywrite (C) 2000 Patrick S. Hamilton
00009 
00010 This file is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Library General Public License as published by the Free
00012 Software Foundation; either version 2 of the License, or (at your option) any
00013 later version.
00014 
00015 This software is distributed in the hope that it will be useful, but WITHOUT ANY
00016 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
00017 PARTICULAR PURPOSE.  See the GNU Library General Public License for more
00018 details.
00019 
00020 You should have received a copy of the GNU Library General Public License along
00021 with this library; if not, write to the Free Software Foundation, Inc., 59
00022 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00023 
00024 You may contact the author by e-mail (pat@eplimited.com) or postal mail
00025 (Patrick Hamilton, E.P. Limited, 35 Medford St., Suite 204 Somerville,
00026 MA 02143 USA).  For updates to this software, please visit our website
00027 (http://www.eplimited.com).
00028   __________________________________________________________________________
00029   Revisions:
00030     4/16: Modified to allow simplified modification of digital filters in
00031     qrsfilt().
00032 *****************************************************************************/
00033 
00034 
00035 #define SAMPLE_RATE 500 /* Sample rate in Hz. - was 200 */
00036 #define MS_PER_SAMPLE   ( (double) 1000/ (double) SAMPLE_RATE)
00037 #define MS10    ((int) (10/ MS_PER_SAMPLE + 0.5))
00038 #define MS25    ((int) (25/MS_PER_SAMPLE + 0.5))
00039 #define MS30    ((int) (30/MS_PER_SAMPLE + 0.5))
00040 #define MS80    ((int) (80/MS_PER_SAMPLE + 0.5))
00041 #define MS95    ((int) (95/MS_PER_SAMPLE + 0.5))
00042 #define MS100   ((int) (100/MS_PER_SAMPLE + 0.5))
00043 #define MS125   ((int) (125/MS_PER_SAMPLE + 0.5))
00044 #define MS150   ((int) (150/MS_PER_SAMPLE + 0.5))
00045 #define MS160   ((int) (160/MS_PER_SAMPLE + 0.5))
00046 #define MS175   ((int) (175/MS_PER_SAMPLE + 0.5))
00047 #define MS195   ((int) (195/MS_PER_SAMPLE + 0.5))
00048 #define MS200   ((int) (200/MS_PER_SAMPLE + 0.5))
00049 #define MS220   ((int) (220/MS_PER_SAMPLE + 0.5))
00050 #define MS250   ((int) (250/MS_PER_SAMPLE + 0.5))
00051 #define MS300   ((int) (300/MS_PER_SAMPLE + 0.5))
00052 #define MS360   ((int) (360/MS_PER_SAMPLE + 0.5))
00053 #define MS450   ((int) (450/MS_PER_SAMPLE + 0.5))
00054 #define MS1000  SAMPLE_RATE
00055 #define MS1500  ((int) (1500/MS_PER_SAMPLE))
00056 #define DERIV_LENGTH    MS10
00057 #define LPBUFFER_LGTH ((int) (2*MS25))
00058 #define HPBUFFER_LGTH MS125
00059 
00060 #define WINDOW_WIDTH    MS80            // Moving window integration width.
00061 #define FILTER_DELAY (int) (((double) DERIV_LENGTH/2) + ((double) LPBUFFER_LGTH/2 - 1) + (((double) HPBUFFER_LGTH-1)/2) + PRE_BLANK)  // filter delays plus 200 ms blanking delay
00062 #define DER_DELAY   WINDOW_WIDTH + FILTER_DELAY + MS100