Data was imported into Matlab (Natick, MA) for analysis. A combination of custom-written scripts and scripts provided by K. Harris (University College London, UK) were used for the analyses. Multi-taper spectrograms were calculated with a time window of 256 samples, 1024 FFTs, and a time-bandwidth product (NW) of 1.5 (2 tapers). To calculate the power envelope and phase of ongoing theta and gamma oscillations, a bandpass filter was applied using a zero-phase-delay FIR filter with Hamming window (filter0, provided by K. Harris and G. Buzsáki, New York University, USA) and the Hilbert transform of the bandpass-filtered signal. Single units were clustered using Klustakwik (by Ken Harris, http://klustakwik.sourceforge.net/), using the first three principal components. Clusters were kept for analysis if signal-to-noise ratio ≥ 3 and their isolation distance was ≥ 10 using an 8-dimensional feature space. Additional details with regard to data analysis can be found in the Supplementary Experimental Procedures.