
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
react-native-ecg-utils
Advanced tools
The main functionality is the calculation of cardio-interval lengths, heart rate and Stress Index.
The main functionality is the calculation of cardio-interval lengths, heart rate and Stress Index (SI).
During the first 6 seconds the algorithm is learning, if no 5 RR-intervals are found in the signal 5 RR-intervals are not found, the training is repeated. Further work with the library is iterative (adding new data, calculating indicators).
Firstly you need to determine lybrary parameters and then put them to library. Tne next step is initialize the filters. In the current version the filters are built-in and clearly defined: Butterworth 2nd order BandPass 5_15 Hz.
You can initialize averaging for SI calculation. It is optional value.
// 1. Raw signal sampling frequency
let sampling_rate = 250;
// 2. Data processing window size
let data_window = sampling_rate / 2;
// 3. Number of windows to calculate SI
let nwins_for_pressure_index = 30;
let math = new EcgMath(sampling_rate, data_window, nwins_for_pressure_index)
// Filters are initialized in the constructor
// optional
// 4. The averaging parameter of the IN calculation. Default value is 6.
let pressureIndexAverage = 6;
math.setPressureAverage(pressureIndexAverage);
The size of the transmitted array has to be of a certain length:
var samples: number[] = new Array(25)
// or
var samples: number[] = new Array(100)
Check for initial signal corruption. This method should be used if you want to detect and notify of a distorted signal explicitly.
if(math.isInitialSignalCorrupted){
// Signal corrupted!!!
}
math.pushData(samples)
// check for a new peak in the signal
if(math.isRRdetected){
// RR-interval length
console.log(math.RR)
// HR
console.log(math.HR)
// SI
console.log(math.PressureIndex)
// Moda
console.log(math.Moda)
// Amplitude of mode
console.log(math.AmplModa)
// Variation range
console.log(math.VariationDist)
math.setRRchecked()
}
math.clearData()
math.free()
FAQs
The main functionality is the calculation of cardio-interval lengths, heart rate and Stress Index.
The npm package react-native-ecg-utils receives a total of 1 weekly downloads. As such, react-native-ecg-utils popularity was classified as not popular.
We found that react-native-ecg-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.