File Exchange

image thumbnail

Current source density (CSD)

version 1.0.0 (4.4 KB) by Timothy Olsen
Obtains the current source density from local field potential data recorded from a linear electrode array


Updated 10 Nov 2018

View License

Determines the 1-dimensional (in space) current source density (CSD) for a set of voltage traces obtained from a linear array of electrodes of equal spacing. The CSD can be obtained using the standard CSD method (Nicholson & Freeman, 1975, J Neurophysiol, 38(2): 356-68) or the inverse (delta) CSD method (Petterson et al., 2006, J Neurosci Methods, 154(1-2):116-33). A full description on how to use the function is included within the function script. Any advice or indications of mistakes/bugs would be very welcome.

Cite As

Timothy Olsen (2021). Current source density (CSD) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

wei xu

Oops, just realised my error. I got the data array the wrong way round.


wei xu

Hi there:
I tried to use it with the three minimum inputs but i get the error message:

Error using plot
Vectors must be the same length.

Error in CSD (line 114)

The first input to the function is a 16x150001 double precision array (16 channels), the second in put is 250 (the sampling rate in hz) and the third input is 0.0005 (distance in meters). Am i doing something wrong?

Many thanks

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!