Skip to content
/ ghost Public

Spectral analysis tools for neuroscience data

License

Notifications You must be signed in to change notification settings

nelpy/ghost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghost-logo

ghost (Grand Hub Of Spectral Tools) is the friendly phantom that helps you do signal processing on neuroscience data, especially spectral analysis ;)

It can be used as a standalone package for numpy arrays, or as a companion plugin module to nelpy. Currently it supports rudimentary wavelet analysis. Planned features include multitaper Fourier methods, phase-amplitude & phase-phase coupling, current source density analysis, and more.

ghost tries to be as lightweight yet fast as possible. Suggestions for increasing efficiency and performance are always welcome!

Installation

To install this package, please run the following commands

$ git clone https://github.com/nelpy/ghost.git
$ cd ghost
$ pip install

If you are a developer and would like to modify the code, replace the last command above with

$ pip install -e .

Example

Suppose you have a numpy array named X which was sampled at 1 kHz, on which you want to run a continuous wavelet transform:

from ghost.wave import ContinuousWaveletTransform

cwt = ContinuousWaveletTransform()
cwt.transform(X, fs=1000)

If you have a nelpy AnalogSignalArray named asa, you can simply do:

from ghost.wave import ContinuousWaveletTransform

cwt = ContinuousWaveletTransform()
cwt.transform(asa)

In either case, you can obtain the spectrogram by calling plot:

cwt.plot(logscale=False, 
         standardize=True, 
         cmap=plt.cm.Spectral_r,
         levels=300, 
         vmin=0, 
         vmax=10)

And that's it! Short and simple.