Unless otherwise specified, all data processing and analysis was performed using MATLAB (MathWorks).

On the two-chambers sessions with playback, bat social calls were played using ultrasound speakers (Vifa, Avisoft Bioacoustics; frequency range: 1-120 kHz). The contents of the playback were identical for the two chambers and were delivered simultaneously to both. On each playback session, a set of different calls were played. The number of different calls used for a given session ranged from 47 to 744. Calls were played for the entire duration of the sessions, with uniformly distributed inter-call intervals. The uniform distribution was from 1.5 to 3.5 s for five sessions, from 0.8 to 1.8 s for two sessions, and from 1 to 2 s for one session. At the end of each inter-call interval, a new call was randomly picked from the set of calls for that session (with replacement) and played. The playback was designed to provide an auditory experience that is similar to the near-constant chatter of bat calls in a bat cave in the wild or in our bat colony room, as was done previously (). The calls used in playback sessions were recorded from the one-chamber sessions. On some of the playback sessions, the calls played to the bats were recorded from the same bats on one-chamber sessions; on other sessions, the calls played were recorded from different bats. Results from neural analyses were similar regardless of the range of inter-call intervals used and the set of calls played, and were thus combined together.

In total, we recorded 52 one-chamber sessions and 18 two-chambers sessions. In all sessions, bats were allowed to freely behave without intervention or constraint from experimenters. Among the two-chambers sessions, there were 5 sessions of free behavior without playback or interaction partners ( Figure 4 A), 8 sessions of free behavior with playback of bat calls ( Figure 4 B), and 5 sessions of free behavior with non-implanted interaction partners ( Figure 4 C). Identical cages, chambers, and recording setups were used for all one-chamber and two-chambers sessions. Sessions lasted on average 105 ± 6 minutes (mean ± STD). On 31 of the one-chamber sessions, a non-implanted third bat was introduced in the middle of the session. The time of introduction was on average 44.1 ± 14.2 minutes (mean ± STD) from the beginning of the session. The bats that were introduced as the third bat included 11 males and 7 females.

Before the first recording session, each bat used in the experiment was allowed to familiarize itself with the recording environment. This was done in ∼5 familiarization sessions per bat, where a bat freely interacted with another bat for ∼100 minutes per session. One to two of those ∼5 familiarization sessions involved interaction between the same bats that were to be used in the upcoming simultaneous two-bat neural recording experiment.

All experiments were conducted inside 40.6 X 33.7 X 52.1 cm (length X width X height) cages, which had netting on top that allowed bats to hang. Each cage was placed inside a 64.8 X 61 X 64.8 cm (length X width X height) chamber. Fans circulated air between the inside and outside of the chambers. The experiments were conducted in the dark. The only lights in the chambers were infrared lights to allow video recording. Video was recorded throughout the experimental sessions using one or two high-speed infrared cameras (Flea3, FLIR) at 100 frames/s. Ultrasonic microphones (USG Electret Ultrasound Microphone, Avisoft Bioacoustics; frequency range: 10-120 kHz) were used to record audio throughout the experimental sessions. Infrared light-emitting diodes (LEDs) on the wireless neural recording systems (see below) were flashed at intervals of ∼20 minutes during recording sessions, which were captured by the video cameras and used to synchronize neural and video recordings. Transistor-transistor logic pulses were sent using UltraSoundGate Player 216H (Avisoft Bioacoustics) simultaneously to the wireless neural recording systems of both bats as well as to the audio recording system (UltraSoundGate 416H, Avisoft Bioacoustics), synchronizing neural recording from both bats and the audio recording. All experiments took place in an electromagnetically and acoustically shielded room (IAC Acoustics).

Here we detail the definitions of the different behaviors observed in our experiments. They represent the behavioral repertoire the bats exhibited in the experiments, and were defined based on extensive examination of the video recordings of the experiments.

Active non-social. A bat engaging in any kind of active behavior that doesn’t involve social interaction, including: the bat hanging by its feet or feet and thumbs, and moving its head or body; the bat climbing or crawling around; the bat shaking its body; the bat jumping or flying off from the roof of the cage.

Resting. A bat hanging by its feet, with its head and body still. Resting can be social resting or non-social resting. Social resting is when a bat rests while leaning its whole body against another bat. Otherwise, it is non-social resting.

The behaviors of the bats in our experiments were manually annotated using a custom annotation program written in MATLAB (MathWorks). The annotations were done by experienced trained observers who did not know about the goals of the experiment, the analyses being performed, or the nature of the neural data, and were therefore unbiased. Annotations were done at a detailed level: the behaviors of each bat at each video frame were classified, according to a set of definitions, which we defined after extensive observation of bat behavior. Annotation was done for 65 of the 70 sessions (technical errors in the video recording prevented annotation for the other 5 sessions). It is important to note that due to the fine-grained annotation procedure and the length of the sessions (frame-by-frame annotation of videos recorded at 100 frames/s for sessions lasting ∼100 minutes each), annotation for a single session typically takes between 1-2 months for a single person. Yet, considering that the fine-grained social behavior of this species of bats has not be characterized before, we chose to take this careful, ethological approach despite its time-consuming nature.

While the bat was under anesthesia, the skull was micro-scarred to improve subsequent adhesion, and a circular opening (craniotomy of 1.8 mm diameter) was made in the skull over the left hemisphere. The center of craniotomy was positioned over the frontal cortex of the bat at 1.7 mm lateral to the midline and 12.19 mm anterior to the transverse sinus that runs between the posterior part of the cortex and the cerebellum. After removal of the dura, the microdrive was lowered and the tip of the microdrive’s guide tube was placed on the brain surface. The microdrive was placed vertically. The craniotomy was then filled with a biocompatible elastomer (Kwik-Sil, World Precision Instruments) to protect the brain. The exposed muscle tissue was then covered with a thin layer of biocompatible adhesive (Vetbond, World Precision Instruments) for protection. A bone screw (FST) with a soldered stainless-steel wire was fixed to the skull in the frontal plate, and served as a ground screw after its electrical connection to the dura was verified. An additional set of 3-5 bone screws were fixed to the skull and served as anchor screws for the mechanical stability of the implant. The bases of the screws were then covered with a thin layer of quick adhesive cement (C&B Metabond, Parkell) which held the screws firmly to the skull; dental acrylic was then added to secure the entire microdrive to the screws and to the skull. At the end of the surgery, bats were given the analgesic Metacam and the anti-inflammatory drug dexamethasone.

Each bat was implanted with a four-tetrode lightweight microdrive (Harlan 4 Drive, Neuralynx; weight 2.1 g). Tetrodes (∼45 μm diameter) were constructed from four strands of platinum-iridium wire (17.8 μm diameter, HML-insulated), bound together by twisting and then melting their insulations. Each of the four tetrodes was loaded and glued separately into a telescoped assembly of polyimide tubes mounted into the microdrive. The tetrodes exited the microdrive through a guide cannula in an approximately rectangular arrangement with ∼300 μm horizontal spacing between tetrodes. Each tetrode could be moved independently via a separate drive screw. On the day before surgery, the tip of each tetrode was cut flat using high-quality scissors (tungsten-carbide scissors with ceramic coating, CeramaCut; FST) and plated with Platinum Black (Neuralynx) to reduce the impedance of individual wires to 0.3-0.8 MΩ (at 1 kHz).

Anesthesia and surgical procedures generally followed those described previously in detail for Egyptian fruit bats (). Surgeries were performed to implant a four-tetrode microdrive on each bat. Anesthesia was induced using an injectable cocktail of ketamine (22 mg/kgBW), dexamedetomidine (0.09 mg/kgBW) and midazolam (0.31 mg/kgBW). Subsequently, the bat was placed in a stereotaxic apparatus (Kopf) and anesthesia was maintained throughout surgery by repeated injections (roughly once per hour) of an anesthesia maintenance cocktail of dexamedetomidine (0.125 mg/kgBW), midazolam (2.5 mg/kgBW) and fentanyl (0.025 mg/kgBW). The depth of anesthesia was monitored by testing toe pinch reflexes and measuring the bat’s breathing rate. The body temperature of the bat was kept constant at approximately 35-36°C, using a closed-loop temperature controller (FHC) connected to a rectal temperature probe and a heating pad placed under the bat.

After all recording sessions were concluded for the day, we connected the tetrodes to a wired recording system (Digital Lynx, Neuralynx) to monitor the neural signals and advance the tetrodes. Tetrodes were moved downward once every one to two days (mostly by 20-160 μm), in order to record single units, local spiking activity and LFP at new sites.

Electrophysiological recordings were conducted using a wireless neural data logging system (Neurolog-16, Deuteron Technologies), which amplifies the voltage signals from the 16 channels of the 4 tetrodes, performs analog-to-digital conversion at a sampling rate of 29.29 kHz, and stores the digitized data on an on-board SD card. The system has a bandwidth of 1 Hz - 7 kHz, records voltage with a fine resolution of 3.3 μv, and has a low level of noise generally close to the limit of Johnson noise from the impedance of a given source. The system also contains infrared LEDs that can be turned on and off during recording, whose on and off time stamps are recorded along with time stamps of neural data; these LEDs were used to synchronize video and neural recording (see above). Furthermore, the recording system is light-weight (9.9 g, including battery and plastic casing). The Egyptian fruit bats used in our experiment weighed more than 160 g and carried the recording system with ease, as expected from previous experiments using wireless recording systems with heavier or comparable weights during free flight for over an hour and covering multiple kilometers ().

