# How is digital information encoded/decoded in light or radio waves?

I know exactly how DAC and ADC works; that's not my concern.

What I am asking is how the constituent state of matter (and the "states" represented by them) in a circuit can be transferred to a set of photons (with no mass) and hold varying "states" within the analog light or Radio Waves?

I guess a simple question would be, how does electronic power get turned in to encoded data within radio waves, and how does the encoded data get decoded back in to electrical power/matter from an energy level?

## Encoding:

Information can't be "transferred to a set of photons (with no mass) and hold varying "states" within the analog light". The photons themselves do not store/carry the information inside them, but the variations in the number of photons (flux, intensity), or the variation in the frequency of photons can carry information.

"Constituent state of matter (and the "states" represented by them) in a circuit" are (usually) just varying voltage levels. These voltage levels can be converted into varying light intensity or varying frequency by various devices (the most widespread are LEDs and lasers). Thus, the (digital) information present in your circuit can be converted into light using relatively simple schemes - just turn the light ON and OFF in some predetermined manner (e.g. Morse code as suggested by @Passerby).

Radio waves, on the other hand, is all about sinusoidal signals. Yes, from theoretical point of view one can think of light and radio waves as being the same, but this approach does not work in real world. You can not transfer "digital radio wave pulse" wireless - you must send sinusoidal signals. If you are bound to use sinusoidal signals, then there are three parameters that you can change in order to encode your digital information: amplitude, frequency and phase. This encoding is called modulation, and it is very large topic (with many mathematical aspects).

Note that even though you can send digital information over light without employing modulation schemes, there are cases where the light's intensity or frequency may be modulated with digital information. The reasons for this complication may be: higher signal's integrity, higher SNR, higher bit rate and many more (the table applies to communication over fiber optic only):

However one of the most important advantages of modulation (maybe even the most important one) is that modulation allows for sharing a single physical media (both wired and wireless) between numerous logical channels. For example: phone, internet and TV can be "delivered" in parallel (simultaneously) over a single optic fiber cable when appropriate modulation scheme is used.

## Decoding:

There are electronic devices which convert varying light's intensity or frequency back to varying voltage levels (the most common are photodiodes and photovoltaic cells). Once your information is represented by voltage levels, you're back in the usual electronics design. Various demodulation schemes may need to be implemented, depending on the modulation schemes initially used.

For radio waves the same is true, but the received signal is a modulated sinusoid, therefore demodulation schemes are always used. The device which receives radio waves and converts them into voltage levels is called "antenna".

• Excellent breakdown. Only thing I would add is that the simplest form of encoding data into light, is by turning it on and off in a pattern. A led blinking in morse code is an example of this. Oct 4, 2013 at 6:16
• @Passerby which is OOK, which in turn is a form of AM, and is therefore referenced above. Oct 4, 2013 at 9:49
• @markt in so many words. Sometimes its better to spell it out plainly, for educational purposes. Oct 4, 2013 at 10:01
• @Passerby, I edited the answer. I indeed tried to explain in words a concept which is easier to demonstrate as an analogy to Morse code. Thx Oct 6, 2013 at 18:16
• The question is really too broad for this site. A complete answer should also talk about coherent modulation on the optical side and DPSK/QPSK and a bunch of other modulation schemes on the radio side. Oct 7, 2013 at 0:26

Imagine 1 and 0 simple bit patterns 1 means high voltage and 0 means low voltage. now 7 of these 1 and 0 form ASCII codes 0100-0001 (41 in hexadecimal) equivalent to A. Now consider this every time you press a key on keyboard this bit pattern gets transmitted to processor and processor then finds character using look up table and display it on the screen. In TV remotes similar type of conversion takes place using infrared sensor. A transmitter in the remote and receiver in the TV. Suppose each button of the remote is hard coded into a bit pattern and the bit pattern and corresponding function is saved in TV. An infrared red detector at TV detects on and off condition of the remote, similar to a light switch getting on and off.