Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phasic-Tonic

PyPI version Build Status License

Overview

phasic_tonic is a python package for analysing phasic and tonic REM states from electrophysiological signals. It implements a threshold-based signal processing algorithm for detecting phasic substates within REM sleep.

phasic_tonic is intended for researchers working with sleep data and looking to classify REM sleep into further substates.

Examples

Key Features

  • Phasic/Tonic Detection: Applies threshold-based algorithms to distinguish phasic and tonic states from raw electrophysiological data
  • Statistical Analysis: Compute basic statistics for phasic/tonic REM periods.

Installation

Install with pip:

pip install phasic_tonic

or from the source code:

$ pip install git+https://github.com/8Nero/phasic_tonic.git

Quick Start

Here's a simple example of how to get started with phasic_tonic:

import pooch
import numpy as np
from phasic_tonic.detect import detect_phasic

f_path = pooch.retrieve("https://raw.githubusercontent.com/8Nero/phasic_tonic/main/data/ex01.npz", 
                        known_hash="11e579b9305859db9101ba3e227e2d9a72008423b3ffe2ad9a8fee1765236663")

data = np.load(f_path, allow_pickle=True)

hypnogram = data['hypnogram']
lfp = data['lfp_hpc']
fs = 500  # Sampling rate

phasicREM = detect_phasic(lfp, hypnogram, fs)
print(phasicREM)

About

Analysing phasic and tonic REM states from electrophysiological signals.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

Used by

Contributors

Languages