Skip to content

Commit

Permalink
code used in 20220707 revision
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhcharlton committed Jul 7, 2022
1 parent 359c2c6 commit 552172b
Show file tree
Hide file tree
Showing 34 changed files with 6,181 additions and 89 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
.DS_Store
Docs/.DS_Store
/source/beat_detection_algorithms/ppg_beat_detection/*.*
/source/*_beat_detector.m
/source/low_pass_differentiator_100Hz.mat
/source/spar_beat_detector.m
/source/low_pass_differentiator_*Hz.mat
/source/archive/*.*
13 changes: 0 additions & 13 deletions docs/functions/ampd_beat_detector.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,8 @@ Peter H. Charlton, University of Cambridge, February 2022.
## Version
0.1, and is still in development. In particular, the lpf_freq input should probably be removed.

## Source
Adapted from ampd.m in the AMPD-algorithm repository
(<https://github.com/mathouse/AMPD-algorithm>), using the version which
was last updated on 10 Nov 2014 and is licensed under the MIT Licence.

## MIT License
Copyright (c) 2021 Peter H. Charlton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Original:
MIT License
Copyright (c) 2014 Martín Josemaría
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1 change: 1 addition & 0 deletions docs/functions/assess_beat_detectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ photoplethysmogram (PPG) beat detectors on a dataset.
options.do_downsample - (1 or 0, default value of 0) A logical indicating whether or not to downsample the PPG signals prior to analysis.
options.downsample_freq - the frequency at which to downsample PPG signals (Hz). Only used if downsampling is enabled by options.do_downsample.
options.redo_analysis - A logical indicating whether or not to overwrite existing analysis files in order to redo the analysis
options.redo_selected_beat_detectors - A cell containing the beat detectors for which to redo the analysis

## Outputs
+ ...
Expand Down
27 changes: 27 additions & 0 deletions docs/functions/collate_mimic_perform_af_dataset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `COLLATE_MIMIC_PERFORM_AF_DATASET` - Collate AF dataset.
COLLATE_MIMIC_PERFORM_AF_DATASET downloads and collates data from the MIMIC-III Waveform
Database Matched Subset during Atrial Fibrillation (AF) and sinus rhythm.

## Inputs
+ none (although see 'setup_up' for the parameters to be set)

## Working Files
The script downloads several files from PhysioNet, which are saved locally.

## Outputs
+ files : Two MATLAB files containing the required data for PPG beat detector evaluation: 'mimic_af_data.mat', and 'mimic_non_af_data.mat'.

## Preparation:
Modify the MATLAB script by inserting the 'up.paths.root_folder' and 'up.paths.save_folder' into the setup_up function.

## Documentation
<https://ppg-beats.readthedocs.io/>

## Author
Peter H. Charlton, University of Cambridge, June 2022.

## Licence
This file is part of PPG-beats.
PPG-beats is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PPG-beats is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PPG-beats. If not, see <https://www.gnu.org/licenses/>.
28 changes: 28 additions & 0 deletions docs/functions/collate_mimic_perform_ethnicity_dataset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# `COLLATE_MIMIC_PERFORM_ETHNICITY_DATASET` - Collates ethnicity dataset.
COLLATE_MIMIC_PERFORM_ETHNICITY_DATASET Downloads and collates data from the MIMIC-III
Waveform Database Matched Subset from Black and White subjects, for PPG beat
detector performance evaluation.

## Inputs
+ none (although see 'setup_up' for the parameters to be set)

## Working Files
The script downloads several files from PhysioNet, which are saved locally.

## Outputs
+ files : Two MATLAB files containing the required data for PPG beat detector evaluation: 'mimic_B_data.mat', and 'mimic_W_data.mat'.

## Preparation:
Modify the MATLAB script by inserting the 'up.paths.root_folder' and 'up.paths.save_folder' into the setup_up function.

## Documentation
<https://ppg-beats.readthedocs.io/>

## Author
Peter H. Charlton, University of Cambridge, June 2022.

## Licence
This file is part of PPG-beats.
PPG-beats is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PPG-beats is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PPG-beats. If not, see <https://www.gnu.org/licenses/>.
27 changes: 27 additions & 0 deletions docs/functions/collate_mimic_perform_train_test_datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `COLLATE_MIMIC_PERFORM_TRAIN_TEST_DATASETS` - Collates training and testing datasets.
COLLATE_MIMIC_PERFORM_TRAIN_TEST_DATASETS downloads and collates data from the MIMIC-III
Waveform Database, for PPG beat detector performance evaluation.

## Inputs
+ none (although see 'setup_up' for the parameters to be set)

## Working Files
The script downloads several files from PhysioNet, which are saved locally.

## Outputs
+ files : MATLAB files containing the required data for PPG beat detector evaluation: 'mimic_train_a_data.mat', 'mimic_train_n_data.mat', 'mimic_train_all_data.mat', 'mimic_test_a_data.mat', 'mimic_test_n_data.mat', and 'mimic_test_all_data.mat'.

## Preparation:
Modify the MATLAB script by inserting the 'up.paths.root_folder' and 'up.paths.save_folder' into the setup_up function.

## Documentation
<https://ppg-beats.readthedocs.io/>

## Author
Peter H. Charlton, University of Cambridge, June 2022.

## Licence
This file is part of PPG-beats.
PPG-beats is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PPG-beats is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PPG-beats. If not, see <https://www.gnu.org/licenses/>.
33 changes: 33 additions & 0 deletions docs/functions/detect_ppg_beats_old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# `DETECT_PPG_BEATS` - detects beats in PPG.
DETECT_PPG_BEATS detects beats in a photoplethysmogram (PPG) signal
using a specified beat detector

## Inputs
+ s : a structure containing the following fields:

- v : a vector of PPG values
- fs : the sampling frequency of the PPG in Hz

+ beat_detector - a string specifying the beat detector to be used

## Outputs
+ peaks : ...TBC...

+ onsets : ...TBC...

+ mid_amps : ...TBC...

## Documentation
<https://ppg-beats.readthedocs.io/>

## Author
Peter H. Charlton, University of Cambridge, February 2022.

## Version
0.1, and is still in development.

## Licence
This file is part of PPG-beats.
PPG-beats is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PPG-beats is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PPG-beats. If not, see <https://www.gnu.org/licenses/>.
12 changes: 7 additions & 5 deletions docs/functions/msptd_beat_detector.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ using the 'Multi-Scale Peak and Trough Detection' beat detector
## Outputs
+ peaks : indices of detected pulse peaks

+ troughs : indices of detected pulse troughs
+ onsets : indices of detected pulse troughs (i.e. onsets)

## Reference
S. M. Bishop and A. Ercole, 'Multi-scale peak and trough detection optimised for periodic and quasi-periodic neuroscience data,' in Intracranial Pressure and Neuromonitoring XVI. Acta Neurochirurgica Supplement, T. Heldt, Ed. Springer, 2018, vol. 126, pp. 189-195. <https://doi.org/10.1007/978-3-319-65798-1_39>

## Author
Dr Steven Bishop - wrote the code ('new_peak_trough')
Peter H. Charlton - did very little, just wrote this wrapper and made slight edits (see 'new_peak_trough')
Peter H. Charlton

## Documentation
<https://ppg-beats.readthedocs.io/>

## Version
0.1, and is still in development.

## Licence
...TBC...
## MIT License
Copyright (c) 2021 Peter H. Charlton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 552172b

Please sign in to comment.