Preprocessing of electrophysiological data

All filtering described in this section were done twice, in the forward and reverse directions, to eliminate phase distortion.

To obtain LFP, we first low-pass filtered the raw voltage traces using a 10th-order Butterworth filter with a cut-off frequency of 200 Hz. The voltage traces were then downsampled by a factor of 59, resulting in a sampling frequency of 496.6 Hz. Power line noise was then filtered out using a 10th-order Butterworth band-stop filter with cut-off frequencies 59.5 Hz and 60.5 Hz, and another one with cut-off frequencies 119.5 Hz and 120.5 Hz.

We observed artifacts in our LFP recording, in the form of large amplitude, transient (∼200 ms), irregular voltage fluctuations that are visually distinct from the normal LFP signal. To automatically detect these artifacts, we used the following algorithm. We note that this algorithm is only a heuristic method that worked well for our data; while it is convoluted, it performed better than a number of simpler methods we tried.

For a given LFP voltage trace (from one recording channel, spanning one recording session), we calculate its spectrogram over our frequency band of interest, 1-150 Hz. Specifically, modified periodograms are computed for short, overlapping segments (64 samples, or ∼128.89 ms, with 50% overlap between consecutive segments) of the LFP trace, each windowed with a Hamming window. In the spectrogram, artifacts appear as spikes in power. To facilitate the detection of these power outliers at any frequency, we normalize the spectrogram as follows: for each frequency, we normalize the power at that frequency by the median absolute deviation of power at that frequency. This normalized spectrogram is a matrix (number of frequencies X number of time bins), which we denote by S. We average over the rows of S (i.e., averaging across frequencies) to obtain a vector M (1 X number of time bins), which is the average normalized power as a function of time. We set a threshold, M threshold , to be the median of M multiplied by a parameter T m . Elements of M that are larger than M threshold are detected as potential artifacts. T m was chosen separately for each recording channel on each session, based on manual inspection of the artifact detection results obtained using a range of T m values. The median T m across all recording channels, bats, and sessions (n = 1912) is 8, and the first and third quartiles are 5 and 12, respectively.

The detected potential artifacts could include normal large amplitude oscillations that occur during sleep. To detect these false positives, we used the following procedure. At each time bin that a potential artifact is detected, we take the corresponding column of S, and find the maximum in that column between 1 and 10 Hz, which we denote by P low . Similarly, we find P mid as the maximum between 10 and 20 Hz, and P high as the maximum between 45 and 120 Hz. Then, we classify a potential artifact as a false positive if all three of the following criteria are satisfied: (1) P mid / P high > 6.5; (2) P mid / P low > 2; (3) the element of M at the given time bin is smaller than 1.5 M threshold .

Each element of M corresponds to 64 voltage samples. After rejecting the false positives, for each remaining element of M that is larger than M threshold , we define the corresponding 64 voltage samples as a single artifact. For consecutive elements of M that are larger than M threshold , their corresponding voltage samples are merged into a single artifact. Then, we define a voltage range within which normal LFP signal lies: the median ± 3 times the median absolute deviation of the entire voltage trace. For each artifact, if the first sample before it or the first sample after it is not within the normal voltage range, then we extend the artifact until both are within the normal range; this makes sure that the algorithm catches the “tails” of each artifact. Then, if the interval between any two artifacts is shorter than 210 ms, the two artifacts and the interval between them are merged into a single artifact.

When analyzing LFP, after we remove an artifact from an LFP trace, we close the resulting gap by joining the two ends of the trace. If the voltages at these two ends differ by a large amount, this effectively creates a new artifact, which we would like to avoid. Thus, before artifact detection, for a given voltage trace, we calculate the absolute value of the voltage difference between every pair of consecutive samples. We define the 90th percentile of all these absolute values as the largest acceptable voltage difference across the two ends of an artifact. If the voltage difference across the two ends of an artifact is larger than this threshold, we extend the artifact by up to 100 ms on each side, to bring the difference below the threshold, making sure to extend by the minimal length possible. If extensions by up to 100 ms on each side are not enough to bring the difference below threshold, we choose the lengths of extensions (still constrained to be below 100 ms on each side) to minimize the difference.

In total, artifacts amounted to a small proportion of our recordings. For each recording channel on each session, we calculated the total duration of artifacts, and the total duration of artifacts as a proportion of the total recording duration. For the total artifact duration, the median across all recording channels, bats, and sessions (n = 1912) was 36.7 s, and the first and third quartiles were 14.1 s and 126.7 s, respectively. For the total duration of artifacts as a proportion of the total recording duration, the median was 0.0058, and the first and third quartiles were 0.0023 and 0.020, respectively. For all the LFP analyses presented in this paper, artifacts were removed prior to analysis, as described in “Calculation of LFP spectrograms” below.