Scientists dosed alligators with ketamine and had them listen to sounds through earbuds to better understand the auditory abilities of dinosaurs.

The experiment, described in a paper published Monday in The Journal of Neuroscience, was designed to study the “neural maps”—brain passageways that carry information about soundwaves—that alligators generate to locate noises in their habitats. These maps are vital for many vertebrates, and are especially developed in nocturnal predators such as barn owls because they rely heavily on sound to locate prey.

The focus of the study was a concept called interaural time difference (ITD), which is the gap in arrival time of a sound to each ear. Though this time lag is typically only a few microseconds, it plays a crucial role in helping animals detect where sounds originate.

Catherine Carr, a biologist at the University of Maryland, and Lutz Kettler, a neuroscientist at the Technische Universität München, have spent years studying how ITD processes help animals like birds and reptiles locate noises. Because birds, alligators, and dinosaurs all descended from archosaurs, a lineage that flourished in the Triassic Period, the new study provides clues about the auditory systems of dinosaurs by studying their extant cousins.

“Birds are dinosaurs and alligators are their closest living relatives,” Carr told Motherboard in an email. “Features shared by both groups might reasonably be inferred to have been found in extinct dinosaurs so we assume dinosaurs could localize sound.”

Previous studies have established that birds evolved a different neural process of sound localization compared to mammals. In this study, Carr and Kettler sought to capture where American alligators fell on the ITD spectrum.

The team injected 40 American alligators from Rockefeller Wildlife Refuge in Louisiana with ketamine and dexmedetomidine to sedate them. While the animals were anesthetized, Yuin PK2 earbuds, fitted with horns, were placed in their earlids. Electrodes were positioned on the alligators’ heads to record the auditory neural responses to tones and clicks played through the headphones.

“We used both tones that the alligator could hear well (about 200 to 2000 Hz) and noise,” Carr said. “We selected the tones and noise to provide naturalistic stimuli.”

The experiment revealed that alligators locate sounds using similar neural mapping systems to those of birds, despite the vast differences in their brain anatomies.

“One important thing we learn from alligators is that head size does not matter in how their brain encodes sound direction,” Kettler told Motherboard in an email.

This means that dinosaurs as large as Tyrannosaurus rex were likely using similar auditory mechanisms as birds and alligators to locate sounds. While scientists can’t go back in time to peer into the brains of the dinosaurs, the surviving relatives of these iconic extinct animals provide an exciting window into the past.