# PWM: exact and approximate time and frequency domain solutions

## Introduction

The previous page  analyzed the output of a pulse width modulated system with a resistor and a capacitor.  This page performs, using three different, an in depth analysis of a first order low pass system applied to a PWM signal. The first method is an exact solution. This derivation is quite involved mathematically, and doesn't provide any insights beyond those obtained with the other two methods; it is included for completeness and for those who would like to see all the mathematical details. The second method is based on a first order (i.e., linear) solution in the time domain and is only valid if the time constant, τ, of the low pass system is much longer than the period, T, of the PWM signal (i.e., τ>>T). The third mased is based on a frequency domain argument, and is also on valid for τ>>T.

The results from all three methods are shown in the graph below along with the PWM input and the average value of the PWM input. Note all three methods yield the same average output, equal to the average of the input, but will have slightly different calculations of the ripple in the output. If you select one of the solutions, it will be highlighted on the graph. Also, the derivation of the specified solution will appear immediately below the graph to make it easier to go back and forth between the graph and the derivation.

Try these things with the sliders next to the graph to get a feel for how the PWM works.

• As the duty cycle is increased the average increases (as does the output of the low pass system). The ripple also decreases and goes to zero as the duty cycle approaches 100%.
• As the duty cycle is decreased the average decreases (as does the output of the low pass system). The ripple also decreases and goes to zero as the duty cycle approaches 0%.
• As τ is decreased the ripple increases (because the low pass system responds quickly). Also note that the approximations become less good because the assumption that τ>>T becomes less good.
• As τ is increased the ripple decreases (because the low pass system cannot respond as quickly). Also note that the approximations become better because the assumption that τ>>T becomes better.

Exact Solution
Approximate Time Domain Solution
Approximate Frequency Domain Solution

First Order System Review

##### Aside: Useful facts about the step response of a first order system

Two of the solutions below ("Exact" and "Approximate Time Domain") make use of some facts about the step response of a first order system (more details here). The step response of a first order system, yγ(t), is determined by the initial value at t=0+, the final value at t=∞ and the time constant. The response (the blue line) starts at yγ(0+) and is asymptotic to yγ(∞) as t increases.

${y_\gamma }(t) = {y_\gamma }\left( \infty \right) + \left( {{y_\gamma }\left( {{0^ + }} \right) - {y_\gamma }\left( \infty \right)} \right){e^{ - t/\tau }}$

For t/τ <<1, we can approximate the exponential by a linear function as shown above (the red line). The linear approximation is easily derived by replacing the exponential term with its first order taylor series expansion:

\begin{align} {y_\gamma }(t) &\approx {y_\gamma }\left( \infty \right) + \left( {{y_\gamma }\left( {{0^ + }} \right) - {y_\gamma }\left( \infty \right)} \right)\left( {1 - \frac{t}{\tau }} \right) \\ &= \frac{{{y_\gamma }\left( {{0^ + }} \right) - {y_\gamma }\left( \infty \right)}}{\tau }t + {y_\gamma }\left( 0^+ \right) \\ &= \frac{{\Delta y}}{\tau }t + {y_\gamma }\left( 0^+ \right) \\ \end{align}

The last equation shows that the line has a slope of Δy/τ and a y-axis intercept of yγ(0+).

## Exact Derivation of PWM output

The figure below shows a PWM signal, x(t), with period T=1S and a duty cycle of 0.6 (or 60%) as a solid black line. Also shown is the ouput, y(t), of a system with time constant τ=0.5S as a blue line.

We will find

