Giter Site home page Giter Site logo

Comments (5)

edeno avatar edeno commented on August 19, 2024

Hey,

So you're running out of memory, probably because of how highly sampled your data is. I would downsample your data to a more manageable sampling rate. For most things, if you downsample to 1000 Hz (for spikes and LFPs), that should still give you enough resolution to resolve frequencies up to 500 Hz.

from rate_adjustment_for_spike_coherence.

IljaPilja avatar IljaPilja commented on August 19, 2024

Hi,
so when I resample my 300 ms data piece (aka 6000 data ticks) at 20 kHz to 1 kHz, the LFP looks ok, but my binary vector containing ones for my spike times only consists of zeros since the resampling step has removed them all. Thus the coherence measurement does not work with spike vectors consisting of only zeros. Besides the factor of 20 downsampling I tried 10, 5, 2.5, the latter produces the MemoryError again and the others give me an almost flat coherence signal. Guess my data does not work with this function. Thanks for the quick response though.

from rate_adjustment_for_spike_coherence.

edeno avatar edeno commented on August 19, 2024

There's nothing in downsampling that will remove your spike times.

For example if you spike times are 0.001, 0.005, 0.007 seconds and you had 1 ms bins (sampling rate: 500 Hz), you would have something like 1, 0, 0, 0, 1, 0, 1.

If you downsample to 2 ms bins (sampling rate: 1000 Hz), this would now be: 1, 0, 1, 1

from rate_adjustment_for_spike_coherence.

Mark-Kramer avatar Mark-Kramer commented on August 19, 2024

For the missing spike times, an option could be:

  1. Get the spike times at high sampling frequency.
  2. Downsample the LFP to 1 kHz.
  3. Make a vector of zeros, with sampling rate 1 kHz, and length equal to that of the LFP.
  4. Put this spike times from (1) at the correct temporal locations in the vector in (3).

This would perhaps, preserve your spike times in (1), and let you downsample in (2).

from rate_adjustment_for_spike_coherence.

IljaPilja avatar IljaPilja commented on August 19, 2024

Thanks for the great help. I'm using the rebin package from Python to perform the downsampling and this works great with my data and I'm able to now determine the coherence.
Thank you again for your help.

from rate_adjustment_for_spike_coherence.

Related Issues (1)

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.