Phase (waves)

In physics and mathematics, the phase of a periodic function formula_1 of some real variable formula_2 (such as time) is an angle-like quantity representing the number of periods spanned by that variable. It is denoted formula_3 and expressed in such a scale that it varies by one full turn as the variable formula_2 goes through each period (and formula_5 goes through each complete cycle). It may be measured in any angular unit such as degrees or radians, thus increasing by 360° or formula_6 as the variable formula_2 completes a full period.
This convention is especially appropriate for a sinusoidal function, since its value at any argument formula_2 then can be expressed as the sine of the phase formula_3, multiplied by some factor (the amplitude of the sinusoid). (The cosine may be used instead of sine, depending on where one considers each period to start.)
Usually, whole turns are ignored when expressing the phase; so that formula_3 is also a periodic function, with the same period as formula_1, that repeatedly scans the same range of angles as formula_2 goes through each period. Then, formula_1 is said to be "at the same phase" at two argument values formula_14 and formula_15 (that is, formula_16) if the difference between them is a whole number of periods.
The numeric value of the phase formula_3 depends on the arbitrary choice of the start of each period, and on the interval of angles that each period is to be mapped to. 
The term "phase" is also used when comparing a periodic function formula_1 with a shifted version formula_19 of it. If the shift in formula_2 is expressed as a fraction of the period, and then scaled to an angle formula_21 spanning a whole turn, one gets the phase shift, phase offset, or phase difference of formula_19 relative to formula_1. If formula_1 is a "canonical" function for a class of signals, like formula_25 is for all sinusoidal signals, then formula_21 is called the initial phase of formula_19.
Mathematical definition.
Let formula_1 be a periodic signal (that is, a function of one real variable), and formula_29 be its period (that is, the smallest positive real number such that formula_30 for all formula_2). Then the phase of formula_1 at any argument formula_2 is 
Here formula_35 denotes the fractional part of a real number, discarding its integer part; that is, formula_36; and formula_37 is an arbitrary "origin" value of the argument, that one considers to be the beginning of a cycle. 
This concept can be visualized by imagining a clock with a hand that turns at constant speed, making a full turn every formula_29 seconds, and is pointing straight up at time formula_37. The phase formula_3 is then the angle from the 12:00 position to the current position of the hand, at time formula_2, measured clockwise. 
The phase concept is most useful when the origin formula_37 is chosen based on features of formula_1. For example, for a sinusoid, a convenient choice is any formula_2 where the function's value changes from zero to positive.
The formula above gives the phase as an angle in radians between 0 and formula_6. To get the phase as an angle between formula_46 and formula_47, one uses instead
The phase expressed in degrees (from 0° to 360°, or from −180° to +180°) is defined the same way, except with "360°" in place of "2π". 
Consequences.
With any of the above definitions, the phase formula_3 of a periodic signal is periodic too, with the same period formula_29:
The phase is zero at the start of each period; that is
Moreover, for any given choice of the origin formula_37, the value of the signal formula_1 for any argument formula_2 depends only on its phase at formula_2. Namely, one can write formula_59, where formula_60 is a function of an angle, defined only for a single full turn, that describes the variation of formula_1 as formula_2 ranges over a single period. 
In fact, every periodic signal formula_1 with a specific waveform can be expressed as 
where formula_65 is a "canonical" function of a phase angle in 
0 to 2π, that describes just one cycle of that waveform; and formula_66 is a scaling factor for the amplitude. (This claim assumes that the starting time formula_37 chosen to compute the phase of formula_1 corresponds to argument 0 of formula_65.)
Adding and comparing phases.
Since phases are angles, any whole full turns should usually be ignored when performing arithmetic operations on them. That is, the sum and difference of two phases (in degrees) should be computed by the formulas
respectively. Thus, for example, the sum of phase angles is 30° (, minus one full turn), and subtracting 50° from 30° gives a phase of 340° (, plus one full turn).
Similar formulas hold for radians, with formula_6 instead of 360.
Phase shift.
The difference formula_73 between the phases of two periodic signals formula_1 and formula_19 is called the phase difference or phase shift of formula_19 relative to formula_1. At values of formula_2 when the difference is zero, the two signals are said to be in phase, otherwise they are out of phase with each other.
In the clock analogy, each signal is represented by a hand (or pointer) of the same clock, both turning at constant but possibly different speeds. The phase difference is then the angle between the two hands, measured clockwise.
The phase difference is particularly important when two signals are added together by a physical process, such as two periodic sound waves emitted by two sources and recorded together by a microphone. This is usually the case in linear systems, when the superposition principle holds.
For arguments formula_2 when the phase difference is zero, the two signals will have the same sign and will be reinforcing each other. One says that constructive interference is occurring. At arguments formula_2 when the phases are different, the value of the sum depends on the waveform.
For sinusoids.
For sinusoidal signals, when the phase difference formula_81 is 180° (formula_82 radians), one says that the phases are opposite, and that the signals are in antiphase. Then the signals have opposite signs, and destructive interference occurs. 
Conversely, a phase reversal or phase inversion implies a 180-degree phase shift.
When the phase difference formula_81 is a quarter of turn (a right angle, or ), sinusoidal signals are sometimes said to be in quadrature (e.g., in-phase and quadrature components).
If the frequencies are different, the phase difference formula_81 increases linearly with the argument formula_2. The periodic changes from reinforcement and opposition cause a phenomenon called beating.
For shifted signals.
The phase difference is especially important when comparing a periodic signal formula_1 with a shifted and possibly scaled version formula_19 of it. That is, suppose that formula_88 for some constants formula_89 and all formula_2. Suppose also that the origin for computing the phase of formula_19 has been shifted too. In that case, the phase difference formula_21 is a constant (independent of formula_2), called the phase shift or phase offset of formula_19 relative to formula_1. In the clock analogy, this situation corresponds to the two hands turning at the same speed, so that the angle between them is constant.
In this case, the phase shift is simply the argument shift formula_96, expressed as a fraction of the common period formula_29 (in terms of the modulo operation) of the two signals and then scaled to a full turn:
If formula_1 is a "canonical" representative for a class of signals, like formula_25 is for all sinusoidal signals, then the phase shift formula_21 called simply the initial phase of formula_19.
Therefore, when two periodic signals have the same frequency, they are always in phase, or always out of phase. Physically, this situation commonly occurs, for many reasons. For example, the two signals may be a periodic soundwave recorded by two microphones at separate locations. Or, conversely, they may be periodic soundwaves created by two separate speakers from the same electrical signal, and recorded by a single microphone. They may be a radio signal that reaches the receiving antenna in a straight line, and a copy of it that was reflected off a large building nearby. 
A well-known example of phase difference is the length of shadows seen at different points of Earth. To a first approximation, if formula_5 is the length seen at time formula_2 at one spot, and formula_19 is the length seen at the same time at a longitude 30° west of that point, then the phase difference between the two signals will be 30° (assuming that, in each signal, each period starts when the shadow is shortest).
For sinusoids with same frequency.
For sinusoidal signals (and a few other waveforms, like square or symmetric triangular), a phase shift of 180° is equivalent to a phase shift of 0° with negation of the amplitude. When two signals with these waveforms, same period, and opposite phases are added together, the sum formula_106 is either identically zero, or is a sinusoidal signal with the same period and phase, whose amplitude is the difference of the original amplitudes.
The phase shift of the co-sine function relative to the sine function is +90°. It follows that, for two sinusoidal signals formula_1 and formula_19 with same frequency and amplitudes formula_66 and formula_110, and formula_19 has phase shift +90° relative to formula_1, the sum formula_106 is a sinusoidal signal with the same frequency, with amplitude formula_114 and phase shift formula_115 from formula_1, such that
A real-world example of a sonic phase difference occurs in the warble of a Native American flute. The amplitude of different harmonic components of same long-held note on the flute come into dominance at different points in the phase cycle. The phase difference between the different harmonics can be observed on a spectrogram of the sound of a warbling flute.
Phase comparison.
Phase comparison is a comparison of the phase of two waveforms, usually of the same nominal frequency. In time and frequency, the purpose of a phase comparison is generally to determine the frequency offset (difference between signal cycles) with respect to a reference.
A phase comparison can be made by connecting two signals to a two-channel oscilloscope. The oscilloscope will display two sine signals, as shown in the graphic to the right. In the adjacent image, the top sine signal is the test frequency, and the bottom sine signal represents a signal from the reference.
If the two frequencies were exactly the same, their phase relationship would not change and both would appear to be stationary on the oscilloscope display. Since the two frequencies are not exactly the same, the reference appears to be stationary and the test signal moves. By measuring the rate of motion of the test signal the offset between frequencies can be determined.
Vertical lines have been drawn through the points where each sine signal passes through zero. The bottom of the figure shows bars whose width represents the phase difference between the signals. In this case the phase difference is increasing, indicating that the test signal is lower in frequency than the reference.
Formula for phase of an oscillation or a periodic signal.
The phase of an oscillation or signal refers to a sinusoidal function such as the following:
where formula_120, formula_121, and formula_122 are constant parameters called the "amplitude", "frequency", and "phase" of the sinusoid. These signals are periodic with period formula_123, and they are identical except for a displacement of formula_124 along the formula_125 axis. The term phase can refer to several different things: