Worked example
Example: Illustrative 3.3 V PWM at 20 kHz. The inputs, in the units selected above:
| Input | Value |
|---|---|
| PWM high level | 3.3000 V |
| Duty cycle | 50.000 % |
| PWM frequency | 20.000 kHz |
| Filter resistance | 10.000 kΩ |
| Filter capacitance | 1.0000 µF |
| Settling band as a share of the step | 0.40000 % |
Applying the formula below gives:
| Result | Value |
|---|---|
| Filter corner frequency | 15.915 Hz |
| Average output | 1.6500 V |
| Peak-to-peak ripple | 4.1250 mV |
| Settling time to the band | 55.215 ms |
Open this example in the calculator and change any input.
Formula
\(\Delta V = V_H\frac{(1-a)(1-b)}{1-ab}, \quad a = e^{-DT/\tau}, \quad b = e^{-(1-D)T/\tau}, \quad t_s = \tau\ln\frac1\epsilon\)
Variables
| Symbol | Meaning | SI unit |
|---|---|---|
| \(V_H\) | PWM high level | V |
| \(D\) | Duty cycle | - |
| \(f\) | PWM frequency | 1/s |
| \(R\) | Filter resistance | Ω |
| \(C\) | Filter capacitance | F |
| \(\epsilon\) | Settling band as a share of the step | - |
| \(f_c\) | Filter corner frequency | 1/s |
| \(\bar V\) | Average output | V |
| \(\Delta V\) | Peak-to-peak ripple | V |
| \(t_s\) | Settling time to the band | s |
Method and standards
PWM filter.
Where it is used
- Microcontroller analogue outputs.
- LED dimming and motor reference signals.
Common mistakes
- Using the corner frequency alone to judge ripple.
- Loading the filter with a low-impedance input.
Assumptions and limits
- Ideal PWM source; unloaded filter.
References
- First-order RC response to a rectangular wave
Questions and answers
How big is the ripple at 50 % duty?
With τ much longer than the period, about V_H T/(4τ): 3.3 V at 20 kHz through 10 k and 1 µF gives about 4 mV.
How do I reduce ripple without slowing the response?
Raise the PWM frequency, or use a second filter stage.
What do the defaults represent?
An illustrative 3.3 V, 20 kHz PWM at 50 % through 10 kΩ and 1 µF, settling to 0.4 % (8-bit).
Method and article reviewed by FireCAD engineering on 17 November 2026. Every result is checked against an independent calculation on each release: how we verify our calculators.
Sources
Horowitz and Hill, The Art of Electronics, 3rd ed. (Cambridge, 2015)