I came to a project where some LED lamps are being controlled with Randomized Sigma-Delta PDM. Each lamp has one MCU and about 100 cold white LEDs and more 100 warm white LEDs. The PCB is divided in the main part (with the first 10 LEDs, MCU and a few sensors) and the rest just dumb LEDs with current driver. The MCU uses 4 PDM outputs: 2 (cold light PDM + warm light PDM) used on the main part and the other 2 carried on to the rest of the board. I was wondering why not use simple PWM? Is that only due to EMI? If so, is it possible to estimate (magnitude at leas) how worse the EMI could be using normal PWM with constant pulse width within a cycle?

The way I see you cannot use too low frequencies with normal PWM because you probably see the flickering and also not to high frequencies to avoid high EMI. But I was wondering if you still can use normal PWM with good/similar results (so it's even much easier to verify the result with an o'scope later compared to random pulses, for example.).


Here's the reference for the datasheet explaining the Randomized Sigma Delta PDM:


and the Regular PWM is the normal PWM you usually find in MCU's which you only set the frequency and the duty cycle and you get a regular square wave.

  • \$\begingroup\$ What is PDM in contrast to PWM ? Arent they the same. Or did you mean pulse frequency modulation? \$\endgroup\$
    – Grebu
    Sep 1, 2016 at 9:18
  • \$\begingroup\$ Pulse Density Modulation. Pseudo-random intervals between pulses don't really lend themselves to being called a pulse "frequency". Pulse width can be fixed unlike PWM (but doesn't have to be). \$\endgroup\$
    – user16324
    Sep 1, 2016 at 9:22
  • \$\begingroup\$ reference the project please, it would be useful to see what advatnages they are claiming for sigma delta PDM (pulse density modultion I think???) Any flashing of LEDs on and off will cause EMI and optical problems. \$\endgroup\$
    – Neil_UK
    Sep 1, 2016 at 9:22
  • \$\begingroup\$ As far as I know PWM is a special case of PDM, but I might be wrong then. \$\endgroup\$ Sep 1, 2016 at 9:23
  • \$\begingroup\$ Yes PDM is Pulse Density Modulation. I was wondering if non-random switching would create more harmonics...does that make sense? \$\endgroup\$ Sep 1, 2016 at 9:24

1 Answer 1


There are two main reasons PWM is commonly used instead of some error accumulation method: Known and fixed lowest frequency content, and that it's built into just about any microcontroller.

With basic PWM outputting a fixed value, you know there are no frequencies in the output below the PWM frequency. This is important for filtering it out. In the lamp example, you can easily guarantee that none of the switching will be visible.

With error accumulation, the lowest frequency could be much lower. In error correction with infinite precision, the lowest frequency content can be infinitely low. This, of course, makes it impossible to guarantee that it doesn't get down to the valid signal frequency range. In the lights example, you can't guarantee that there wouldn't be some component in the visibly detectable range, meaning the lights could be seen to flicker by human observers.

The usual reason for doing error accumulation is to get better precision. With PWM, the number of possible output values is the number of slices per PWM period + 1. For example, with 10 µs PWM period (100 kHz frequency) and a slice time of 500 ns, you only get 21 possible output values (duty cycles of 0-20).

In practice, error accumulation usually uses finite precision such that the lowest output frequency is bounded. For example, N-period dithering is a common way to do pre-computed error accumulation. With N slices per PWM period and M-period dithering, you get MxN+1 total possible output values. Note that this is the same value as using a MxN slices per period in the first place, meaning the period is M times longer.

Since dithering produces the same worst case, and that's what you have to design the filters and the rest of the system to anyway, it is rarely used instead of just making the PWM period longer. The few times I've used dithered PWM have been to work around hardware limitations where there weren't enough independent clock sources and the PWM had to run at a higher frequency because something else needed that frequency. Dithering is also more complex because you have to be able to adjust the duty cycle every period, even for fixed output values.

Even with infinite precision error accumulation, the amplitude of the frequencies gets lower as the frequencies get lower. Below some frequency, the amplitude is below the noise floor, what you otherwise care about, or the period is so long you're going to be adjusting the output value anyway. I used a system like this to control a large number of resistive heaters from a single micro once. The slice time was 250 ms, a very "long" time for the micro. Each slice, the micro updated all the error accumulators with the result deciding for each heater whether it would be on or off during the next 250 ms slice. The first order time constant of the heaters was 10s of seconds, and they were inside a feedback loop that also ran every slice, so the small low frequency amplitude was buried in the noise by the time it got low enough to matter.

  • \$\begingroup\$ thanks for the very nice response. But so you're basically saying that probably there should be a solution with regular PWM if I choose the right values for frequency, resolution, clock, etc? The guy that developped this Sigma-Delta solution said when dimming the lamps below some line (say 5%) you can see the dimming steps if you use regular PWM but not if you use this other solution (which I guess you called error accumulation method) \$\endgroup\$ Sep 2, 2016 at 10:46
  • \$\begingroup\$ @Felipe: Error accumulation can produce more desirable frequency content at some settings, but the worst case is worse than brute force PWM. If pulses can be seen at some settings, then the period is too long. Microcontrollers and electronics can easily switch at 10s of kHz, so a suitably fast slice time and PWM period should be achievable. \$\endgroup\$ Sep 2, 2016 at 10:51
  • \$\begingroup\$ it seems the visible pulses are not the only problem. If the period is too long you can see them but if it's too short then for low dimming the pulses will be too short. It seems you can't switch too fast because of the EMI so when you reduce the switching slope and make pulses too short, you create a triangular pulse. Then the LEDs that are more far from the MCU, receive much less power so you can see the light difference between the ends. And also, says him that below some point (say 5%) you can see every bit step on the duty cycle (the dimming is visibly discrete, not smooth) \$\endgroup\$ Sep 5, 2016 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.