Miniature wireless recording and stimulation system for rodent behavioural testing

Objective. Elucidation of neural activity underpinning rodent behaviour has traditionally been hampered by the use of tethered systems and human involvement. Furthermore the combination of deep-brain stimulation (DBS) and various neural recording modalities can lead to complex and time-consuming laboratory setups. For studies of this type, novel tools are required to drive forward this research. Approach. A miniature wireless system weighing 8.5 g (including battery) was developed for rodent use that combined multichannel DBS and local-field potential (LFP) recordings. Its performance was verified in a working memory task that involved 4-channel fronto-hippocampal LFP recording and bilateral constant-current fimbria-fornix DBS. The system was synchronised with video-tracking for extraction of LFP at discrete task phases, and DBS was activated intermittently at discrete phases of the task. Main results. In addition to having a fast set-up time, the system could reliably transmit continuous LFP at over 8 hours across 3–5 m distances. During the working memory task, LFP pertaining to discrete task phases was extracted and compared with well-known neural correlates of active exploratory behaviour in rodents. DBS could be wirelessly activated/deactivated at any part of the experiment during EEG recording and transmission, allowing for a seamless integration of this modality. Significance. The wireless system combines a small size with a level of robustness and versatility that can greatly simplify rodent behavioural experiments involving EEG recording and DBS. Designed for versatility and simplicity, the small size and low-cost of the system and its receiver allow for enhanced portability, fast experimental setup times, and pave the way for integration with more complex behaviour.


