The evolution of whales from four-legged land dwellers into streamlined swimmers has been traced in fossilised ears, the journal Nature reports.
At one stage, whale hearing was crude in both air and water
The ancestors of cetaceans (whales, dolphins and porpoises) slowly lost their ability to move around on land to become efficient swimmers.
This shift is recorded in whale ears, as they evolve a sound transmission better able to hear underwater.
Whales went through a stage where their hearing was crude in both air and water
Directional hearing - the ability to determine which direction a sound is coming from underwater - is vital for modern toothed whales.
They pinpoint their prey through echolocation, in which some of the high-pitched sound whales send out bounces off an object and returns to them.
Toothed whales then interpret this returning echo to determine the object's distance, shape and other characteristics.
Almost like a whale
"In less than 15 million years, bodies of cetaceans evolved to adapt to life in the water. However, the change from living on land to living in water caused great problems for hearing," said co-author Hans Thewissen, associate professor of anatomy at Northeastern Ohio Universities College of Medicine.
"As every swimmer knows, mammals are unable to determine the direction from which sound originates under water."
The earliest cetaceans, the pakicetids - which lived about 50 million years ago - used the same sound transmission system as land mammals and had poor underwater hearing.
By 43 million years ago, their relatives the remingtonocetids and protocetids (which lived between 43 and 46 million years ago) had developed a new sound transmission system.
Basilosaurus could hear in a similar way to modern whales
These whales could hear better in water than pakicetids, while retaining their ability to hear in air. But this halfway house meant hearing in both air and water was crude.
With the advent of the basilosaurids about 40 million years ago, this compromise was abandoned in favour of a hearing system more akin to that of modern whales, giving them refined underwater sound reception.
However, the basilosaurids lacked the ability to echolocate like modern toothed whales.