Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You would need a frame rate 2x the fastest PWM cycle. Nyquist-Shannon and etc...


Hmm why can't you construct the signal amplitude from webcam image? You don't have to capture it as digital signal...


Yeah, it's not necessarily to perfectly reconstruct the LED's signal, only the average amplitude over a relatively long period of time. Like, just sample the color of a certain pixel on each frame.


If the LED being used has a perfectly linear current-to-brightness curve then sure, it's possible. Most high-brightness LEDs, however, do not.


But you could just map the current-to-brightness curve of your own LED and reconstruct the necessary PWM signal using that. Actually that'd be a good way to go anyway, since that curve may differ from the one on Apple's LED.


Generating a PWM signal based on a particular LED's characteristics is similar to designing the gain of an amplifier circuit around a particular BJT's beta. It's just not done. That's also the whole reason behind controlling LED brightness through PWM. By PWMing the drive current, you can ensure that the LED is being driven far into its conducting region, and therefore not relying on controlling dimness by varying current around the LED's "knee" (which literally is different for just about every LED in existence, even same part numbers). This way you also avoid other stuff like wavelength shifts that tend to occur near the knee.


It would be more like at least 10x the PWM frequency, if you wanted to see a square waveform.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: