Giter Site home page Giter Site logo

pacpy's Introduction

pacpy

Build Status Project Status: Inactive โ€“ The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.

A module to calculate phase-amplitude coupling in Python.

Note: pactools

Pacpy is no longer actively supported, but it is in a stable state. For an actively maintained package, we recommend pactools. Note that these two packages may give different results when using the default filter parameters.

Demo

A Binder demo, complete with simulated data, can be found here.

Install

pip install pacpy

Tested on Linux (Ubuntu 4.10), OS X (10.10.4), and Windows 9.

Dependencies

  • numpy
  • scipy
  • pytest (optional)

That is , we assume Anaconda is installed.

Matlab

The wrapper for MATLAB can be found at, https://github.com/voytekresearch/pacmat

Usage

An example of calculating PAC from two simulated voltage signals using the phase-locking value (PLV) method:

import numpy as np
from scipy.signal import hilbert
from pacpy.pac import plv

t = np.arange(0, 10, .001) # Define time array
lo = np.sin(t * 2 * np.pi * 6) # Create low frequency carrier
hi = np.sin(t * 2 * np.pi * 100) # Create modulated oscillation
hi[np.angle(hilbert(lo)) > -np.pi*.5] = 0 # Clip to 1/4 of cycle

plv(lo, hi, (4,8), (80,150)) # Calculate PAC
0.99863308613553081

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.