Giter Site home page Giter Site logo

ghost's Introduction

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.

ghost's People

Contributors

eackermann avatar jchutrue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

dhockaday

ghost's Issues

Can't import ContinuousWaveletTransform with newest scipy

On google collaboratory, if I install ghost from git, and then run

from ghost.wave import ContinuousWaveletTransform

I get:

---------------------------------------------------------------------------

ImportError                               Traceback (most recent call last)

<ipython-input-8-e9048c87e447> in <module>()
----> 1 from ghost.wave import ContinuousWaveletTransform

2 frames

/content/ghost/ghost/wave/morlet.py in <module>()
      3 import numpy as np
      4 from .wavelet import Wavelet
----> 5 from scipy.misc import logsumexp
      6 import copy
      7 

ImportError: cannot import name 'logsumexp'

scipy fftpack missing

Once I fix the logsumexp issue, I get a new error:

from ghost.wave import ContinuousWaveletTransform

Now I get:

---------------------------------------------------------------------------

ModuleNotFoundError                       Traceback (most recent call last)

<ipython-input-5-e9048c87e447> in <module>()
----> 1 from ghost.wave import ContinuousWaveletTransform

5 frames

/content/ghost/ghost/sigtools/fourier.py in <module>()
      3 import logging
      4 import numpy as np
----> 5 import scipy.fftpack._fftpack as sff
      6 from . import convolution
      7 

ModuleNotFoundError: No module named 'scipy.fftpack._fftpack'

scipy: if _is_safe_size(n):

Hi,
This is my code with Accz and Time are array of float:

cwt = ContinuousWaveletTransform(wavelet= morse.Morse())
CPEF=cwt.transform(data =Accz, fs =1000, timestamps =Time, freq_limits =[0,300])

And the answer:

File ".......\lib\site-packages\scipy\fftpack\basic.py", line 87, in fft
if _is_safe_size(n):

TypeError: c2c() missing 1 required keyword-only argument: 'plan'

Adaptive sampling of wavelets

At the lower frequencies, we need more samples to get an accurate representation of the wavelet, but at higher frequencies, we need fewer. I need to figure out a better way of sampling the wavelets rather than the default of 16000 samples or so.

Too many points in wavelet spectrogram plot

If there are too many points in the wavelet spectrogram plot, some parts of the image will not render properly. I need to figure out a way to downsample correctly without messing up the temporal resolution.

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.