Flickering Lights - Theory

We define "flickering lights", as turning on and off with a random or irregular timing, which does not seem to repeat. This is in contrast to "flashing lights", which have obvious regular on-and-off cycles.

There is commercial flicker stuff for those who require a reliable solution rapidly.

This page gives an introduction and theory. We have another page for practice and implementation.

----------
Here are some flickering light tips for those interested in a do-it-yourself approach... Now, we delve into the technical details behind generating flicker...

----------
 

What is flicker good for?

Flickering lights are useful for a variety of effects: All of these illusions involve light that irregularly wavers in intensity.

We are concerned mostly with flicker used to simulate flame. This is what we have in mind when we make pronouncements like "flicker is mostly on". In this, we attack the worst case. Hopefully, any other applications of flicker will be easier.

 

What are the basics of flame flicker?

The basics of flame flicker are: random variations, motion, smooth transitions, and mostly on. We will cover these in no particular order:

There are, of course, exceptions to these rules. The logs in a fireplace, when burning high, have more variation then embers. And in either case, the burning can be punctuated occasional sudden small explosions.

I should probably mention a bit about color. The short part is that candle flames are mostly white. Red LEDs make poor candle flames no matter how sophisticated the flicker. If you like LEDs for their low power draw, go for the palest yellow you can find. White LEDs are available, but have a slight blue cast to them. If your light source is close to white, you can color it however suits you.

 

Randomness and pseudo-randomness

Quick - tell me the significance of the following numerical sequence: "1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3." Looks fairly random, doesn't it? It's not - these are the first few digits of the transcendental constant Pi. Armed with the proper equations, you can crank out these digits all day long. And somebody who just happened to hear you chanting "2 3 8 4 6 2 6 4 3 3" would have no idea that he was hearing part of a predictable sequence.

This is the key concept behind pseudo-random numbers. They aren't really random, but seem to be. Instead, they are part of a predictable sequence presented in such a way that you don't know, notice, or care that it's not entirely random.

Having a stream of pseudo-random numbers can be very helpful in flame simulation. Consider a small light bulb that is fed from a lamp dimmer, which is calibrated with intensities from 1 to 9 (0 is off). You station your helpful assistant Igor at the dimmer and give him a list of the digits of Pi. Once every second, Igor adjusts the dimmer, matching the knob to the next digit in the sequence. And your visitors just see the fireplace, cheerfully burning softly (2), brighter (3), flare-up (8), and drops (4), flares back up a little (6), and dies down (2).

Our goal, of course, is to free Igor for more interesting tasks by automating this sequence.

 

Making Long Sequences From Short Ones

Your friends in the creation of sequences that appear random are length and combination of smaller sequences.

The longer a sequence runs before it starts to repeat, the less chance the viewer will recognize that a pattern exists. You might not get away with a short pattern like "1 4 1 5 1 4 1 5 1 4 1 5", that repeats after just four digits, but you might well get away with a sequence just ten times longer.

Now, let's consider two sequences. One is short: "1 2 3", and the other just a tad longer "1 3 2 4". Let's write those out, one above the other, repeating several times, and then add the numbers to make a new sequence:
sequence A 1 2 3 1 2 3 1 2 3 1 2 3
sequence B 1 3 2 4 1 3 2 4 1 3 2 4
sequence C=A+B 2 5 5 5 3 6 3 6 4 4 4 7
Thus, from one sequence 3 digits long, and another four digits long, we can generate a sequence 12 digits long. We'll be using that trick a bit later to get long, random-looking sequences by mixing together the output of several very predictable and regular oscillators.

The above table applies if you have two sequences with exactly sequenced transitions, so that A goes 1->2 at the same time that B goes 1->3. This is a reasonable assumption for a digital device that generates more than one output. But in the analog world, there will probably be no synchronization whatsoever. This is a good thing, because the output will never exactly repeat.

 

Integration and smoothing

A common fluorescent lamp turns on and off 120 times a second. But it looks like perfectly servicible and continuous illumination, because of the persistence of vision. A television screen displays 60 different images a second. But they blend into a single smooth image. A movie projector shows 24 pictures a second. But the projected image looks like smooth motion.

Basically, your eye is relatively slow to react to brief optical events. Your eyes might be fast enough to watch a bee zip across the garden, but if something is fast enough, you will miss it. That's because our eyes, indeed our entire nervous systems, are made of chemical components that have to undergo chemical reactions in order to generate, conduct, and switch tiny electrical impulses. We would be more effective if our electrical systems were connected with copper wire. But that's not the way we were designed.

The good news is that the slow reaction of our eyes allows us to play some clever and fun tricks on ourselves, not the least of which are the products of Hollywood.

Consider a lamp that goes on and off 120 times a second - too rapidly for our eyes to see individual transitions. Let's say that it spends half the time on and half off. Such a lamp would look half as bright as one that was on all the time. And if you adjusted the lamp for shorter "on" times, so that it was on for a quarter of the time, it would be a quarter as bright as the full-on lamp. Even though it was still turning on and off 120 times per second. {For the sake of simplicity, I am assuming linearity. I understand that it's not, and if you're so smart as to argue, why are you reading this primer anyway?}

This technique is called "pulse-width modulation", or "changing the duty-cycle". And it works for a lot of things - you can adjust the speed of a DC motor by feeding it power in pulses with adjustable duty-cycle. Incandescent lamp dimmers pulse-width modulate the 110 VAC feeding the filament.

The key to getting away with this is having some element somewhere in the system that averages the on-and-off into smooth, continuous variability.

 

Final notes

----------

Thank you for visiting. Your comments are welcome.
[back] . . . [paper and pen] . . . [tip jar]

©Copyright 2000-2004 by The Wolfstone Group. All rights reserved. You must read and abide by our terms of service.