You have run a frequency sweep, in PLECS or on the bench, and something looks off near Nyquist: the phase hooks upward instead of continuing its descent, or the gain rolls off more steeply than your plant model predicts. Before you conclude your model is wrong, consider this: what looks like an unmodeled pole or zero may in fact be aliasing – an artifact that is inherent to synchronous sampling, not a property of the plant.
This article gives you a precise picture of the PWM harmonic spectrum and explains why an analog and a digital controller see it very differently. With that picture in hand, you can read a Bode plot for what it actually contains.
Fixed Duty Cycle Spectrum
A PWM signal at switching frequency f_{sw} and duty cycle D has harmonic amplitudes (normalized to the bus voltage):
The DC component is c_0 = D. Amplitudes roll off as 1/n, so the switching fundamental always dominates.
The amplitudes are independent of carrier shape [2]. Trailing-edge, leading-edge, and symmetrical (triangle) carriers all produce the same harmonic magnitudes. Carrier shape affects only the phase of each harmonic, not its amplitude.
A given harmonic is suppressed wherever nD is an integer. At D = 0.5 all even harmonics vanish due to half-wave symmetry; for other duty cycles, the locations of these nulls shift accordingly.
Example: For D = 0.35 and f_{sw} = 10\text{ kHz}, the fundamental at 10 kHz has amplitude |c_1| = (2/\pi)|\sin(0.35\pi)| \approx 0.567. Nulls occur at n = 3, 6, \ldots
The figure below shows the time-domain waveform and its spectrum for D = 0.35, f_{sw} = 10\text{ kHz}.
Sidebands, Modulated Duty Cycle
In a real converter the duty cycle varies. For a small sinusoidal perturbation of amplitude \hat{d} at frequency f_m:
Sideband pairs appear around every carrier harmonic at frequencies nf_{sw} \pm f_m. The mechanism is the same as AM modulation: the signal at f_m mixes with each carrier harmonic nf_{sw}, producing sum and difference frequencies on either side.
The table below lists all spectral components at the PWM output. Amplitudes are normalized to the bus voltage.
| Component | Frequency | Natural sampling | Regular sampling (sym.) |
|---|---|---|---|
| DC | 0 | D_0 | D_0 |
| Modulation tone | f_m | \dfrac{\hat{d}}{2} | \dfrac{\hat{d}}{2}\,\left\lvert\cos\!\left(\pi f_m \tilde{D} T_{sw}\right)\right\rvert |
| n-th carrier harmonic | nf_{sw} | \dfrac{2}{n\pi}\left\lvert\sin(n\pi D_0)\right\rvert | same |
| n-th sideband pair | nf_{sw} \pm f_m | \dfrac{\hat{d}}{2} | \dfrac{\hat{d}}{2}\,\left\lvert\cos\!\left(\pi f_m \tilde{D} T_{sw}\right)\right\rvert |
where T_{sw} = 1/f_{sw} and \tilde{D} depends on the modulator type (see PWM Modulator Delay):
| Modulator Type | \tilde{D} |
|---|---|
| Asymmetrical Trailing-Edge | D |
| Asymmetrical Leading-Edge | 1-D |
| Symmetrical TE-LE | 1-D |
| Symmetrical LE-TE | D |
Sideband amplitudes are independent of harmonic index n. This holds because the analysis linearizes the perturbed switching instant for small \hat{d}, and to first order no n-dependent term survives. Every carrier harmonic carries sidebands of the same amplitude \hat{d}/2.
For regular sampling, the modulation tone and each sideband pair carry an additional phase shift of -\omega_m T_{sw}/2 relative to the naturally sampled case. The carrier harmonics and DC component are unaffected.
The figure below shows the spectrum for D_0 = 0.35, f_m = 700\text{ Hz}, \hat{d} = 0.05.
Analog Power Converter
In an analog converter the compensator output is a continuous-time signal. It intersects the carrier at its natural crossing points. There is no sampling step.
A voltage-mode buck converter serves as a concrete example. The switch output drives an LC output filter. The output voltage feeds a Type II op-amp compensator.
The LC filter is the only attenuator between the PWM output and the feedback node. Well above the corner frequency f_0 and below any ESR zero, it attenuates at -40\,\text{dB/decade}, which strongly suppresses higher-order sidebands. If the output capacitor’s ESR places a zero below the switching frequency, the rolloff flattens to -20\,\text{dB/decade} above that zero and sideband suppression is reduced accordingly.
The compensator bandwidth is set well below f_{sw} [5][6], so residual harmonics and sidebands at the feedback node cause negligible duty-cycle perturbation. The sideband amplitude reaching the feedback node is:
The figure below shows the LC filter Bode plot overlaid with the harmonic and sideband frequencies. The first carrier harmonic is attenuated by -33\text{ dB} and the first-harmonic sidebands by -31 to -34\text{ dB}.
Digital Power Converter
In a digital converter the synchronous sampler clocks at f_{sw}. It acquires one sample per control cycle at a fixed phase relative to the carrier. The switch output spectrum is unchanged: same carrier harmonics at nf_{sw}, same sideband pairs at nf_{sw} \pm f_m. What changes is how the controller observes them.
Carrier Harmonics Fold to DC
Any signal component at an exact integer multiple of f_{sw} has the same value at every sample instant. The sampler sees it as a fixed DC offset. It is invisible to the digital compensator.
For a symmetrical carrier, sampling at the carrier peak or valley is self-anti-aliasing for the inductor current [1,3], but not necessarily for the capacitor voltage, whose ripple is phase-shifted relative to the current. Sensor bandwidth limitations can shift the phase further, so the optimal sample point may differ from the natural overflow or underflow event.
Sampling away from the optimal phase creates a DC error that the compensator cannot distinguish from a genuine regulation error.
In practice the sampling instant is set by hardware, not software. The C2000 PWM block provides two independently configurable trigger outputs: the ADC trigger and the Task trigger. Each can fire at carrier underflow, carrier overflow, or both. A trigger divider reduces the rate by an integer factor while preserving the phase relationship to the carrier.
The compare register shadowing parameter (reload at underflow or overflow) determines when a new duty command takes effect. This fixes the effective modulator delay T_{eff}. This is the hardware realization of the synchronous sampling and N-cycle modulator analyzed in the article on PWM modulator delay.
The choice between underflow and overflow matters. Underflow places the sampling instant at the carrier minimum, the latch point for a symmetrical TE-LE modulator, where the carrier is about to rise toward the duty threshold. Overflow places it at the carrier peak, the latch point for a symmetrical LE-TE modulator. The two choices yield different T_{eff} values and therefore different alias phase angles \alpha = 2\pi f_{sw} T_{eff}, as explained in the next section.
Sidebands Alias to the Control Frequency
All sideband components at nf_{sw} \pm f_m fold back to f_m [4]. The dominant contribution is n=1: the sideband at f_{sw} - f_m is the closest alias to f_m, receiving the least attenuation from the plant.
The sampler reports the full aliasing sum at f_m:
where G(f) = G_{PWM}(f) \cdot G_{plant}(f) is the forward-path transfer function. Each integer k corresponds to one carrier harmonic: k=0 is the direct path at f_m, k=-1 is the lower sideband at f_{sw}-f_m folded back, k=+1 is the upper sideband at f_m+f_{sw} folded back.
The plant acts as the anti-alias filter. The n=-1 term lands at f_{sw}-f_m, which for typical loop bandwidths receives only moderate attenuation. The n=+1 term lands at f_{sw}+f_m, on the far side of f_{sw}, where the plant attenuation is substantially greater. Terms with |n| \geq 2 are negligible for a converter with a practical output filter, and dropping n=+1 on the same grounds reduces the sum to:
where \alpha = 2\pi f_{sw} T_{eff} is a constant phase set by the effective modulator delay T_{eff}. The complex conjugate arises because the k=-1 term evaluates G at the negative frequency f_m - f_{sw}. For any real-valued system G(-f) = G^*(f), so G(f_m - f_{sw}) = G^*(f_{sw} - f_m).
The alias-to-direct amplitude ratio is a useful parameter:
At low f_m, the mirror frequency f_{sw}-f_m is deep in the plant stopband and r is small. As f_m approaches f_{sw}/2 the two frequencies converge and r rises toward unity.
Two examples illustrate how different plants produce qualitatively different distortions for the same modulator.
LC Plant with an ESR zero well above Nyquist: The figure below shows r(f_m) for an LC plant with f_0 = 1\text{ kHz}, Q = 5, f_{sw} = 10\text{ kHz}. The filter capacitor is assumed to have very low series resistance, and therefore the zero caused by the ESR is at a high frequency and can be neglected.
The table gives the alias-to-direct ratio at selected frequencies for this example.
| f_m | Alias at f_{sw} - f_m | Atten. at f_m | Atten. at f_{sw} - f_m | Alias / Signal |
|---|---|---|---|---|
| 1\text{ kHz}\ (f_{sw}/10) | 9\text{ kHz} | +14\text{ dB} | -38\text{ dB} | -52\text{ dB} |
| 2\text{ kHz}\ (f_{sw}/5) | 8\text{ kHz} | -12\text{ dB} | -36\text{ dB} | -24\text{ dB} |
| 3.3\text{ kHz}\ (f_{sw}/3) | 6.7\text{ kHz} | -21\text{ dB} | -33\text{ dB} | -12\text{ dB} |
| 4\text{ kHz}\ (0.4\,f_{sw}) | 6\text{ kHz} | -24\text{ dB} | -31\text{ dB} | -7\text{ dB} |
| 4.5\text{ kHz}\ (0.45\,f_{sw}) | 5.5\text{ kHz} | -26\text{ dB} | -30\text{ dB} | -3\text{ dB} |
Note that for a second-order plant operating well above its corner frequency, the alias-to-direct ratio depends only on the attenuation difference between f_m and its mirror at f_{sw} - f_m. Since both frequencies are in the -40\,\text{dB/decade} rolloff region, that difference is set by their ratio (f_{sw} - f_m)/f_m alone, making the threshold largely independent of the absolute values of f_0 and f_{sw}.
Once r is significant, errors appear in both magnitude and phase. Their character depends on the angle of the alias phasor e^{j\alpha}G^*(f_{sw}-f_m) relative to the direct phasor G(f_m), which in turn depends on \alpha and on the plant’s own phase responses at f_m and at f_{sw} - f_m.
When no zeros fall within the measurement band, both G(f_m) and G(f_{sw}-f_m) are in the -40\,\text{dB/dec} rolloff region near Nyquist, and for a typical \alpha the alias phasor is roughly co-directed with the direct phasor. The vector sum is longer than the direct alone, so the measured magnitude rolls off more slowly than the true plant, and the resultant angle is less negative, producing an upward phase hook near Nyquist. The phasor diagram below illustrates both effects at two frequencies.
LC Plant with an ESR zero below Nyquist: To illustrate how a plant zero within the measurement band changes the aliasing picture, consider a buck converter with a higher switching frequency of f_{sw} = 100\,\text{kHz} and a resonant frequency f_0 = 1.1\,\text{kHz}. The output capacitor has non-negligible ESR, placing a zero at 14.5\,\text{kHz}, well below the Nyquist frequency. The PLECS model below shows the converter parameters.
This zero changes the picture. It adds phase to both phasors, but the mirror frequency f_{sw} - f_m sits further above the zero than f_m does and therefore accumulates more phase rotation. This swings the alias phasor away from the direct phasor direction. The vector sum is now shorter than the direct term alone, so the measured magnitude falls further than the true plant and the upward phase hook is suppressed.
The figure below overlays three model layers with a frequency response measured directly in PLECS using the Embedded Frequency Response Analysis (EFRA) Block: the continuous-time plant G_{vd}(f), the forward path including the PWM modulator transfer function G_{PWM}, and the full aliasing sum H_{meas} as seen by the MCU. The model and simulation agree closely across the full band.
The PLECS controller schematic used for this simulation is shown below. It uses the Embedded Frequency Response Block to inject a swept sinusoid at the duty-cycle input and record the resulting output voltage, replicating what a hardware FRA would measure on the physical converter. The ADC is triggered synchronously with the PWM carrier, firing on every second overflow, which gives a sampling frequency f_s = f_{sw}/2 = 50\text{ kHz} and sets the Nyquist boundary at 25 kHz.
These two examples are not exhaustive. A first-order plant, or any other pole-zero arrangement, will produce its own characteristic distortion. The aliasing sum, however, is always present in any frequency response measured by a synchronously sampled digital controller. The practical implication is to place the crossover frequency well below the region where r(f_m) becomes significant, so that loop gain and phase margin are not affected by the aliasing distortion.
Nyquist Phase: Always a Multiple of 180°
At f_m = f_{NYQ} = f_{sw}/2, the aliasing sum pairs each term k with term -(k+1). The two arguments are complex conjugates of each other, so every pair collapses to twice its real part:
This holds for any real-valued plant, it is a hard algebraic constraint, not a modeling artefact. A purely real result means the phase at Nyquist is an integer multiple of 180°. Which multiple you land on depends on the sign of the sum, set by the accumulated phase of the plant and modulator at f_{NYQ}.
This can be a useful sanity check: the condition applies only to a frequency response measured on the unit circle. If the FRA is mistakenly run in the full continuous-frequency domain, the ZOH sinc rolls off smoothly through Nyquist and the phase will generally not land on a multiple of 180°.
Summary
The PWM spectrum is the same whether your controller is analog or digital. What differs is how each architecture observes it.
In an analog loop there is no sampling and no aliasing. Whatever harmonic content survives the plant is suppressed by the compensator’s own bandwidth.
In a digital loop, carrier harmonics fold cleanly to DC, a feature you can exploit by placing the sample instant at the carrier peak or valley. Sidebands are less cooperative: they alias back to f_m and distort the measured frequency response. The alias-to-direct ratio r(f_m) = |G(f_{sw} - f_m)|\,/\,|G(f_m)| sets the scale of the error. Where r is small the measurement is faithful; where r is significant the measured response reflects both the direct path and its Nyquist mirror, combined in a way that depends on the plant’s pole-zero structure. The specific distortion (gain up or down, phase hook forward or back) is not a universal signature of aliasing but a consequence of the particular plant being measured. Keep the crossover frequency well below the region where r becomes significant, and any discrepancy near Nyquist is expected and not a modeling error.
References
[1] L. Corradini, D. Maksimovic, P. Mattavelli, R. Zane, Digital Control of High-Frequency Switched-Mode Power Converters, IEEE Press, 2015.
[2] S. R. Bowes and B. M. Bird, “Novel approach to the analysis and synthesis of modulation processes in power convertors,” IEE Proc., vol. 122, no. 5, pp. 507–513, 1975.
[3] D. M. Van de Sype, K. De Gussemé, A. P. Van den Bossche, and J. A. A. Melkebeek, “Small-signal Laplace-domain analysis of uniformly-sampled pulse-width modulators,” in Proc. IEEE PESC, 2004, pp. 4292–4298.
[4] D. M. Van de Sype, K. De Gussemé, F. M. L. L. De Belie, A. Van den Bossche, and J. A. A. Melkebeek, “Small-signal z-domain analysis of digitally controlled converters,” IEEE Trans. Power Electron., vol. 21, no. 2, pp. 470–478, Mar. 2006.
[5] R. D. Middlebrook, “Predicting modulator phase lag in PWM converter feedback loops,” in Proc. Powercon 8, Paper H-4, 1981.
[6] C. Basso, An Intuitive Guide to Compensating Switching Power Supplies, Stairway Press, 2024.










