Skip to content

semenovDA/VSRstats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSRstats

Sphygmogram VSR compute util

Installation

The VSRstats package is completely pip-installable use: $ pip install VSRstats
or install from github: $ pip install git+https://github.com/semenovDA/VSRstats

Usage

You can use example that included in this repository

$ git clone https://github.com/semenovDA/VSRstats
$ pyhton example.py

Define required libraries:

from struct import unpack
import numpy as np
from VSRstats import VSR

Define loading signal function:

def loadSignal(filepath):
    
    file = open(filepath, "rb").read()
    ufile = unpack('10000H', file)
    arr = np.array(ufile)
    
    return arr

Usage for 1 signal:

filepath = './data/d0001' # path to signal
signal = loadSignal(filepath)
stats = VSR(signal).stats
print(stats)

Output:

{'nni_counter': 125, 'nni_mean': 79.92, 'nni_min': 66.0, 'nni_max': 88.0, 'hr_mean': 752.1562922784314, 
'hr_min': 681.8181818181819, 'hr_max': 909.0909090909091, 'hr_std': 33.27091439584001, ..... 'tri_index': 1.6025641025641026}

Usage example for signals:

filepathes = ['./data/d0001', './data/d0002', './data/d0003'] # Signals
signals = np.array([loadSignal(f) for f in filepathes])
stats = VSR(signals).stats
print(len(stats))

Output:

3

About

Sphygmogram VSR compute library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages