Coder Social home page Coder Social logo

m_indices_analysis's Introduction

This code is used in the article: "Quantifing spike train oscillation: biases. distortions and solutions", published in PLOS computational biology, 2015.

V1.0 - Ayala Matzner 14/4/2015

The package file contains 6 Matlab functions and 1 test script which runs them:

testScript.m
Test code for simulating an inhomogeneous Poisson spike train using an oscillatory rate function, and extracting the modulation index of this spike train.

1. getModulationIndex.m
This function takes as input the parameters of a spike train, and its spectrum (estimated using welch's method), and returns the modualtion index of the spike train.
Input parameters:
  peakPower: the spectral peak's power.
  r0: base firing rate.
  T: total recording time (length of the spike train).
  winLen: the window length used in the calculation of the spectrum.
  fs: the sampling rate of the spike train, in Hz.

Output parameters:  
  m : The modulation index of the spike train

2. correctedPeak.m
This function scales the power estimated by Welch's method to the analytically calculated power
Input parameters:
  peak: the spectral peak's power.
  winLen: the window length used in the calculation of the spectrum.
  T: total recording time (length of the spike train).
  r0: base firing rate.
  fs: the sampling rate of the spike train, in Hz.

Output parameters:  
  correctedPeak : the corrected peak's power.

3. getModIndexWithRefPer.m
This function includes a correction procedure that corrects the modulation index to accomodate for the refractory period.
Input parameters:
  spikeTrain: point process spike train
  refPeriod: length of the absolute refractory period, in ms
  fs: the sampling rate of the spike train, in Hz.
  freq: the frequncy of the spectral peak.
  winLen: the window length to use in the estimation of the spectrum

Output parameters:  
  modulation : The corrected modulation index of the spike train
  originalModulation : The original modulation index of the spike train, without correction.

4. powerSpectrum.m
This function estimates the power spectrum of a spike train using Welch's method. It return  the peak in a specific searched band.
 Input parameters:
  spikeTrain: point process spike train
  fs: the sampling rate of the spike train, in Hz.
  stratBand: the low limit of the searched band, in Hz.
  endBand: the high limit of the searched band, in Hz.
  winLen: the window length to use in pwelch

Output parameters:  
  spectrum : The spectrum of the spike train
  freqRange: corresponding vector of frequncies, in Hz.
  snr: the SNR of the peak relative to the 100-500Hz baseline.
  peakPower: the power of the highest peak in the searched band
  peakFreq: the frequency of the highest peak in the searched band

5. generatePoissonTrain.m
This function generates a poisson spike train using a rate function

6.extractRequiredRecordingDuration.m 
This function calculates the recording duration required to detect a spectral peak.
Input parameters:
  r0: base firing rate.
  m: the modulation index of the spike train.
  snr: the desired SNR
  winLen: the window length used in the calculation of the spectrum.

Output parameters:  
  requiredTime: the required recording duration


m_indices_analysis's People

Contributors

roybka avatar

Watchers

 avatar

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.