Phonology (Greek phone = voice/sound and logos = word/speech), is a subfield of linguistics closely associated with phonetics. Whereas phonetics is about the physical production and perception of sounds of speech, phonology describes the way sounds function - within a given language or across languages. For example, /p/ and /b/ in English are distinctive units of sound, (i.e., phonemes.) We can tell this from minimal pairs such as "pin" and "bin", which mean different things, but differ only in one sound. On the other hand [p] or [b] are often pronounced differently depending on their placement relative to other sounds, yet they are still considered to be the same phoneme. The /p/ in "pin" is, for example, aspirated (a feature which differentiates phonemes in languages like Chinese and Quechua) while the very same phoneme in "spin" is not.
The principles of phonological theory have also been applied to the analysis of signed languages, with gestures and their relationships as the object of study.
Phonemes and spelling
In some languages the phonemes are directly linked to spelling, i.e., a phoneme is represented by a graphical symbol or a combination of them, a letter or a letter combination. However in English different phonemes can be spelled the same way ("good" and "food" have different vowel sounds), so one should use the International Phonetic Alphabet (IPA) to denote phonemes. To indicate that one means names instead of phones the phoneme or sequence of phonemes is enclosed by two slashes (or solidi) " / / " (without the quotes or pluralization; see above examples).
Doing a phoneme inventory
Part of the phonological study of a language involves looking at data (phonetic transcriptions of the speech of native speakers) and trying to deduce what the underlying phonemes are and what the sound inventory of the language is.
Even though a language may make distinctions between a small number of phonemes, speakers actually produce many more phonetic sounds. Thus, a phoneme in a particular language can be pronounced in many ways.
Looking for minimal pairs forms part of the research in studying the phoneme inventory of a language. However with this method it is often not possible to detect all phonemes so other approaches are used as well. A minimal pair is a pair of words, both from the same language, that differ by only a single phoneme, and that are recognized by speakers as being two different words.
When there is a minimal pair, then those two sounds constitute separate phonemes, otherwise they are called allophones of the same underlying phoneme. For instance, voiceless stops (/p/, /t/, /k/) can be aspirated. In English, word initial voiceless stops are aspirated, whereas non word-initial voiceless stops are not aspirated (This can be seen by putting your fingers right in front of your lips and notice the difference in breathiness as you say 'pin' and 'spin'). There is no English word 'pin' that starts with an unaspirated p, therefore in English, aspirated [p?] (the [?] means aspirated) and unaspirated [p] are allophones of an underlying phoneme /p/.
This is not true of all languages however - both Cantonese and Thai make the distinction between [p] and [p?], so in those languages, /p/ and /p?/ are separate phonemes.
Another example... in English, the liquids /l/ and /??/ are two separate phonemes (minimal pair 'life', 'rife'); however, in Korean these two liquids are allophones of the same phoneme, and the general rule is that [?] comes before a vowel, and [l] doesn't (e.g. Seoul, Korea). A native speaker of Korean will tell you that the [l] in Seoul and the [?] in Korea are in fact the same letter. What happens is that a native Korean speaker's brain uses the underlying phoneme /l/, and depending on the phonetic context (before a vowel or not) this phoneme gets expressed as either the [?] sound or the [l] sound. Another Korean speaker will hear both sounds as the underlying phoneme and think of them as the same sound. This is one reason why most people have an accent when they attempt to speak a language that they did not grow up hearing; their brains sort the sounds they hear in terms of the phonemes of their own native language.
Generative phonology
Noam Chomsky and Morris Halle presented in The Sound Pattern of English a view of phonology where a phonological representation (surface syntactic form) is a structure whose phonetic part is a sequence of units which have characteristic features. Although there are no phonemes in generative phonology, these units are often loosely referred to as phonemes, nonetheless. The features describe aspects of articulation and perception, are from a universally fixed set and have the binary values + or -. Ordered phonological rules govern how this phonological representation (also called underlying representation) is transformed into the actual pronunciation (also called surface form.) An important consequence of the great influence SPE had on phonological theory was the downplaying of the syllable and the emphasis on segments.
Change of a phoneme inventory over time
The particular sounds that a language decides to make distinctions between can change over time as new children learn the language. At one point, [f] and [v] were allophones in English, and these changed later into separate phonemes. This is one of the main factors of historical change of languages as described in historical linguistics (another being fast change resulting from influence by another language, e.g. French influence on English after the Norman Conquest).
Other language features studied in phonology
Stress and intonation are also part of phonology. In some languages, stress is non-phonological. Some examples include Finnish and all ancient Germanic languages (Old Norse, Old English and Old High German) as well as some modern Germanic languages such as Icelandic.
However, in most modern-day Germanic languages such as German or English, stress is indeed phonologically distinctive, although there are only few minimal pairs, e.g. /'august/ 'August (the name)' versus /au'gust/ 'August (the month)' in German, or /k?n' v?:s/(RP) /k?n' v?s/(GenAm) 'converse (to hold a conversation)' and /'k?nv?:s/(RP) /'k?nv?s/(GenAm) 'converse (the opposite of something)' in English.
The distinction of stress is often seen in English words where the verb and noun forms have the same spelling. For example, consider /'r?b?l/ 'rebel' the noun (which places the emphasis on the first syllable) contrasted with /r?'b?l/ 'rebel' the verb (which instead puts the emphasis on the second syllable).
Development of the field
The posthumous work of Nicholas Trubetskoy, the Principles of Phonology (1939), is usually taken as a starting point in the history of phonology as a linguistic discipline quite distinct from phonetics.
In 1976 John Goldsmith introduced autosegmental phonology. The phonological phenomena are no longer seen as one linear sequence of segments called phonemes or feature combinations but rather as some parallel sequences of features which reside on multiple tiers.
In a course at the LSA summer institute in 1991, Alan Prince and Paul Smolensky developed Optimality Theory—an overall architecture for phonology according to which languages choose a pronunciation of a word that best satisfies a list of constraints which is ordered by importance: a lower-ranked constraint can be violated when the violation is necessary in order to obey a higher-ranked constraint. The approach was soon extended to morphology by John McCarthy and Alan Prince, and has become the dominant trend in phonology.
Government Phonology, which originated in the early 1980s as an attempt
to unify theoretical notions of syntactic and phonological structures,
is based on the notion that all languages necessarily follow a small set
of principles and vary according to their selection of certain binary
parameters. That is, all languages' phonological structures are essentially
the same, but there is restricted variation that accounts for differences
in surface realizations. Principles are held to be inviolable, though
parameters may sometimes come into conflict. Prominent figures include
Jonathan Kaye, Jean Lowenstamm, Jean-Roger Vergnaud, Monik Charette, John
Harris, and many others.