Math Bridge: LED PWM and Camera Aliasing

← Back to Visual and Audio Actuators
Math BridgeActuatorsStruggle-friendly runway

Why can a fast LED still flicker on camera?

One thread from duty-code resolution to temporal aliasing.

Max, the actuators guideMax guides
The one targetCompute the camera beat from PWM and frame rate.
The chapter case8 bit, 5 V, 5 kHz, 24/25/30/60 fps.
What it buys youTest indicators with the observer that matters.

A technician must decide whether camera alias at 30 fps is safe before changing led pwm frequency on the real device. The result is unresolved until the rule and units are checked. Predict the direction first.

See the relationship before changing it

The figure reads from left to right. The blue card is led pwm frequency. The middle card applies this page's rule. The green card is camera alias at 30 fps. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only led pwm frequency, so the numeric fixture does not switch without explanation.

LED PWM frequency changes camera alias at 30 fps An input card leads through the rule alias = |PWM frequency - 30 x round(PWM frequency / 30)| to the camera alias at 30 fps result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. A small PWM-frequency change can move the slow beat seen by a fixed camera.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 5000 Hz.

  2. 2

    Name the relationship. alias = |PWM frequency - 30 x round(PWM frequency / 30)|

  3. 3

    Substitute with units. |5,000 - 30 x round(5,000 / 30)| = 10 Hz

  4. 4

    Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.

Predict, then change led pwm frequency

Try Predict the direction of alias = |PWM frequency - 30 x round(PWM frequency / 30)|. Test another led pwm frequency, then compare camera alias at 30 fps.

5000 Hz
Chapter baseline
Camera alias at 30 fps

Observe A small PWM-frequency change can move the slow beat seen by a fixed camera. Reset led pwm frequency to 5000 and compare camera alias at 30 fps.

Explain A small PWM-frequency change can move the slow beat seen by a fixed camera.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only led pwm frequency moves here. Field effects named in the technical boundary stay fixed.

1. The eye and camera are different sensors

The naked eye can average fast PWM into steady brightness. A camera samples in time and can fold the same switching into a slow beat.

Max: “Too fast to see” is not the same as “safe for every camera.”

2. Quantise brightness

1

Count intervalsThe chapter uses 255 full-scale code intervals.

2

Divide the 5 V spanq=5/255=19.6 mV.

3

Compare perception0.392% is about 2.5× finer than a 1% illustrative Weber fraction.

3. Fold the switching frequency

falias=|fPWM−round(fPWM/fs)fs|

Subtract the nearest whole number of camera samples. The leftover is the slow beat that can appear as visible banding.

4. Try the camera frame rate

q=V/255; noise=q/√12; SNR=6.02N+1.76; falias=|fPWM−round(fPWM/fs)fs|

TryMove the nominal camera frame rate while the LED remains at the chapter's 5 kHz PWM.

Visible beat
Ideal 8-bit SNR
5 V code step
RMS quantisation
Duty step
Finer than 1% eye floor

ObserveThe chapter's 5 kHz PWM aliases to 8 Hz at 24 fps, 0 Hz at 25 fps, 10 Hz at 30 fps, and 20 Hz at 60 fps.

ExplainThe same nearest-sample subtraction drives every beat result. Brightness resolution stays separate because its formula uses voltage and code count, not frame rate.

Technical boundaries.

A frame-rate model does not reproduce rolling-shutter line timing, exposure duration, PWM edge shape, LED/driver dynamics, camera auto-exposure, display processing, or human flicker sensitivity.

Test the target camera and lighting geometry
Needs separate evidence

Use field evidence or a deeper model before release.

5. Interpret zero carefully

At an exact 25 fps, 5,000/25 is an integer and the frame-rate beat is zero. That does not guarantee a rolling-shutter image is band-free.

6. Design for the observer

Record PWM frequency, duty, camera frame and line timing, exposure, brightness, geometry, and whether banding appears. Change frequency or add filtering against the actual target.

7. Check yourself

Why does 24 fps produce 8 Hz?
Answer: 5,000−208×24=8 Hz after subtracting the nearest sampled multiple.
Does 8-bit PWM guarantee a smooth-looking fade?
Answer: No. It only bounds command steps; the LED, driver, eye, and camera set physical response.
Does a zero frame-rate alias prove no banding?
Answer: No. Rolling-shutter line sampling can still expose PWM structure.
Honesty boundary.

These are the chapter inputs, worked results, and named teaching assumptions.

8-bit
Digital resolution or converter setting
5 V
Voltage or voltage-step value
19.6 mV
Voltage or voltage-step value
5.66 mV
Voltage or voltage-step value
49.9 dB
Gain, loss, margin, or level ratio
0.392%
Percentage, ratio, or gain
1%
Percentage, ratio, or gain
5 kHz
Frequency, sample rate, or event rate
24/25/30/60 fps
Frequency, sample rate, or event rate

They do not certify a particular camera or viewer; Under the Hood keeps those limits.