DSPRelated.com

Phase (signal)

Category: Fundamentals | Also known as: phase response

Phase is the offset of a periodic signal relative to a reference signal or waveform origin, expressed as an angle in degrees or radians. It describes where in its cycle a signal stands at a given moment, and is central to understanding how signals combine, how filters alter waveforms, and how frequency-domain representations relate to time-domain behavior.

In practice

In embedded signal processing, phase appears most directly when working with sinusoidal signals, oscillators, or DFT/FFT output. For complex FFT outputs, each bin carries both a magnitude and a phase angle; recovering the correct phase is necessary when synthesizing signals, performing precise frequency estimation, or implementing techniques like single-sideband (SSB) modulation. The post "Phase and Amplitude Calculation for a Pure Real Tone in a DFT: Method 1" walks through extracting that phase correctly from a real-valued DFT output, which is a common source of off-by-one or sign errors in practice.

Phase relationships between two signals at the same frequency determine whether they add constructively or destructively. For signals of equal amplitude, a 180-degree phase difference causes complete cancellation; 0 degrees causes full reinforcement. More generally, those phase differences lead to destructive or constructive interference, with the degree depending on the amplitudes involved. This matters in hardware contexts such as differential signaling, clock distribution, and motor control (where three-phase voltages must be accurately separated by 120 degrees), as well as in software contexts such as IQ baseband processing, where the I and Q channels must be kept in precise quadrature (90-degree offset).

Phase response is a property of any linear time-invariant (LTI) system, including filters: it describes how much the system shifts the phase of each frequency component passing through it. A filter with nonlinear phase response introduces different delays for different frequencies, which distorts the shape of wideband signals even if the magnitude response is flat. FIR filters can be designed with linear phase (constant group delay), while most IIR designs -- such as Butterworth or biquad sections commonly used on MCUs -- have nonlinear phase. This distinction matters in audio, control loops, and communications receivers.

In applications such as phase vocoders and single-sideband demodulation (discussed in "Understanding the 'Phasing Method' of Single Sideband Demodulation" and "The Phase Vocoder Transform"), tracking and manipulating per-bin phase over successive FFT frames is the core operation. Phase unwrapping -- removing 2*pi discontinuities from a sequence of phase measurements -- is frequently required there, and on resource-constrained MCUs the cost of the atan2 calls and unwrapping logic must be budgeted carefully.

 Learn this in DSP Foundations

Discussed on DSPRelated

Frequently asked

What units is phase measured in, and does it matter which I use?
Phase is measured in radians or degrees; both are correct. Radians are standard in mathematical derivations and in most DSP library functions (atan2 returns radians, for example). Degrees are common in datasheets and RF engineering. Mixing the two without explicit conversion is a frequent source of bugs, so pick one convention per codebase and convert at the boundary.
How do I extract the phase of a signal from an FFT on an MCU?
For the bin k corresponding to the frequency of interest, compute atan2(Im[k], Re[k]). The result is the phase angle in radians relative to the start of the analysis window. The correctness of this result depends on the signal being coherently sampled (an integer number of cycles fitting the window) or on using a window function and accounting for the bin offset; the post 'Phase and Amplitude Calculation for a Pure Real Tone in a DFT: Method 1' covers the calculation in detail. On MCUs without an FPU, atan2 is expensive; look for integer or CORDIC-based approximations if throughput is tight.
What is phase noise, and why does it matter in embedded systems?
Phase noise is rapid, short-term random fluctuation in the phase of an oscillator or clock signal, expressed as power spectral density (dBc/Hz) at a given offset from the carrier. It matters in systems that rely on precise timing: high phase noise in an ADC sample clock raises the noise floor (it degrades SINAD/ENOB), and in RF receivers it degrades adjacent-channel rejection. Crystal oscillators typically have much lower phase noise than RC oscillators, which is one reason crystals are preferred when ADC resolution or RF performance must be maximized.
What is the difference between phase delay and group delay?
Phase delay is the ratio of phase shift to angular frequency at a single frequency: it represents how long a pure sinusoid at that frequency is delayed. Group delay is the negative derivative of phase with respect to frequency: it represents the delay of the envelope of a narrowband signal. For a filter with linear phase response, both are equal and constant across frequency in the linear-phase region, which for practical filters typically means over the passband or a defined frequency range. For a filter with nonlinear phase (such as a Butterworth IIR), group delay varies with frequency, meaning different spectral components of a wideband signal arrive at different times and the waveform shape is distorted.
Why does phase matter in motor control firmware?
In three-phase motor control (BLDC, PMSM), the firmware must generate PWM drive signals that are accurately offset by 120 degrees. Errors in these phase relationships produce torque ripple, increased current draw, and heat. Field-oriented control (FOC) algorithms additionally rely on correctly tracking the instantaneous rotor angle (electrical phase) using encoder or observer feedback; a phase error there directly causes suboptimal torque production or instability.

Differentiators vs similar concepts

Phase (a position in a cycle, measured as an angle) is often conflated with phase shift (the difference in phase between two signals or between a signal's input and output), phase response (how phase shift varies as a function of frequency for a system), and group delay (the derivative of phase response with respect to frequency, representing envelope delay). These are related but distinct: a filter has a phase response curve, and its group delay is derived from that curve. A single measurement between two sinusoids at one frequency is a phase shift. "Phase" alone can refer to any of these depending on context, so precision in terminology matters when debugging or specifying filter behavior.