The neuronal cortical network generates slow (<1Hz) spontaneous rhythmic activity that emerges from the recurrent connectivity. This activity occurs during slow wave sleep or anesthesia and also in cortical slices, consisting of alternating up (active, depolarized) and down (silent, hyperpolarized) states. The search for the underlying mechanisms and the possibility of analyzing network dynamics in vitro has been subject of numerous studies. This exposes the need for a detailed quantitative analysis of the membrane fluctuating behavior and computerized tools to automatically characterize the occurrence of up and down states. 

Intracellular recordings from different areas of the cerebral cortex were obtained from both in vitro and in vivo preparations during slow oscillations. A method that separates up and down states recorded intracellularly is defined and analyzed here. The method exploits the crossover of moving averages, such that transitions between up and down membrane regimes can be anticipated based on recent and past voltage dynamics. We demonstrate experimentally the utility and performance of this method both offline and online, the online use allowing to trigger stimulation or other events in the desired period of the rhythm. This technique is compared with a histogram-based approach that separates the states by establishing one or two discriminating membrane potential levels. The robustness of the method presented here is tested on data that departs from highly regular alternating up and down states. 

Applying this strategy to the characterization of the electrophysiological signal, the crossing points of the two EMAs are good approximations of the transitions between up and down states (of both, up and down initiation) (Fig. 1)


Fig. 1
Offline separation of standard up and down states. Intracellular recording in vivo from a neuron in cat primary visual cortex. Time marks in the horizontal axes of the traces indicate 1 second interval. A fast EMA is represented as a black line and a slow EMA in dashed gray line. The points of crossing between both of them have been used to calculate the beginning and end of up states, highlighted with a blue box. (Seamari et al., PLoS ONE 2(9): e888)

This technique can be compared with a histogram-based approach that operates by establishing one or two discriminating membrane potential levels. The histogram-based approach cannot be applied reliably in any situation that differs from a highly regular oscillation, while the method we propose performs well on data that clearly departs from the standard picture, compensating for artifacts or conditions different from the ideal setting (Fig. 2 & 3.)

Fig. 2.
Offline up and down states separation in drifted recordings. In vivo intracellular recording from a neuron in the primary visual cortex from the cat. A drift in the membrane potential is illustrated. (Seamari et al., PLoS ONE 2(9): e888)
Fig. 3
Histogram in drifted recordings. Histogram corresponding the Fig. 2. trace. (Seamari et al., PLoS ONE 2(9): e888)

This method can be used offline and also online (Mov. 1.), what allows triggering events upon the initiation of an up or down state. The method is simple in its definition and can be applied in real time on conventional computers for large amounts of data. An open-source MATLAB® toolbox, and Spike 2®-compatible version has been implemented. Below you can download the code in both languages. 


Mov. 1.
Online detection of up and down states applying MAUDS to the intracellular recordings. Slow rhythm recorded in the barrel cortex of an anesthetized rat. Top panel: Online up states detection (trace going up), Middle panel: Unfiltered LFP.  Bottom panel: Intracellular recording. (Seamari et al., PLoS ONE 2(9): e888)



Seamari Y, Narvaez JA, Vico FJ, Lobo D & Sanchez-Vives MV
PLoS ONE 2(9): e888 (2007)




  • Spike2 Script Version
    In this version, the algorithm is written totally in the script language of spike2. The advantage is the legibility of the code. The algorithm is executed in the pc, sharing its resources with the task of recording the signals. So the delay of the characterization and real-time triggering depends on the pc used. 

  • Spike2 Sequencer Version
    In this version, the algorithm is implemented and executed into the sequencer of the data acquisition unit. The  response time of this solution is very high and independent of the pc used. However, the code is much more unlegible because it is written in the assembler language of the sequencer.



  • Matlab Version
    Mauds implementation in Matlab. It can process mat data files and Spike2 txt exported files. Includes plotting utilities.

All software licensed under


In the case of any question regarding our algorithms or our software, we provide a free forum to all interested scientists. Feel free to post any question or suggestion you might have.

Related bibliography


Achermann P, Borbely AA (1997) Low-frequency (< 1 Hz) oscillations in the human sleep electroencephalogram. Neuroscience 81: 213-222.   


Aghajanian GK, Rasmussen K (1989) Intracellular studies in the facial nucleus illustrating a simple new method for obtaining viable motoneurons in adult rat brain slices. Synapse 3: 331-338.    


Amzica F, Steriade M (1995) Short- and long-range neuronal synchronization of the slow (< 1 Hz) cortical oscillation. J Neurophysiol 73: 20-38.    


Amzica F, Steriade M (1997) The K-complex: its slow (<1-Hz) rhythmicity and relation to delta waves. Neurology 49: 952-959.    


Anderson J, Lampl I, Reichova I, Carandini M, Ferster D (2000) Stimulus dependence of two-state fluctuations of membrane potential in cat visual cortex. Nat Neurosci 3: 617-621.    


Azouz R, Gray CM (1999) Cellular mechanisms contributing to response variability of cortical neurons in vivo. J Neurosci 19: 2209-2223.    


Benucci A, Verschure PF, Konig P (2004) Two-state membrane potential fluctuations driven by weak pairwise correlations. Neural Comput 16: 2351-2378.    


Cowan RL, Wilson CJ (1994) Spontaneous firing patterns and axonal projections of single corticostriatal neurons in the rat medial agranular cortex. J Neurophysiol 71: 17-32.   


Crochet S, Chauvette S, Boucetta S, Timofeev I (2005) Modulation of synaptic transmission in neocortex by network activities. Eur J Neurosci 21: 1030-1044.    


Crochet S, Fuentealba P, Timofeev I, Steriade M (2004) Selective amplification of neocortical neuronal output by fast prepotentials in vivo. Cereb Cortex 14: 1110-1121.    


Ellinger AG (1971) The art of investment. London: Bowes and Bowes.


Fuentealba P, Steriade M (2005) Thalamic oscillations modulate membrane properties of cat thalamic reticular neurons. Thal Rel Syst, in press.


Haider B, Duque A, Hasenstaub AR, McCormick DA (2006) Neocortical network activity in vivo is generated through a dynamic balance of excitation and inhibition. J Neurosci 26: 4535-4545.    


Holcman D, Tsodyks M (2006) The emergence of up and down states in cortical networks. PLoS Comput Biol 2: e23.    


Kasanetz F, Riquelme LA, Murer MG (2002) Disruption of the two-state membrane potential of striatal neurones during cortical desynchronisation in anaesthetised rats. J Physiol 543: 577-589.    


Lampl I, Reichova I, Ferster D (1999) Synchronous membrane potential fluctuations in neurons of the cat visual cortex. Neuron 22: 361-374.   


Lewis BL, O'Donnell P (2000) Ventral tegmental area afferents to the prefrontal cortex maintain membrane potential 'up' states in pyramidal neurons via D(1) dopamine receptors. Cereb Cortex 10: 1168-1175.    


Mahon S, Deniau JM, Charpier S (2003) Various synaptic activities and firing patterns in cortico-striatal and striatal neurons in vivo. J Physiol Paris 97: 557-566.    


Massimini M, Huber R, Ferrarelli F, Hill S, Tononi G (2004) The sleep slow oscillation as a traveling wave. J Neurosci 24: 6862-6870.    


McCormick DA, Shu Y, Hasenstaub A, Sanchez-Vives M, Badoual M, Bal T (2003) Persistent cortical activity: mechanisms of generation and effects on neuronal excitability. Cereb Cortex 13: 1219-1231.    


Metherate R, Ashe JH (1993) Ionic flux contributions to neocortical slow waves and nucleus basalis mediated activation - whole-cell recordings in-vivo. J Neurosci 13: 5312-5323.    


Mukovski M, Chauvette S, Timofeev I, Volgushev M (2007) Detection of active and silent states in neocortical neurons from the field potential signal during slow-wave sleep. Cereb Cortex 17: 400-414.    


Peters Y, Barnhardt NE, O'Donnell P (2004) Prefrontal cortical up states are synchronized with ventral tegmental area activity. Synapse 52: 143-152.    


Petersen C, Hahn T, Mehta M, Grinvald A, Sakmann B (2003) Interaction of sensory responses with spontaneous depolarization in layer 2/3 barrel cortex. Proc Natl Acad Sci U S A 100: 13638-13643.    


Reig R, Gallego R, Nowak LG, Sanchez-Vives MV (2006) Impact of cortical network activity on short-term synaptic depression. Cereb Cortex 16: 688-695.    


Sachdev RN, Ebner FF, Wilson CJ (2004) Effect of subthreshold up and down states on the whisker-evoked response in somatosensory cortex. J Neurophysiol 92: 3511-3521.    


Sanchez-Vives MV, McCormick DA (2000) Cellular and network mechanisms of rhythmic recurrent activity in neocortex. Nat Neurosci 3: 1027-1034.    


Simon NR, Manshanden I, Lopes da Silva FH (2000) A MEG study of sleep. Brain Res 860: 64-76.    


Steriade M, Amzica F, Contreras D (1996) Synchronization of fast (30-40 Hz) spontaneous cortical rhythms during brain activation. J Neurosci 16: 392-417.    

Steriade M, Nunez A, Amzica F (1993) A novel slow (< 1 Hz) oscillation of neocortical neurons in vivo: depolarizing and hyperpolarizing components. J Neurosci 13: 3252-3265.   


Steriade M, Nunez A, Amzica F (1993) Intracellular analysis of relations between the slow (< 1 Hz) neocortical oscillation and other sleep rhythms of the electroencephalogram. J Neurosci 13: 3266-3283.     


Stern EA, Kincaid AE, Wilson CJ (1997) Spontaneous subthreshold membrane potential fluctuations and action potential variability of rat corticostriatal and striatal neurons in vivo. J Neurophysiol 77: 1697-1715.    


Timofeev I, Contreras D, Steriade M (1996) Synaptic responsiveness of cortical and thalamic neurones during various phases of slow sleep oscillation in cat. Journal of Physiology-London 494: 265-278.    


Timofeev I, Grenier F, Bazhenov M, Sejnowski TJ, Steriade M (2000) Origin of slow cortical oscillations in deafferented cortical slabs. Cereb Cortex 10: 1185-1199.    


Timofeev I, Grenier F, Steriade M (2001) Disfacilitation and active inhibition in the neocortex during the natural sleep-wake cycle: an intracellular study. Proc Natl Acad Sci U S A 98: 1924-1929.    


Tseng KY, Kasanetz F, Kargieman L, Riquelme LA, Murer MG (2001) Cortical slow oscillatory activity is reflected in the membrane potential and spike trains of striatal neurons in rats with chronic nigrostriatal lesions. J Neurosci 21: 6430-6439.   


Volgushev M, Chauvette S, Mukovski M, Timofeev I (2006) Precise long-range synchronization of activity and silence in neocortical neurons during slow-wave oscillations [corrected]. J Neurosci 26: 5665-5672.    


Wilson C, Kawaguchi Y (1996) The origins of two-state spontaneous membrane potential fluctuations of neostriatal spiny neurons. J Neurosci 16: 2397-2410.