Apple CEO Tim Cook. Justin Sullivan/Getty Images Apple is thinking about how it can figure out exactly how you feel at any given moment in order to show you the most relevant advertisements.

In a patent application the company filed Thursday, Apple describes a hypothetical system that would analyze and define people's moods based on a variety of clues including facial expressions, perspiration rates, and vocal patterns.

To be clear, Apple patents just about everything it does, with most applications never amounting to anything with regard to the actual products Apple releases.

Still it's interesting to see how Apple is thinking about predictive, contextual advertising at such a granular level, especially in light of its battle with companies like Google and Facebook to offer search products (Siri, the App Store) that know precisely what a user is looking for — even if the user has not expressly communicated his or her desire.

The patent application, No. 13/556023, describes system that would determine a sort of baseline mood for a given user by collecting and analyzing a mixture of physical, behavioral, and contextual data. The system would then compare this baseline to the data it collects from a user as the ad is about to be served to figure out what mood the user is in and subsequently, which ad the system should send to him or her.

While at this point you can generally assume that any ad you see from an even remotely sophisticated online advertiser will take into account behavioral clues like what content you have clicked on in the past, and contextual clues like where you live, Apple would broach new ground were it to start tracking the look on your face or how fast your heart is beating to determine your mood.

And yet, Apple is not alone in thinking about how to determine users' emotions at any given moment.

Google futurist Ray Kurzweil is working to improve its search function to the point where humans could type in a sentence, and the computer could understand the query on an emotional level. And earlier this month, Yahoo acquired Aviate, a company that organizes and searches for phone apps based on what it thinks you'll be looking for at a certain time.