In the study, 5-month-old babies were shown to pick out an upbeat tune, such as "Ode to Joy" from Beethoven's Ninth Symphony, from a lineup of gloomier tunes.
In fact, by the time the babies turn 9 months old, they can even single out the sorrowful sound of Beethoven's Seventh Symphony from a pack of happy pieces.
Such musical experiments, according to Ross Flom Brigham Young University psychology professor and study author, have offered another example of how babies make sense of the world long before they can talk.
"One of the first things babies understand communicatively is emotion, so for them the melody is the message. Our study showed that by nine months, babies are categorizing songs as happy or sad the same way that preschoolers and adults do," said Flom.
In order to get a peek into the babies'' minds, the researchers designed experiments to cash on what babies say with their eyes.
First they displayed an emotionally-neutral face for the baby while music played. When the baby looked away from the face, the music stopped and the researchers queued up a new song from a playlist of five happy and five sad songs. For each song, observers recorded how long the baby paid attention to the face.
The babies that noticed a switch from happy to sad, or vice versa, stared at the face three to four seconds longer than usual because of their heightened interest.
"People of all ages reveal quite a bit through what they choose to look at and how much time they spend attending to that event. The only trick is to come up with the right presentation to test an idea about how and what babies learn," said Flom.
BYU music professor Susan Kenney, who was not involved with the study, pointed out some of the technical differences between the happy and sad songs the babies were exposed to.
"The happy songs were all in major keys with fairly short phrases or motives that repeated. The tempo and melodic rhythms were faster than any of the sad selections, and the melodies had a general upward direction. Four of the sad songs were in minor keys and all had a slower beat and long melodic rhythms. For an infant to notice those differences is fascinating," said Kenney.
Flom said that this period of learning about emotion in sounds is a natural step before learning to talk.
"Infants master so many things in such a short time frame. I can't think of a better line of inquiry than how infants learn so much so quickly," Flom said.
The results of the musical study will be published in the upcoming issue of the academic journal Infant Behavior and Development.