GithubHelp home page GithubHelp logo

HRV not defined about neurokit.py HOT 3 CLOSED

bbertoldi avatar bbertoldi commented on August 22, 2024
HRV not defined

from neurokit.py.

Comments (3)

DominiqueMakowski avatar DominiqueMakowski commented on August 22, 2024

@bbertoldi It depends on how you named the object returned by the ecg_process() function. Could you paste the code above that?

from neurokit.py.

bbertoldi avatar bbertoldi commented on August 22, 2024

The only code I have above that is this one:

import neurokit as nk
 
data, sampling_rate = nk.read_acqknowledge("Zall_Baseline.acq", return_sampling_rate=True)
 
 
data[0:50000].plot()  # Plot a subset of raw data
 
processed_ecg = nk.ecg_process(ecg=data["ECG - ECG100C"], sampling_rate=sampling_rate)
nk.z_score(processed_ecg["df"][0:50000]).plot()
 
 
# Plot spectral HRV on a subset
nk.z_score(processed_ecg["df"][['ECG_Filtered', 'ECG_RR_Interval', 'ECG_HRV_HF', 'ECG_HRV_LF', 'ECG_HRV_ULF', 'ECG_HRV_VHF', 'ECG_HRV_VLF']][0:50000]).plot()
 
 
# Print HRV indices
print(processed_ecg["ECG"]["HRV"])

Since I'm completely new to this I'm still confused as to how to extract HRV indices from an Acknowledge file. Do I do this using the script above? How is the print(hrv.keys()) # and hrv["RMSSD"]
hrv["medianNN"] hrv["cvNN"] hrv["LF/HF"] different from what the above code does?

from neurokit.py.

DominiqueMakowski avatar DominiqueMakowski commented on August 22, 2024

@bbertoldi

Here's a minimal code to check what HRV indices are available and extract (print) one of them.

import neurokit as nk

# Preprocessing
data, sampling_rate = nk.read_acqknowledge("Zall_Baseline.acq", return_sampling_rate=True)
processed_ecg = nk.ecg_process(ecg=data["ECG - ECG100C"], sampling_rate=sampling_rate)

# What are the available indices?
print(processed_ecg["ECG"]["HRV"].keys())

# Print the RMSSD only
print(processed_ecg["ECG"]["HRV"]["RMSSD"])

Then again, in depends on what you want to do with these indices.

from neurokit.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.