6 ms·
Reverse Engineering a Real Candle
- jedberg 11y agoThis is awesome! Finally empirical evidence to back up what I've felt all along -- that those fake LED candles don't look anything like a real candle and are actually kind of distracting. That animation at the end really sums it up nicely.
- TranquilMarmot 11y agoI wonder if it would be possible to use this data to create an LED candle with a super-sensitive microphone that would realistically flicker when "disturbed", otherwise be a mostly consistent brightness. Or are there better sensors than microphones to detect air disturbances?
- detaro 11y agohot wire aenometers can detect even tiny air movements
- semi-extrinsic 11y agoBut they're bloody expensive and quite fragile. The cheapest unknown-brand ones I've seen on Chinese websites is ~ $100.
- nomel 11y agoOh come on. Some fine thermocouple wire wrapped around a literal hot wire would be enough, no need to use industrial grade scientific equipment.
- semi-extrinsic 11y agoThat wouldn't give you anywhere near the resolution of an actual hot wire anemometer. I'm fairly confident your instrument would be limited to measuring "is the wind below or above 60 mph?", and would be unable to resolve changes happening in less than ~ 10 seconds. Real hot wires have a diameter of ~ 1/100 of a millimeter, that's the only way to achieve any useful level of sensitivity.
- bsder 11y agoUltrasonic emitter and detector could possibly detect a doppler shift.
- TeMPOraL 11y agoA pressure sensor maybe?
- heygrady 11y agoLooking at the rapidly flickering LED image I imagined an engineer showing the data to his manager, "well, a real candle looks like this: kind of sedate and boring." Followed by the manager insisting that it gets a little livelier, saying something like, "if people can't see it flickering they'll thing it's broken. Make it very obvious that it flickers. I don't care if it looks real. I care that people can tell it's flickering"
- dexwiz 11y agoI wonder how you could apply something like this to transition animations. The simulated flicker ended up looking much better than the LED flicker. Sometimes I see animations in UI. Some look completely natural, and some are horribly jarring. I know there are all sorts of curves that tweening uses to time its path. I wonder if reversed engineered curves would look better.
- vvanders 11y agoIt's almost always the case of using linear interpolation(which is what every UX-naive developer reaches for) instead of proper ease-in + ease-out which more appropriately models physical movement. Even very subtle changes in the tangents of the curves can have drastic effects and it's frustrating to see some platforms limit them to a few preset curves.
- SapphireSun 11y agoSometimes you don't have bezier curves. I found a formulation of ease-in-out that gives developers no excuses. ;) https://medium.com/analytic-animations/ease-in-out-the-sigmoid-factory-c5116d8abce9 https://medium.com/analytic-animations/ease-in-out-the-sigmo...
- vvanders 11y agoGood idea, but that exp() function makes my inner perf-nerd twitch a bit. I'm personally a fan of pre-generating a fixed set of points that are linearly interpolated and scaled. It has a few advantages: -Extremely cache friendly, can even be cheaper than computing a spline on a lot of platforms since it's essentially just a look up table. -Your curve doesn't need to fit any specific formula(I.E. you can have a step function as part of it if you want). -You can pull data from design applications to generate the curve allowing non-developers to have control over look-and-feel if you want to get that fancy.
- SapphireSun 11y agoDon't forget, when you use these transitions, that computation is a very small fraction of the animation as it's run once by the CPU. You can think of it as setting a uniform on a shader. The other reason I like using analytic functions is because: 1) You can easily generate a linearly interpolated point set if you want, I've done it for CSS in stylus (for spring animations that can't be represented by a single bezier). 2) With the right formulation, it's very easy to tweak the shape as it is in this case 3) You can analyze the functions easily
- aidenn0 11y agoFWIW, the initial loss of brightness is almost certainly due to a reduction in temperature a the fuel/air mixing piont. Blowing on a fire actually increases the oxygen available.
- guitarbill 11y agoThis is cool. Is the candle-flicker gif based on the algorithm, or the actual output from the LED? Because I assume the LED will smooth out some features. Vice versa, the LED probably needs to be driven with different data to produce the equivalent brightness variation.
- mrob 11y agoLEDs are extremely fast. The LED itself will add no perceptible smoothing. You could easily add a capacitor for low-pass filtering, but that would add cost so it's unlikely to be done.
- hamiltonkibbe 11y agoThey're fast until you start trying to use them to transmit data at a few tens of megabits/s. Laser diodes, on the other hand, are fast
- chc 11y agoWhat does this have to do with anything?
- hamiltonkibbe 11y agoIt's a different perspective, I've spent a significant amount of time working with LEDs in a context where the rise time is important, and the fact that LEDs are slow (in this context) provided a significant challenge. I guess the phrase "LEDs are extremely fast" struck me the same way a pedestrian telling you "walking is the fastest way to get around" when you're stopped at a red light in a Lamborghini would
- mrob 11y ago"Extremely fast" doesn't have any absolute definition. We were talking about human visual perception, so "fast" in this context could reasonably mean "fast enough to have no visible smoothing". A typical LED is much faster than that, so in the context of fake candles I think "extremely fast" is fair. In the context of data transmission it would mean something else.
- stygiansonic 11y agoThe part about the harmonic oscillation frequency in the flame flicker is most interesting: "The frequency of these oscillations seems to be around 5 Hz, drifting up, and seems to be a fundamental parameter of the flame since it appears to be relatively constant in all observations." It appears that some (optical) flame detectors work by obtaining the frequency of this flicker: [1] "This flame scanner also monitors the rate of combustion by analysing the flicker frequency, or the fingerprint, of the flame... Since the flame is always burning back to the fuel source, the flame is always in motion. This motion allows the intensity of the flame to vary across a flame flicker frequency spectrum." From that link, it appears that the "flicker frequency" would be related to the exact fuel source and possible fuel/air mixture ratio, as the "flame is always burning back to the fuel source". Some other information about flame frequency-flicker: [2] "Under normal gravity conditions, the flames have a well defined oscillation frequency which is inversely proportional to the square root of the burner diameter, D, and to a good approximation can be written as f » 1.5/D½, with D given in meters." So, it would indeed seem that the flicker frequency is related to the particulars of the candle, its wick, etc. Very interesting article! 1. http://www.coen.com/wp-content/uploads/2010/05/HydrocarbonWorld.pdf http://www.coen.com/wp-content/uploads/2010/05/HydrocarbonWo... 2. http://www.dantecdynamics.com/flow-characterization-of-flickering-methane-air-laminar-diffusion-flames-using-piv http://www.dantecdynamics.com/flow-characterization-of-flick...
- megalodon 11y agoThis reminds me of the quote "How much can the ripples tell us about the object that fell in the water?"
- semi-extrinsic 11y agoOr even the famous question "Can you hear the shape of a drum?", to which we have a constructive proof (under some mathematical idealizations) that the answer is " No". https://en.m.wikipedia.org/wiki/Hearing_the_shape_of_a_drum https://en.m.wikipedia.org/wiki/Hearing_the_shape_of_a_drum
- 11y ago
- jawarner 11y agoGreat breakdown. The animation at the end is more convincing than any fake candle I've seen. I'll make sure to use your model if I ever need to simulate flame lighting in a game. Nitpicking, but I think this is technically data modeling and not reverse engineering.
- knicholes 11y agoI can imagine feeding in the output of the photoresistor into char-rnn and sample from that to "randomize" the light intensity.
- iamleppert 11y agoVery interesting take on the subject. Of course, I think to simulate a real candle, one would have to have some way of measuring air current. If I see a fake candle flickering, and feel no air current, I'm going to be less likely to think it's a real candle. An LED candle the responds to its environment, could be "blown out" for instance would make a great little hack project.
- miniatureape 11y agoReminds me of: http://tomgerhardt.com/fireLight/ http://tomgerhardt.com/fireLight/
- baroa 11y agoI would buy an artificial candle that flickers when it detects air
- OrdaGarb 11y agoI've had breadboards like his react to air flow. Those cheap ones especially have such horrible connections that the slightest motion of flimsy part like a resistor or LED wagging in the breeze will cause a significant change in impedance where the leads meet the contacts. Since this signal is dependent upon the series resistance, the output could vary as a result.
- TeMPOraL 11y agoThe article[0] linked as an example of constrained random walk has a video that's creepy and pretty unsettling. It's interesting how sprinkling some randomness on things we're used to can make our brains go weird on us. [0] - http://cnr.lwlss.net/ConstrainedRandomWalk/ http://cnr.lwlss.net/ConstrainedRandomWalk/