Introduction
Deep-brain stimulation (DBS) research has much to gain from the inclusion of EEG recordings, as it helps to explain some of the underlying neuromodulatory mechanisms that take place. However combining these two modalities is a challenge in animal behavioural experiments, because of limitations in the currently available equipment. Numerous studies that have involved both DBS and EEG recordings typically rely on the use of a cable tether to provide these functions, which connects the recording/stimulation equipment to a surgically implanted headstage device. This may be problematic since behavioural experiments in rodents necessitate mobility and freedom of movement-often across various arena types and distances. Recording arenas typically have to be individually designed to accommodate a cable tether, which may include the use of commutators to help to prevent the cable from tangling due to rotations in the animal's body. This places a practical limit on portability, as each arena may utilize a different tethered recording setup. Further issues inherent with such a cable tether include the 50 Hz mains noise and movement-related artefacts; both of which can be exacerbated by the use of a tether. During recording, the animal can pull or chew on the cable tether, and also it can act as a visual distraction. Finally, a cable tether is known to be a source of stress for rodents which may modify physiological parameters (Tang et al 2004).
Given the issues present in tethered recording/stimulation systems, an ideal solution is to utilize a wireless system that is carried by the rodent. Such systems can circumvent many of these problems, as well as opening up new experimental possibilities, e.g. recording inside a 3D maze . Given a sufficient transmission range of the wireless system, it can be more practical for recording in large arenas, rather than to utilize a tethered solution to cover the same distance. To date a large number of portable systems have been described for the purposes of neural signal recording or DBS in a variety of animals. Wireless neural signal recorders have been designed for large animals such as cats (Sherk and Wilkinson 2008) and monkeys (Obeid et al 2004, Mavoori et al 2005, and are typically larger in size (>50 g) with a higher number of channels and more elaborate filtering stages than that of smaller systems designed for e.g. mice and rodents. Small systems (<0.5 g) on the other hand, have been designed for insects such as moths (Ando et al 2002), locusts (Fischer et al 1996) and cockroaches (Takeuchi and Shimoyama 2004), and feature comparatively basic signal amplification/filtering, and analogue transmission. Given that the species of animal dictates the maximum system size (that can be carried), a system designed for rats may be subject to various design compromises that balance the battery life, transmission type and range, number of channels, quality of filtering, as well as a myriad of additional features that determine the overall system functionality. This has given rise to a large number of systems with widely varying attributes. For instance, a relatively small one-channel implantable system (4 g with batteries) was designed for use with rats that features a 14 h battery life, and the ability to power down during inactivity for chronic use (Lapray et al 2008). A more complex 16-channel system on the other hand features Bluetooth transmission with a long transmission range (>30 m), as well as in-built signal processing functionality (Hampson et al 2009); although this weighs 60.3 g (including battery) and is distributed across both a headstage and a backpack.
Numerous prototype systems developed for rats are made up of a separate headstage/backpack combination, where the headstage contains pre-amplification and signal buffer circuitry, and the backpack (attached to a rodent Velcro jacket) contains the main electronics and transmission circuitry e.g. (Hawley et al 2002, Xu et al 2004, Ye et al 2008, Hampson et al 2009. Alternatively, systems have been designed to be completely attached entirely to the head of the animal (e.g. Fan et al 2011). By necessity these headmount systems are smaller than those which can be carried on the back of rats, although they do not require the rodents to be habituated to a Velcro jacket; which can hinder mobility, increase stress, and require additional habituation. Furthermore, head-mounted systems can reduce the possibility of noise that may otherwise be picked up by a headstagebackpack cable, as its analogue circuitry is for signal conditioning is placed in a closer proximity to the recording electrodes. Generally speaking a head-mounted systems are more practical and have potentially faster set-up times, and it is of note that the majority of commercially-produced wireless systems use this configuration (e.g. Triangle Biosystems, Pinnacle Technology, Multichannel Systems).
Although there have been a large number of independently-developed systems for the purpose of neural recording or stimulation, there have been relatively few which combine these functions. In rats, several such systems have been designed (Ativanichayaphong et al 2008, Ye et al 2008, Zuo et al 2012. Typically these systems are either too large or feature too few recording/stimulus channels to be of practical use in a multichannel recording/stimulation paradigm using freely-moving rodents. For instance, these back-mounted systems weigh between 20 and 43 g, feature 1 or 2 recording/ stimulation channels; whereby only one of which offers constant current stimulation (at up to 120 μA; Ye et al 2008), as opposed to constant-voltage stimulation. The benefits of constant-current stimulation includes a stabilization of DBS intensity parameters, resulting in a finer control over the generated electrical field in the brain, and fewer side-effects (Cheung and Tagliati 2010).
Here, a low-cost miniature wireless system is presented that is capable of multichannel local-field potential (LFP) recording and two-channel DBS. This system has a number of advantages over the currently available alternative systems. Not only is it smaller than the currently available alternatives (at 8.5 g including battery), but it also utilizes bilateral, constant-current DBS with a range of wirelessly-adjustable stimulus parameters to suit numerous paradigms. Furthermore, the digital transmission type is robust enough to allow for reliable transmission in noisy laboratory environments, and the system may be configured for rapid use in multiple types of behavioural arena types. In addition to its simplicity and portability, the system may be reprogrammed to adapt to particular experimental setups, thus enhancing its versatility. The capabilities of the wireless system were verified in a behavioural task that combined prefronto-hippocampal LFP recordings with bilateral DBS of the fimbria-fornix. For this experiment, the base programming of the system and its receiver were adapted to simplify the execution of the task, by providing visual warning cues related to experiment timing, and also by generating signals for synchronization of LFP with video tracking data.

System overview
A wireless system module and a receiver were designed to provide the functions of wireless multichannel LFP recording and DBS in freely-moving animals. The wireless module weighs 8.5 g (including a CR1/3N battery), and during use is secured into a surgically implanted ten-pin headstage connector on the head of the rat (figure 1(a)). The wireless module acquires and transmits four-channels of LFP (500 Hz sample rate; 16-bit resolution) through a bi-directional digital transmission link with the receiver module. LFP data is subsequently forwarded to the computer through a serial port, where it is displayed in real-time (figure 1(b)) using in-house developed software (WinEDR; J Dempster, Strathclyde University). A system control module in this software allows the user to activate/deactivate DBS, change the DBS pulse-width and frequency, reset the system, put it into a low-power state (which deactivates EEG recording), and subsequently put the system back into active operation (figure 1(c)). The wireless module is capable of generating two channels of monophasic constant-current stimulus pulses, and its constant-current intensity can be altered by turning a small screw built onto the side of the device, with the assistance of an oscilloscope (TDS 3032B; Tektronix) and a resistor. Rats were able to move freely using the wireless module, whilst displaying all normal behaviours including running, jumping and grooming.
The wireless module can be considered as three hardware sub-modules connected to a central control hub (figure 2). The central control hub in this case is the microcontroller (MCU; MSP430f2013; Texas Instruments), and the three submodules are: EEG recording circuitry, DBS circuitry, and transceiver module (TRX; DSQFM-TRX-2; Quasar UK). The programmable MCU controls and coordinates the exchange of information between the three sub-modules; using the transceiver as a means of communicating with the receiver module. The receiver contains the same combination of MCU and transceiver, which again acts as the control hub and communications exchange, respectively. The receiver features RS232 circuitry necessary to send and receive communications from a computer via its serial port, and also a separate MCU which acts as a buffer for storing wireless-module commands from the computer until they are ready to be transmitted. A summary of the system design characteristics are shown in table 1.

Wireless module design
2.2.1. Wireless module software. Upon switching the system on, the MCU initializes its ports/peripherals and the TRX, and enters a timed control-loop, which consists of sampling and transmitting EEG on all channels (figure 3(b)). A receiver buffer is checked every cycle for incoming commands, which are checked for validity then executed. A sleep-mode command results in the MCU powering down and waking for approximately 4.4 mS every second to detect a possible wake-up command. DBS pulses (if active) remain active during sleep-mode, for an improved battery life. Finally, a reset command results in the DBS parameters reverting to their default pre-programmed values.
The device may be reprogrammed through its four-pin battery connector, for altering many of the default (power-on) settings such as operating mode or DBS parameters. The transceiver can be programmed to multiple channels to allow several wireless modules to work simultaneously (one per receiver module). Additional functions may be programmed into the system for experiment-specific functions, e.g. activating DBS for a finite period of time, or generating signals for synchronization with video-tracking data (see 2.6: Experiment).
2.2.2. Wireless system hardware. A block diagram for the wireless module is shown in figure 3(a). Each input electrode is coupled to an instrumentation amplifier (INA2126; Texas Instruments) which provides input buffering and preamplification with a gain of 10. A 10 μF capacitor and 47 KΩ resistor on the input provides dc decoupling from the LFP signals and a dc return path for the input amplifiers, respectively; and collectively form a 0.34 Hz high-pass filter. Signals are further amplified by 52 times (AD8609; Analog Devices), band-pass filtered between 1.5 and 100 Hz, and are passed through a high-speed multiplexer (AD604; Analog Devices), which is controlled directly by the MCU. The MCU samples incoming multiplexed LFP with its in-built analoguedigital converter (ADC) at 500 Hz, with a resolution of 16bits and an input range of ±600 mV. A charge-pump (TPS60400; Texas Instruments) is used to provide a negative battery supply voltage for all of the EEG signalconditioning integrated circuits.
The DBS circuitry consists of a dc voltage amplifier, constant current generators, and a virtual ground generator. The pattern of DBS pulses is generated entirely by the MCU, based on either its pre-programmed default setting, or a command that has been wirelessly received. The DBS pulsepattern passes through one of the MCU's standard output ports, which in turn drives a transistor switch and gates the flow of constant current. The design of the constant-current generator was adapted from a previous two-channel portable DBS device developed in-house (see Ewing et al 2013). The current flow is held constant by a pnp-pnp transistor pair configured as a constant current source, and its magnitude is set by configuring a variable resistor. This has a base value of 50 KΩ, which when varied can alter the current intensity from 30 μA to over 1.5 mA. However in practice the maximum Figure 1. During use the wireless module is attached to a surgicallyimplanted headstage on the head of the rat (a). The system facilitates a bi-directional communication with the receiver module, which allows it to transmit four-channels of LFP into WinEDR, and be configured using the DBS control module (b). WinEDR was developed in-house (J Dempster, Strathclyde University).
voltage available for this is 18 V, which limits the actual current based on the impedance between the DBS electrode terminals depending on the electrode geometry. The maximum voltage provided for this is set by the dc voltage amplifier, which amplifies the system voltage by six times (meaning a 2.5-3 V battery level is amplified to 15-18 V). The voltage amplifier consists of two voltage doublers (MAX1682; Maxim Integrated Products) connected in series; the second of which is configured to triple the voltage by inclusion of a Schottky diode-capacitor rectifier. Finally a virtual ground was inserted as the reference for each DBS electrode contact to isolate DBS ground from the recording circuitry ground. This was done by placing two miniature operational amplifiers (OPA347; Texas Instruments), in a unity gain configuration.
The wireless module consists of two separate PCB's sandwiched together; the transceiver module, and the rest of the system circuitry which is housed on the main board. The main board was designed as a 21×16×1.6 mm four-layer PCB using Eagle (CadSoft) and fabricated by PCB-Pool, and features surface-mount components distributed on both sides.
Each layer consists of a ground plane which fills all of the spaces between the circuit tracks, pads and vias. PCB tracks for the power-line (Vdd) and DBS circuitry are 150 μm in width, whilst all other tracks are 125 μm. Power-line tracks are arranged in a 'star' pattern to minimize parasitic currents flowing between devices. The ground planes of the analogue circuitry are physically separated from the digital circuitry ground planes, with two vias in an inside layer connecting them to the main system ground. All integrated circuits have power supply decoupling capacitors placed in close proximity to their power pins (Vdd or Vss); 10 μF is used for the main power-line decoupling, and 1 μF is used for each individual IC.
2.2.3. Transmission of data. The transceiver module (TRX; DSQFM-TRX-2; Quasar UK) coordinates transmission/ reception functions in both the wireless and receiver modules. Based on the CC2500 chipset (Texas Instruments), the module enables a two-way communication link with the controlling MCUs. In the wireless module, it can be instructed to power down to a 'Wake-on-Radio' mode, whereby it activates for approximately 4.4 mS every second to detect a possible 'wake' command from the receiver. This way the wireless module can be powered down during periods of inactivity, which extends the system battery life.
The transceiver operated at 2.4 GHz minimum-shiftkeying (MSK; see also CC2500 datasheet; Texas Instruments, 2010). Packets transmitted from the wireless system (figure 3(c)) consisted of: an 8-byte preamble, 2-byte synchronization code, 1-byte address, 12-byte payload, and an optional 2-byte cyclic redundancy code. The 12-byte payload from the wireless-module consists of 16-bit EEG from each of the four channels, as well as channel identifier and DBS status bits. All packets undergo a signal whitening procedure using a pseudorandom PN9 sequence, which has the effect of distributing the signal's output power over its transmission bandwidth-thereby improving transmission performance.

Receiver design
The receiver is made up of two MCU's (MSP430f2013; Texas Instruments), one transceiver module (TRX; DSQFM-TRX-2; Quasar UK), and an RS232 interface for communicating with a computer through its serial port. The main MCU handles bi-directional communication between the computer and transceiver by sending sampled LFP information in one direction, and commands for the wireless module in the opposite direction. A second MCU was included to act as a storage buffer for commands received from the computer (see figure 2). Commands for resetting/activating the wireless module are transmitted 3000 times over approximately 1 s, because when the wireless module is powered down, its transceiver module is only active for 4.4 mS every second.
The receiver features an on-board switch which can be programmed to switch between two wireless system transmission channels. Communication between the main MCU and transceiver module is based on a high-speed SPI link, whereas communication between the individual MCU's and the . By default the system samples and transmits EEG, whilst checking for incoming commands for altering its parameters and operating modes. Structure of a data packet sent wirelessly from the transceiver module is also shown (c); adapted from CC2500 datasheet (Texas Instruments, 2010).
RS232 interface is based on an 8-N-1 UART transmission protocol, at 115.2 Kbaud. The receiver features three programmable LEDs, which can be set to facilitate a synchronization between LFP and video-tracking data. The receiver components are distributed onto both sides of a two-layer PCB designed in Eagle (Cadsoft) and manufactured by PCB-Pool, and measures approximately 50×36×1 mm. The top layer houses the transceiver module, battery holder, DPDT switch, LED's (with resistors), and the nine-pin D-SUB connector for connecting to the serial port. The bottom side houses the main and buffer MCU's, the RS232-transceiver (with loading capacitors), and powersupply decoupling capacitors.

System assembly
The external connectors on the wireless systems consist of a ten-pin headstage connector, and a four-pin battery/programming connector. Standard gold plated DIP contacts (Assmann Electronics; RS Components) were cut into rows of four, and five pins, with the male ends crimped using a pair of pliers. 30 mm stripped copper wires were soldered to each of these contacts, and connected to the relevant external connections provided on the wireless module's PCB. In this case two rows of five pins were used to form the ten-pin headstage on both systems. A miniature SPDT switch (Multicomp; Farnell) was connected in-between the system's ground connector and the negative battery terminal, which formed the on/off switch. All of the system's components were affixed into place using Araldite (Farnell), a two-part clear epoxy adhesive. Care was taken not to place excess glue on either side of the PCB antenna on the transceiver module, as this could attenuate the transmission range. With the glue settled, an M2 nylon nut (Duratool; Farnell) was attached to the front of the headstage connector using high-viscosity superglue (Bondloc; Maplin) with bicarbonate of soda sprinkled onto it, creating a hardened connection.

Headstage
The headstage is a ten-pin connector that interfaces between the implanted EEG/DBS/reference electrodes, and the wireless module which is plugged in during use (figure 4).
For each headstage, two rows of five gold-plated DIP pin sockets (Assmann Electronics; RS Components) were attached on all sides to small pieces of plastic using Araldite (Farnell). The plastic in this case was from a standard polypropylene video-game/DVD jewel case-chosen for its combination of weight, rigidity and ability to be easily cut. One side was shaped to accommodate an M2 nylon nut (Duratooll; Farnell), which matched that placed on the wireless systems. This latter piece was attached whilst the partially-completed headstage was connected to the wireless system, to ensure that the M2 nuts on the system and headstage lined up. Once the glue had dried, the plastic sides of the headstage (including the front of the M2 nut) were smeared with dental cement to reinforce its stability prior to implantation. When the system was attached to the headstage, an M2 nylon screw (Duratool; Farnell) secured them into place. Headstage implants were sterilized by immersing them into 70% ethanol.
2.6. Experiment 2.6.1. Surgery and recovery. All procedures were carried out in accordance with the Animals Scientific Procedures Act (1986). Male Lister Hooded rats weighing between 350 and 375 g were anaesthetised in a clear acrylic anaesthesia chamber, using a mixture of oxygen (0.3 l min − ¹), nitrous oxide (0.7 l min − ¹), and isoflurane (Isoflo®; Abbott Animal Health) set to a level of 5%, which was lowered through the subsequent surgery steps as appropriate; first to 3%, then to 1.5%. Animal reflexes were checked throughout the surgery. The area on the scalp between the eyes to the back of the neck was shaved, and the animal was transferred to the stereotaxic frame using atraumatic ear bars (David Kopf Instruments). Animals were then given a subcutaneous injection of Rimadyl™ (Pfizer) administered at (1 ml kg − ¹), and placed on a heating pad to maintain core body temperature. The scalp was rubbed with an iodine-soaked cotton swab which removed loose hairs and cleaned the incision site. A single rostral-caudal incision was made from between the eyes to the back of the ears using a sterile scalpel blade, and the underlying skin was drawn back using forceps clamped to the underlying muscle. Connective tissue was pushed aside using sterile cotton buds, and the skull height was adjusted such that Bregma and Lambda were at the same height.
Holes were drilled for the placement of anchor screws (figure 5); 4 with a 2 mm shaft diameter (Royem Scientific Limited), and 2 with a 1.2 mm shaft diameter (Plastics One). All electrode positions were measured relative to Bregma (Paxinos and Watson 2007). Two pairs of 230 μm diameter teflon-coated stainless-steel wires were implanted bilaterally in the medial prefrontal cortex (mPFC; +3.2 mm AP, ±0.8 mm ML, −3.5 mm DV), and dCA1 region of the hippocampus (−3.6 mm AP, ±2.2 mm ML, −2.5 mm DV). A pair two-contact concentric DBS electrodes were implanted in the fimbria-fornix (FF; −1.6 mm AP, ±1.5 mm ML, −5.2 mm DV), which were made from an outer 28-gauge stainless-steel cannula (Plastics One) coated in polyolefin heat-shrink (Smallparts USA) which formed one contact, and During use the wireless system plugs into the headstage, and is secured into place using a nylon screw.
an inner 180 μm diameter teflon-coated tungsten wire (A-M Systems, Inc.) which formed the second contact. An additional anchor screw was placed above the cerebellum (−10.2 mm AP, 0.0 mm ML), and served as the reference/ground electrode for recording. All electrodes were connected to DIP pins via short connecting wires, and were subsequently routed to the appropriate connections on the head-stage implant once all electrodes had been implanted. The headstage and electrodes  The camera's field of view was set to cover the receiver, and the central-arm of the T-maze, with its four tracking points highlighted in yellow boxes. The raw LFP trace shown in (b) depicts the 3 s visual warning waveform, followed by the 0.35 s synchronization pulse, and the subsequent LFP recording for the animal which has just been placed into the central arm of the maze. The tracking positions of the LED flash, along with the tracking data covering three parts of the T-maze central arm are also shown on the LFP trace. The sequence of events for each behavioural session is shown in (c), with the baseline recording immediately preceding each of the ten trials (probe sessions only). Each trial consisted of inter-/intra-trial delay periods (PEN), with T-maze segments (TM) in between these delays. Stimulation was delivered during the intra-trial delay periods (stim). Note that forcedturn and choice-turn segments are marked as 'ft', and 'ct', respectively. were secured in place using a low viscosity dental cement (made by mixing Simplex Rapid™ powder and liquid; Kemdent), which was layered around the implant.
Following implantation animals were removed from the stereotaxic frame, and given 2.5 ml intra-peritoneal injection of Hartmann's Solution (TPS Healthcare). Animals were then placed belly-down into a heated recovery cage, which consisted of a paper lining and watered down food, and were given at least a week to recover prior to recordings. During this period, they were weighed daily and checked carefully for any post-operative complications.
2.6.2. Working memory experiment. The system's ability to record and stimulate was investigated in a working memory task, which involved multichannel LFP recording and bilateral DBS; the latter of which was applied during discrete task phases. The experimental apparatus consisted of the wireless module and receiver, a controlling laptop, a 170×130 cm T-maze constructed of PVC, a transparent cylindrical holding pen (25 cm diameter, 38 cm height), and an overhead camera (Sanyo) for recording rat behaviour (figure 6(a)).
Following the surgery recovery period, Rats (n=4) were given between 15 and 20 g of food daily in order to achieve a 15% weight reduction as predicted through standard growth curves. Rats underwent 3 d of habituation inside the T-maze and holding pen, to acclimatize them to the test apparatus and the wireless system. Rats then underwent daily training sessions in a non-match to sample task inside the T-maze. Sessions consisted of ten trials, each made up of a forced and choice phase. In the forced phase, rats were directed into one of the goal arms in order to receive a food reward. In the choice phase, both goal arms were open and the rat had to choose the opposite arm (from the forced phase) in order to receive a second food reward (see figure 6(c)). The delay between the forced/choice phases was 30 s (intra-trial delay), and the delay between individual trials (inter-trial delay) was 45 s. Rats were given DBS during the 30 s intratrial delay (monophasic; 130 Hz, 90 μS/phase, 30 μA), which was activated wirelessly through WinEDR as soon as the rat was returned to holding pen. Following a criterion performance of 7/10 correct choices over three consecutive days, animals subsequently underwent two daily probe sessions, which each included an initial 15 min pre-test baseline recording.
2.6.3. Synchronization of LFP with video data. Throughout the experiment, video-tracking was carried out using Ethovision XT (Nodulus Information Technologies) to identify when the rat had reached different locations inside the T-maze (see figure 6(a)). Control of the wireless system was restricted to the 'DBS ON' and 'DBS OFF' commands, whose functionality were expanded to (a) activate DBS for exactly 30 s, (b) control the timing of the delay period, and (c) synchronize the LFP and video-tracking data at the beginning of a maze run. Whenever the rat was placed into the holding pen after reaching one of the goal arms, either 'DBS ON' or 'DBS OFF' was pressed in WinEDR depending on whether the rat had finished a forced-or choice-run, respectively. This action initialized a delay timer on the wireless system relating to either the intra-trial period (if DBS ON was pressed) or inter-trial period (if DBS OFF was pressed). In addition, pressing 'DBS ON' activated DBS for 30 s. Three seconds prior to the end of each delay, the real-time LFP recording trace was replaced with a 3 s visual warning waveform, indicating to the operator that the rat had to be picked up and placed into the T-maze ( figure 6(b)). Following this three second waveform, a 0.35 s 'SYNC' pulse signal (a −600 mV, 0.35 s deflection in the LFP) was transmitted in the recorded LFP signal. The receiver was programmed to flash its LED upon receiving this synchronization pulse waveform, which was subsequently logged in time with the video-tracking system. Thus the LFP and video-tracking data were synchronized at the beginning of each maze run, which produced 20 synchronizations per session.
2.6.4. Analysis of results/statistics. Multi-taper powerspectral density (PSD) was calculated using Matlab libraries provided by Chronux (http://chronux.org). This involved three orthogonal leading data tapers for reducing 'windowing' artefacts (see Thomson 1982), and a 4 s sliding window, with 1 s overlap. T-maze central arm recordings were each extracted as 1 s waveforms up until the rat leaves the choice point and enters one of the goal arms. PSD was normalized by dividing by the rms value which was obtained in the baseline recording prior to testing. Data was combined and averaged, and separated into the different task phases: baseline, intertrial and intra-trial delay periods, and T-maze central arm. Changes in PSD between the task phases and baseline was obtained by dividing the spectral content of each task phase by that obtained during the baseline performance. T-tests were used to assess differences in peak theta/gamma activity between baseline and each of the task phases.

System bench tests
3.1.1. Battery life measurements. Using a CR1/3N lithiumion button-cell battery, the system was able to provide almost 8 h of constant EEG recording transmission, and over 50 h of constant DBS (figure 7) with the recording/transmission circuitry powered down (sleep-mode DBS). DBS was carried out using the following parameters: 130 Hz, 100 μA, 200 μS through a 33 KΩ resistor.

Basic noise test.
A basic test was carried out on the EEG-DBS system to characterise its amplification and noise properties. A 10 Hz sine-wave of varying magnitude was injected into three of the four system channels using a digital function generator (USB X Series; National Instruments) and a ÷940 voltage divider, with one channel left unconnected/ floating. This was repeated four times such that each channel was recorded floating, whilst the other three recorded the sinewaves ( figure 8(a)). In this case the input signal amplitude Figure 7. Graphs showing the measured system voltages in the EEG recording, DBS, and EEG+DBS operating modes, using a CR1/3N lithium ion battery. Figure 8. 10 Hz input sine waves were increased in magnitude from 27 μV to 1.06 mV (peak-peak), with one channel left unconnected/ floating for each test (a). The recorded output signal for a 27 μV input was decomposed into its clean and noisy variants using wavelet analysis (b). The voltage output (c) and calculated signal-noise ratio (d) are shown as a function of the input signal amplitude. ranged from 0.027 to 1.06 mV. The EEG-DBS system and the function generator outputs were wrapped in foil to minimize the effects of noise, and recordings were made in WinEDR (J Dempster, Strathclyde University).
Recorded signals were exported to Matlab (Mathworks) where they were extracted into their signal and noise components, using a custom-written de-noise algorithm which uses wavelet analysis ( figure 8(b)). The peak-peak voltages of the signal and noise were calculated using a custom-written script, and plotted as a function of the input signal amplitude (figure 8(c)). The signal to noise ratio was calculated as a ratio between the powers of the signal against the power of the noise component, and expressed in decibels plotted as a function of the input signal amplitude ( figure 8(d)).
3.1.3. DBS pulses in saline. The system's ability to generate DBS pulses was tested by immersing a two-contact stainlesssteel/tungsten stimulating electrode into 0.9% NaCl solution, and delivering pulses of varying amplitudes (100 Hz, 100 μS, monophasic). A digital oscilloscope (TDS 3032B; Tektronix) was used to measure the voltage across the electrode contacts. The system was seen to be capable of generating a range of constant current pulses, up to the value of 1.5 mA (figures 9(a)-(c)). Under a constant current pulse, the electrode in NaCl was seen to rapidly polarize as indicated by the rapid rise time. When the constant current pulse had finished, the voltage waveform indicated a discharge featuring an initial fast phase, followed by a slow phase. The highest current of 1.5 mA was indirectly observed by placing a 10 Ω resistor in series with the electrode/saline, and measuring the voltage drop across it (figure 9(d)). As shown, this had produced a 15 mV potential across this resistor, confirming the presence of a stable, flat profile of the constant-current pulse.

System performance in vivo
The combined weight of the system and its battery is 8.5 g, and it was able to be attached and secured into place in less than 2 min The rat was able to carry out a range of normal behaviours, including grooming, exploring and running at full speed through the T-maze. The wireless module transmitted a continuous stream of LFP reliably within 3 m of the receiver module, and the experimenter was able to wirelessly activate/ deactivate and configure bilateral DBS in real-time. Representative raw LFP recordings from the mPFC and dCA1 brain regions are shown (figures 10(a) and (b)). Notably, no movement-related artefacts were observed when the rat was running at full-speed through the maze, as compared when the rat was stationary. Furthermore 50 Hz mains interference-a common problem with tethered recording systems-was not visible in any of the wireless recordings made. In the experiment described, the system was programmed to automatically deactivate DBS after 30 s, as well as transmitting a warning/synchronization waveform on the LFP trace ( figure 10(c)). These measures helped to simplify the execution of the experiment whilst increasing the timing precision; as opposed to previous (unpublished) pilot studies in which the experiment timing was performed with the use of a stopwatch. Whilst the wireless system was capable of simultaneous recording and stimulation, the activation of DBS resulted in prominent stimulus artefacts on the raw LFP trace; consisting of both harmonic repetitions of the stimulus frequency, and aliasing artefacts ( figure 11(b)). However, when a relatively lower-intensity DBS signal was used (100 Hz, 25 μS, 20 μA), the LFP signal could be recovered when filtering below 80 Hz. Notably, the higher-intensity stimulus parameters resulted in a greater negative overall deflection on the LFP trace, which settles after approximately 0.25 s (corresponding to >30 stimulus pulses).

Recordings of LFP at different phases of the working memory task
Spectrograms are shown for the mPFC and dCA1 LFP brain regions during each of the task phases, alongside the percentage change in PSD of each task phase versus baseline ( figure 12). Notable changes at the T-maze choice-point (relative to baseline) include an enhanced gamma-frequency activity in the mPFC (p=0.0023), enhanced dCA1 thetafrequency activity (p=0.0027), and an enhanced theta-frequency coherence between these regions (p=0.008). Stimulation was successfully activated wirelessly during the intra-trial delay periods of the task, although the accompanying artefacts can clearly be seen on the spectrograms during the intra-trial delay periods.

Discussion
This study has outlined the design and development of a miniature wireless device capable of performing multichannel LFP recording and DBS in freely-moving rodents. Weighing less than 8.5 g (including the battery), the device is small enough to be easily carried on the head of rodents; who were able to carry out all normal behaviours including running, jumping and grooming. This system has been shown to successfully record multichannel LFP and provide bilateral DBS, whilst maintaining a good signal quality that is free from and 50 Hz mains noise, and performs well even when the rat is running at full speed. The system is simple enough to be rapidly changed between animals (<5 min), and is portable Figure 10. Raw LFP as recorded in the T-maze task are shown for both the mPFC (a) and dCA1 (b) brain regions. The raw LFP waveform in (c) depicts two trials in the working memory task. The arrows point to wireless activation of either 30 s of DBS (intra-trial delay) or a 45 s timer (inter-trial delay); either of which were activated as soon as animals were returned to the holding pen. In both cases the delay period ended with an automatically generated 3 s warning waveform followed by an LFP-video synchronization pulse. enough to be used in multiple recording arenas within a single behavioural session. Designed for versatility, the system's operating modes (sleep/DBS/EEG recording) and DBS parameters could be wirelessly altered in real time, without the need for manually removing or handling the system. This allows for convenient execution of various types of behavioural experiments, as DBS can be activated instantly at any point from a remote location. Furthermore, the system could be reprogrammed through its four-pin battery connector to enable it to integrate better with a particular experimental design, as has been described in the T-maze task detailed herein. Using off-the-shelf components and a rapid PCB prototyping service (PCB-Pool), this system is an inexpensive alternative to commercially-sold wireless systems, which is able to expand the range of measurements in DBS-related behavioural paradigms.
Whilst there have been several other devices capable of performing DBS and EEG recording (e.g. Ativanichayaphong et al 2008, Ye et al 2008, Zuo et al 2012, this system is (to the author's knowledge) the smallest combined multichannel recording/stimulation system for small animals. Furthermore unlike many of the previously described devices, its ability to deliver twochannels of constant-current stimulation in real-time allows not only a more convenient comparison with much of the previously published DBS research, but also facilitates a high-degree of control and versatility in an experimental paradigm. Finally, its unique ability to be adapted to the execution of an experiment (via reprogramming) can help it to integrate with numerous different experimental designs. Ultimately the design and execution of the T-maze task described herein was only made possible by the small size and functionality provided by this system. The battery life of 6-8 h for recording (using a CR1/3N lithium-ion battery) is adequate enough to cover a myriad of experimental possibilities, and can be extended to >50 h for Figure 11. DBS could be activated in real time at any part of the experiment, as shown using low-intensity (100 Hz, 25 μS, 20 μA; (a)) and high-intensity parameters (130 Hz, 90 μS, 100 μA; (b)). The left panel depicts the activation of DBS on the raw waveform in the mPFC, whereas the right panel shows the corresponding frequency spectra of both the raw signal (black) and with stimulation (grey). For lowintensity DBS parameters, the LFP could be recovered when filtering below 80 Hz, as depicted in the raw time series in ((c); black LFP trace).
DBS-only applications. The CR1/3N battery was used in this case because of its unique ability to deliver high currents for its small size. The wireless system can be powered down during periods of inactivity to greatly extend the system battery life. There exists the possibility of using alternative batteries, such as miniature silver-oxide batteries for an ultralight system, or perhaps large rechargeable batteries which can be mounted on the back of the animal, for extended recording sessions. For example, a 20 g 3.7 V 1120 mAh lithium-ion rechargeable battery pack (CA5L; Energizer), would theoretically provide over 50 h of constant EEG recording (based on the system average current consumption of 20 mA), and over a week for DBS (with typically used parameters). The left panel depicts PSD spectrograms in the mPFC (a) and dCA1 (b) brain regions, along with a coherogram representing mPFC-dCA1 coherence (c). These are shown for the following task phases: pre-task baseline recording, inter-trial delay (Inter-D), intra-trial delay (Intra-D), and T-maze choice point (TM); with the latter three being grouped together in the spectrogram. Note that the T-maze spectrogram has been stretched by ×5 for a convenient visual comparison. The right panel shows the percentage change between the baseline recordings and those made during the inter-trial delays (blue curves), and at the T-maze choice-point (green curves); ±½ SEM. Stimulus artefacts during the intra-trial delay prevented their use in the subsequent comparison. Notable features include an increased theta and gamma power inside the T-maze, as well as an increased theta-frequency coherence between the two brain regions.
The wireless module can be configured to produce a wide range of stimulus pulse-widths (10 μS-500 mS) and frequencies (0.1 Hz-5 KHz), which are appropriate for the vast majority of commonly used settings in research applications. The voltage available for stimulation varied between 15 and 18 V, depending on the exact battery voltage (which typically reduced throughout its lifespan), and is suitable for use in delivering high currents through commonly used electrode geometries at a wide range of electrode/tissue impedances. In the bench tests carried out in saline, high-frequency DBS at 1.5 mA required only 9 V, when delivered through tungsten/ stainless steel concentric electrodes. As shown in vivo, the wireless system was fully capable of simultaneous LFP recording and DBS. In practice, the potential to recover the signal through low-pass filtering was seen to depend (at least in part) on the amount of charge delivered to the animal. Notably the higher-intensity DBS parameters had resulted in a comparatively greater negative deflection on the LFP trace; which is likely due to a summation of charge from repeated Faradic reactions over the stimulus period (Merrill et al 2005). In spite of this, there exists numerous techniques for negating stimulus artefact. For instance, Sun et al (2014) describe a technique for negating stimulus artefacts by applying matched filters to the raw signal, based on the modelled DBS frequency spectra.
By correlating LFP with video-tracking data, specific LFP segments from a behavioural task could be separated and analysed during post-processing. In the behavioural task carried out, the waveforms recovered coincide with wellknown correlates of rat behaviour. For example, theta-frequency PSD was seen to profoundly increase for rats inside the T-maze, and is known to be present in theta during locomotion, spatial exploration and various learning-related behaviours (Green andArduini 1954, Vanderwolf 1969); all behaviours which the T-maze environment was expected to reveal. Similarly, the elevated gamma frequency PSD has been associated with sensory binding (Singer and Gray 1995), selective attention (Jensen et al 2007), and more recently has been observed to be prevalent during working memory (Howard et al 2003, Jensen et al 2007, van Vugt et al 2010. Finally, the coherence increases at the choice point reflect functional interactions between hippocampal theta waves with those in the mPFC, and have previously been correlated with working memory performance in both rats (

Limitations
A number of design compromises had to be made to guarantee the small size of this device. For instance, the MCU was chosen for its small size and low power. Whilst adequate for this system, a more powerful MCU with additional input/ output pins could allow for additional DBS channels, a digital power switch for deactivating much of the circuitry during sleep mode, as well as more comprehensive pulse types such as charge-balanced biphasic. This pulse type in particular has the potential to reverse the charge build-up that occurs in the brain (Merrill et al 2005), which can potentially lead to improvements in simultaneous LFP-DBS recording quality.
The wireless module was deliberately configured to sample at 500 Hz in the interests of capturing LFP signals. However higher-frequency brain signals such as spikes or action potentials require much higher sampling rates. The ADC voltage and temporal resolution was largely limited by the data-rate of the system. Whilst a sample rate of several KHz is compatible with many of the components used in the EEG-DBS system, two crucial changes would have to be made to facilitate it. First, the MCU would have to change to a version with a higher-speed ADC. At present the ADC used in the current design trades temporal resolution for 16-bit samples, although many MCU's in the MSP430 range have faster 12-bit ADC's; Texas Instruments. Second, the receivercomputer communication would have to change from serial transmission to USB transmission. Serial transmission was used for its simplicity with regards to the programming and circuitry involved, and crucially, it was adequate for the transmission of four-channel, 16-bit data at 500 Hz along with commands. However this transmission format approached the limit of its 115.2 Kbaud maximum data-rate, meaning that more channels and/or a higher sampling rate would require the receiver to be converted to USB communication, which offers speeds of over 5000 Mbaud.
Given the rapid advancement of off-the-shelf components, more efficient components than those used in this design are expected to appear within a short time of this being developed. Alternate technologies such as field-programmable gate array chips may offer an avenue for further space and/or power reductions than that seen in the current system, paving the way for smaller systems that are suitable for e.g. mice. Finally, 3D printing can be utilized for rapidly and conveniently developing custom headstage sockets, as opposed to the manual technique carried out in this study.

Conclusion
This study has outlined the design and verification of a miniature wireless system capable of recording multichannel LFP signals and performing bilateral DBS in freely-moving rodents. Weighing less than 8.5 g (including battery), the system is smaller and lighter than any other system of its type, and has been designed for rapid implementation in behavioural experiments. The system can be controlled wirelessly in real-time, including the ability to activate/deactivate DBS as well as change the system's operating mode or DBS parameters. The performance of the system was verified in a behavioural task that involves DBS, LFP recording and video-tracking in freely-moving rodents in a working memory task. Taken together, the combination of small size and enhanced functionality provided by this system can lead to more robust and versatile behavioural experiments involving DBS and EEG recording, whilst paving the way for integration with more complex behaviours.