• an expression for the voltage during T1, while the input is high, and the output is increasing,
• an expression for the output, y(t), during T1, while the input is low and the output is decreasing,
• the values of ymax and ymin (the maximum and minimum values of the output,
• the "ripple" in the output (i.e., ymax-ymin) which depends on T1,
• the maximum, or worst case, ripple,
• the average value of y(t).

### PWM output increasing (during T1)

First consider the output during the time interval T1 which we will call yhigh(t). The voltage starts at y1 and is asymptotic to 1 (as shown by the dotted line)

${y_{high}}\left( t \right) = {y_{high}}\left( \infty \right) + \left( {{y_{high}}\left( {{0^ + }} \right) - {y_{high}}\left( \infty \right)} \right){e^{ - t/\tau }} = 1 + \left( {{y_{min}} - 1} \right){e^{ - t/\tau }}$

### PWM output decreasing (during T2)

To make the math during this section easier, we will redefine the origin of the time axis so that t=0 when the PWM input falls (in previous graphs, t=0 when PWM input rises). Now consider the output during the time interval T2 which we will call ylow(t). With this modified time origin, the voltage starts at y2 and is asymptotic to 0 (as shown by the dotted line)

${y_{low}}\left( t \right) = {y_{low}}\left( {0^ + } \right){e^{ - t/\tau }} = y_{max}{e^{ - t/\tau }}$

### Finding ymin and ymax.

We have expressions for ylow(t) and yhigh(t) in terms of ymin and ymax, but we don't yet know ymin and ymax. However, if you examine the graphs you can see that

$y_{max} = y_{high} \left( T_1 \right) = 1 + \left( {{y_{min}} - 1} \right){e^{ - T_1/\tau }}$

and

$y_{min} = y_{low} \left( T_2 \right) =y_{max} {e^{ - T_2/\tau }}$

We can solve these equations (using the fact the T=T1+T2) to get

${y_{\max }} = \frac{{1 - {e^{ - {T_1}/\tau }}}}{{1 - {e^{ - T/\tau }}}},\quad \quad {y_{\min }} = {y_{\max }}{e^{ - {T_2}/\tau }} = {e^{ - {T_2}/\tau }}\frac{{1 - {e^{ - {T_1}/\tau }}}}{{1 - {e^{ - T/\tau }}}} = \frac{{{e^{ - {T_2}/\tau }} - {e^{ - T/\tau }}}}{{1 - {e^{ - T/\tau }}}}$

### Expression for yhigh(t) and ylow(t)

\begin{align} {y_{high}}\left( t \right) &= 1 + \left( {{y_{\min }} - 1} \right){e^{ - t/\tau }} = 1 + \left( {{e^{ - T/\tau }}\frac{{{e^{{T_1}/\tau }} - 1}}{{1 - {e^{ - T/\tau }}}} - 1} \right){e^{ - t/\tau }} = 1 + \left( {{e^{ - T/\tau }}\frac{{{e^{{T_1}/\tau }} - 1}}{{1 - {e^{ - T/\tau }}}} - \frac{{1 - {e^{ - T/\tau }}}}{{1 - {e^{ - T/\tau }}}}} \right){e^{ - t/\tau }} \\ &= 1 + \left( {\frac{{{e^{ - T/\tau }}{e^{{T_1}/\tau }} - 1}}{{1 - {e^{ - T/\tau }}}}} \right){e^{ - t/\tau }} \\ {y_{low}}\left( t \right) &= {y_{max}}{e^{ - t/\tau }} = \frac{{1 - {e^{ - {T_1}/\tau }}}}{{1 - {e^{ - T/\tau }}}}{e^{ - t/\tau }} \\ \end{align}

### Expression for output ripple (i.e., yripple = ymax-ymin)

The ripple is dependent on the value of T1, so we will write it as a function of T1.

$y_{ripple}\left( {{T_1}} \right) = {y_{\max }} - {y_{\min }} = \frac{{1 - {e^{ - {T_1}/\tau }}}}{{1 - {e^{ - T/\tau }}}} - \frac{{{e^{ - T/\tau }}{e^{{T_1}/\tau }} - {e^{ - T/\tau }}}}{{1 - {e^{ - T/\tau }}}} = \frac{{1 - {e^{ - {T_1}/\tau }} - {e^{ - T/\tau }}{e^{{T_1}/\tau }} + {e^{ - T/\tau }}}}{{1 - {e^{ - T/\tau }}}}$

### Maximum (worst case ripple)

The ripple depends on the value of T1, so we need to find the value of T1 that maximizes the ripple. There is no ripple when T1=0, or T1=T. The ripple is symmetric about T1/T=0.5 (if the output is high 40% of the time and low 60%, the values of ymin and ymax are just switched from the case when the output is high 60% of the time), it is reasonable to assume the peak occurs at T1/T=0.5.

Just to make sure this is correct, we can prove it by differentiating our expression for yripple(T1) with respect to T1 and setting it to zero

\begin{align} \frac{{\partial y_{ripple}\left( {{T_1}} \right)}}{{\partial {T_1}}} &= \frac{{{e^{{T_1}/\tau }}{\mkern 1mu} {e^{ - T/\tau }} - {e^{ - {T_1}/\tau }}}}{{\tau {\mkern 1mu} \left( {{e^{ - T/\tau }} - 1} \right)}} = 0{\text{,}}\quad {\text{so}} \\ {e^{{T_1}/\tau }}{\mkern 1mu} {e^{ - T/\tau }} - {e^{ - {T_1}/\tau }} &= 0 \\ {e^{{T_1}/\tau }}{\mkern 1mu} {e^{ - T/\tau }} &={e^{ - {T_1}/\tau }},\quad {\text{take the logarithm}} \\ \frac{{{T_1}}}{\tau } - \frac{T}{\tau } &= - \frac{{{T_1}}}{\tau }{\text{,}}\quad {\text{or}} \\ {T_1} &= \frac{T}{2} \\ \end{align}

which shows that the peak is at T1/T=0.5, as we expected, and the worst case ripple is

${y_{ripple,\max }} = \frac{{1 - {e^{ - T/(2\tau )}} - {e^{ - T/\tau }}{e^{T/(2\tau )}} + {e^{ - T/\tau }}}}{{1 - {e^{ - T/\tau }}}} = \frac{{1 - 2{e^{ - T/(2\tau )}} + {e^{ - T/\tau }}}}{{1 - {e^{ - T/\tau }}}} = \frac{{{{\left( {1 - {e^{ - T/(2\tau )}}} \right)}^2}}}{{1 - {e^{ - T/\tau }}}}$

### Average value of PWM output

There are several ways to find the average value of the PWM output. Here we will find the average value through integration. This is conceptually easy, but computationally difficult. In the section describing the frequency domain approximation we will use another techniques that is conceptually very simple, but is conceptually more difficult (we will also find it in the discussion of the time domain approximation, which is somewhere between the two both conceptually and computationally). We start with the definition of the average:

$PWM\;output\;average = \frac{1}{T}\left( {\int\limits_0^T {{y_{PWMout}}\left( t \right)dt} } \right)$

The notation on the next line is a little tricky. We split the two integral into two parts, one where the function is rising, and one where it is falling. Recall that when we defined the latter function, we reset the time origin; this means when we integrate ylow(t), we integrate from 0 to T2, instead of T1 to 1. The rest of the derivation is some straightforward calculus and algebra.

\begin{aligned} PWM\;output\;average &= \frac{1}{T}\left( {\int\limits_0^{{T_1}} {{y_{high}}\left( t \right)dt} + \int\limits_0^{{T_2}} {{y_{low}}\left( t \right)dt} } \right) = \frac{1}{T}\left( {\int\limits_0^{{T_1}} {\left( {1 + \left( {\frac{{{e^{ - T/\tau }}{e^{{T_1}/\tau }} - 1}}{{1 - {e^{ - T/\tau }}}}} \right){e^{ - t/\tau }}} \right)dt} + \int\limits_0^{{T_2}} {\frac{{1 - {e^{ - {T_1}/\tau }}}}{{1 - {e^{ - T/\tau }}}}{e^{ - t/\tau }}dt} } \right) \\ &= \frac{1}{T}\left( {\frac{{\tau {\mkern 1mu} \left( {{e^{{T_1}/\tau }} + {e^{\frac{{T - {T_1}}}{\tau }}} - {e^{T/\tau }} - 1} \right)}}{{{\text{1}} - {e^{T/\tau }}}} + \frac{{{T_1} + \tau - {T_1}{\mkern 1mu} {e^{T/\tau }} + \tau {\mkern 1mu} {e^{T/\tau }} - \tau {\mkern 1mu} {e^{{T_1}/\tau }} - \tau {\mkern 1mu} {e^{\frac{{T - {T_1}}}{\tau }}}}}{{{\text{1}} - {e^{T/\tau }}}}} \right) \\ &= \frac{{\tau {e^{{T_1}/\tau }} + \tau {e^{\frac{{T - {T_1}}}{\tau }}} - \tau {e^{T/\tau }} - \tau + {T_1} + \tau - {T_1}{\mkern 1mu} {e^{T/\tau }} + \tau {\mkern 1mu} {e^{T/\tau }} - \tau {\mkern 1mu} {e^{{T_1}/\tau }} - \tau {\mkern 1mu} {e^{\frac{{T - {T_1}}}{\tau }}}}}{{T\left( {{\text{1}} - {e^{T/\tau }}} \right)}} \\ &= \frac{{{T_1}}}{T} \\ &= PWM\;input\;average \\ \end{aligned}

This is a power result! It states that the output of the PWM output is the same as that of the PWM input. So, for the case described here, since the duty cycle is 0.6, the input average is 0.6, as is the output average.

## 1st Order Time Domain Derivation of PWM output

The exact analysis is very laborious, but we can make an accurate linear model if the pulse width modulated square wave is much faster than the system being driven; in other words if T<<τ. The figure below shows a PWM signal, x(t), with period T=1S and a duty cycle of 0.6 (or 60%) as a solid black line. Also shown is the exact ouput, y(t), of a system with time constant τ=0.5S as a blue line, and a the linear approximation in red. You can see they are quite close:

### Average value

We want to start by finding a relationship between T1 and yavg.

• First consider the plot during the interval labeled T1, as the PWM output is rising (see image at right)
Note that the graph at the right has the time axis shifted so t=0 is set to the time when the linear approximation (red) goes through the average PWM output (yavg, shown in magenta).
• We want to match the slope of the exponential (shown as dotted red) with the slope of the linear approximation (solid red) as it passes through the average.
• The slope of the linear approximation is (ymax-ymin)/T1.
• The slope of the exponential (see above) is ΔyT1/τ = (1-yavg)/τ. (Recall ΔyT1 is the difference between the asymptotic value (1) of the exponential and the initial value (yavg).
• The two slopes are equal so $\frac{{{y_{\max }} - {y_{\min }}}}{{{T_1}}} = \frac{{\Delta {y_{T1}}}}{\tau } = \frac{{1 - {y_{avg}}}}{\tau }$.
• Now consider the plot during the interval labeled T2, as the PWM output is false (see image at right)
Note that the graph at the right has the time axis shifted so t=0 is set to the time when the linear approximation (red) goes through the average PWM output (yavg, shown in magenta).
• We want to match the slope of the exponential (shown as dotted red) with the slope of the linear approximation (solid red) as it passes through the average.
• The slope of the linear approximation is (ymin-ymax)/T2.
• The slope of the exponential (see above) is ΔyT2/τ = -yavg/τ. (Recall ΔyT2 is the difference between the asymptotic value (0) of the exponential and the initial value (yavg).
• The two slopes are equal so $\frac{{{y_{\min }} - {y_{\max }}}}{{{T_2}}} = \frac{{\Delta {y_{T2}}}}{\tau } = - \frac{{{y_{avg}}}}{\tau }$.
• We know that the change in PWM output during T1 is just the slope multiplied by T1 or ${\Delta _{rising}} = \left( {\frac{{1 - {y_{avg}}}}{\tau }} \right){T_1}$
• Likewise, the change in output during T2 is just the slope multiplied by T2 or ${\Delta _{falling}} = \left( { - \frac{{{y_{avg}}}}{\tau }} \right){T_2}$
• During one cycle of the input, the sum of the changes during T1 and T2 must add to zero (so the cycle can repeat). We also use the fact that T2=T-T1
\begin{align} {\Delta _{rising}} + {\Delta _{falling}} &= 0 = \left( {1 - {y_{avg}}} \right)\frac{{{T_1}}}{\tau } - {y_{avg}}\frac{{{T_2}}}{\tau },\quad \tau {\text{ cancels from equation}} \\ 0 &= \left( {1 - {y_{avg}}} \right){T_1} - {y_{avg}}\left( {T - {T_1}} \right) \\ {y_{avg}} \cdot T &= {T_1} \\ {y_{avg}} &= \frac{{{T_1}}}{T} \\ \end{align}

so the average of the PWM output is equal to the average of the PWM input and is equal to T1/T.

### Ripple

We can easily find the ripple by solving for Δyrising or -Δyfalling (since they are equal).

${y_{\max }} - {y_{\min }} = - \Delta_{falling} = {y_{ripple}} = {y_{mid}}\frac{{{T_2}}}{\tau } = \frac{{{T_1}}}{T}\frac{{{T_2}}}{\tau } = \frac{{{T_1}\left( {T - {T_1}} \right)}}{{T \cdot \tau }}$

### Worst case ripple

The ripple depends on the value of T1, so we need to find the value of T1 that maximizes the ripple. There is no ripple when T1=0, or T1=T. The ripple is symmetric about T1/T=0.5 (if the output is high 40% of the time and low 60%, the values of ymin and ymax are just switched from the case when the output is high 60% of the time), it is reasonable to assume the peak occurs at T1/T=0.5. Just to make sure this is correct, we can prove it by differentiating our expression for yripple(T1) with respect to T1 and setting it to zero

$y_{ripple}\left( T_1 \right) = \frac{{{T_1}\left( {T - {T_1}} \right)}}{{T \cdot \tau }}$$\frac{{\partial {y_{ripple}}\left( {{T_1}} \right)}}{{\partial {T_1}}} = \frac{{T - 2{T_1}}}{{T \cdot \tau }} = 0$

which shows that the peak is at T1/T=0.5, as we expected, and the worst case ripple is

${y_{ripple,\max }} = \frac{{\frac{T}{2}\left( {T - \frac{T}{2}} \right)}}{{T \cdot \tau }} = \frac{T}{{4\tau }}$

### Final words

Because this derivation is so much simpler than the exact derivation, and because the results are similarly less complex, this is usually a much more fruitful way of thinking about pulse width modulation.

## 1st Order Frequency Domain Derivation of PWM output

Understanding Pulse Width Modulation in the context of a frequency domain analysis is in some ways the simplest (the mathematics is quite simple), and in some ways the most complex (it requires a knowledge of transfer functions, sinusoidal steady state, and Fourier Series. We assume we have a low pass system, Hsys(s), with and PWM input, x(t), and we want to find the system output, y(t).

To start this analysis consider a PWM input (in this case we have the pulse is symmetric around t=0 because it makes the math easier, but this has no impact on our calculation of the average value of the output, nor on our calculation of the ripple.

The duty cycle is given by T1/T, in this case 0.6. The average is also 0.6 (since the input has a value of one 60% of the time, and is otherwise equal to 0). The Fourier Series representation for this waveform is derived here, and is given by

$x(t) = {a_0} + \sum\limits_{n = 1}^\infty {{a_n}\cos \left( {n{\omega _{pwm}}t} \right)}$

where

$a_0=average=\frac{T_1}{T}$

and otherwise,

${a_n} = {2 \over {n\pi }}\sin \left( {n\pi {{T_1} \over T}} \right)$

In these equations ωpwm is the frequency of the PWM signal so $\omega_{pwm}=\frac{2\pi}{T}$.

From a frequency domain perspective PWM works by attenuating the time varying parts of the signal (all of the cosine terms), but not the constant (i.e., average) term, a0. Let's examine how that works.

Consider the case when T1/T=0.6. The first five values of an are given below, along with the frequency of oscillation, and (to the right) a graph showing the amplitudes (i.e., an) at these frequencies.

 n an ω 0 0.600 0 1 0.606 ωpwm 2 -0.187 2·ωpwm 3 -0.125 3·ωpwm 4 0.151 4·ωpwm

We have already stated that the system being driven is a low-pass system, so let's assume a first order system, with a break frequency of ωlow, so

${H_{sys}}(s) = \frac{1}{{1 + \frac{s}{{{\omega _{low}}}}}}$

Note that ωlow=1/τ, where τ is the time constant we used in the time domain analyses on this page.

Recall from sinusoidal steady state analysis that if the input to a system, Hsys(s), is

$A \cdot \cos \left( {\omega t} \right)$

that the output is

$A \cdot M \cdot \cos \left( {\omega t + \theta } \right)$

where

$M = \left| {{H_{sys}}(j\omega )} \right| = \left| {\frac{1}{{1 + \frac{{j\omega }}{{{\omega _{kiw}}}}}}} \right| = \frac{1}{{\sqrt {\left( {1 + {{\left( {\frac{\omega }{{{\omega _{kiw}}}}} \right)}^2}} \right)} }},\quad \quad \theta = \angle {H_{sys}}(j\omega ) = - \arctan \left( {\frac{\omega }{{{\omega _{kiw}}}}} \right)$

We will not need to know the angle, θ, if we are only interested in the magnitude of the variations (ripple) in the output. It is value is included here for completeness.

Such a system with sinusoidal input and output is shown below.

Each of the component cosines from the input is at a frequency of n·ωpwm (with a frequency of 0 (i.e., a constant) associated with the a0 term).

$x(t) = {a_0} + \sum\limits_{n = 1}^\infty {{a_n}\cos \left( {n{\omega _{pwm}}t} \right)}$

These individual component will have their magnitude and phase changed by the system in accordance with the magnitude and phase of the transfer function so that the output is given by:

$y(t) = {a_0} \cdot {H_{sys}}(j \cdot 0) + \sum\limits_{n = 1}^\infty {{a_n}\left| {{H_{sys}}(jn{\omega _{pwm}})} \right|\cos \left( {n{\omega _{pwm}}t + \angle {H_{sys}}(jn{\omega _{pwm}})} \right)}$

If we call an·|Hsys(j·n·ωpwm)|=αn (and ∠H(j·n·ωpwm) we can rewrite the series as

$y(t) = {\alpha _0} + \sum\limits_{n = 1}^\infty {{\alpha _n}\cos \left( {n{\omega _{pwm}}t + {\theta _n}} \right)}$

Note: from here on out weLet's add |Hsys(j·n·ωpwm) and αn to our previous table (for the case where ωlowpwm/3). Immediately you see that all of the coefficients of the cosine terms in the output (the αn terms) are smaller than the corresponding terms in the input (the an terms) by a factor of |Hsys(j·n·ωpwm|, except for a0 (which represents the constant,or average, part of the PWM input). Since

 n an ω |Hsys(j·n·ωpwm)| αn 0 0.600 0 1.000 0.600 1 0.606 ωpwm 0.316 0.191 2 -0.187 2·ωpwm 0.164 -0.031 3 -0.125 3·ωpwm 0.110 -0.014 4 0.151 4·ωpwm 0.083 0.013

We can also show this visually. There are three graphs below. The first shows the values of an at various frequencies (this was shown previously, above). The next graph shows the magnitude of the transfer function (|Hsys(j·n·ω)|) over the same frequency range. The last graph shows αn, and is simply the product of the first two graphs.

By decreasing ωlow, we can attenuate the higher frequency parts of the signal even more. Here ωlowpwm/10.

### Average value

Clearly, as long as H(j0)=1, the average value of the input is equal to the average value of the output. In other words, the constant (a0) term of the input is equal to the constant (α0) term of the output because α0=|H(j0)|·an.

### Ripple

Since the coefficients of the Fourier Series drop off rapidly as n increases, we create a first order approximation to the output with just the first two terms of the series. In other words we can estimate the output as a constant, plus the lowest frequency (n=1) cosine:

$y(t) = {\alpha _0} + {\alpha _1}\cos \left( {{\omega _{pwm}}t + {\theta _{_1}}} \right)$ where

We assume all of the ripple is from this cosine, so the peak to peak ripple is 2·α1.

\begin{align} {\alpha _1} &= {a_1}\left| {{H_{sys}}(j{\omega _{pwm}})} \right| \\ &= {a_1}\left| {\frac{1}{{1 + \frac{{j{\omega _{pwm}}}}{{{\omega _{low}}}}}}} \right| = \frac{{{a_1}}}{{\sqrt {1 + {{\left( {\frac{{{\omega _{pwm}}}}{{{\omega _{low}}}}} \right)}^2}} }} = \frac{{\frac{2}{\pi }\sin \left( {\pi \frac{T}{{{T_1}}}} \right)}}{{\sqrt {1 + {{\left( {\frac{{{\omega _{pwm}}}}{{{\omega _{low}}}}} \right)}^2}} }} \\ y_{ripple} &= 2 \cdot {\alpha _1} = \frac{{\frac{4}{\pi }\sin \left( {\pi \frac{T}{{{T_1}}}} \right)}}{{\sqrt {1 + {{\left( {\frac{{{\omega _{pwm}}}}{{{\omega _{low}}}}} \right)}^2}} }} \\ \end{align}

We can put this in terms of time domain quantities by noting that the time constant of the system is τ=1/ωlow, and the period of the pwm signal is given by T=2·πpwm.

$y_{ripple} = \frac{{\frac{4}{\pi }\sin \left( {\pi \frac{T}{{{T_1}}}} \right)}}{{\sqrt {1 + {{\left( {2\pi \frac{\tau }{T}} \right)}^2}} }}$

### Worst case ripple

The worst case ripple happens when the sinusoidal term in the expression for the ripple is equal to 1, or when T1=T/2, in which case

${y_{ripple,\max }} = \frac{{\frac{4}{\pi }}}{{\sqrt {1 + {{\left( {\frac{{{\omega _{pwm}}}}{{{\omega _{low}}}}} \right)}^2}} }} = \frac{{\frac{4}{\pi }}}{{\sqrt {1 + {{\left( {2\pi \frac{\tau }{T}} \right)}^2}} }}$

### An Example

If we have a PWM input with T=1S (so ωpwm=2·π/T=6.28 rad/S) with a duty cycle of 0.6 (or 60%), pass it through a system with time constant τ=0.5S (so ωlow =2rad/S), we get the output shown below. The average is a magenta line, the ijnput is black, the exact output is blue, and the approximate output (with just the a0 and a1 terms of the Fourier Series) is green.

Note that the Fourier Series approximation is slightly shifted relative to the pulses. This is because of the angle, θ, of the transfer function (which we have been ignoring because it does not affect the size of the ripple).

References

Replace