Infrared (IR) communication harnesses the frequency of infrared light to control nearby devices, such as a remote control changing the channel on a television, in which the output stream of IR light is modulated, i.e., modified into pulses. Using an output stream of IR light that is unmodulated, i.e., a constant 320 THz as shown in Figure 1, will not work for two main reasons: an IR receiver only recognises a carrier frequency of around 38 kHz, and the MCU of the receiving device recognises specific commands in the form of pulses. A carrier frequency of 38 kHz is standard in IR communication to prevent ambient IR light from sources such as sunlight and interior lighting from interfering.

Figure 2 represents the Samsung Protocol for IR modulation for an outgoing signal associated with pressing button #1 on a television remote control.

The blue lines represent the signal being transmitted. The Active-HIGH transmission begins with a leading edge, followed by a 32-bit code comprising the address of the receiver, a repeat of the receiver’s address, the command corresponding to button #1 pressed, and the inverse of the command corresponding to button #1 pressed, and ends with an Idle-LOW. The orange lines (shading) represent the 38 kHz carrier frequency that is generated by the electronics of the transmitter, which “carries” the signal by mimicking its “envelope.” The leading edge is represented by a HIGH and a LOW period of 9000 µs, i.e., 4500 µs each. A HIGH signal is represented by a HIGH period of 562 µs, followed by a LOW period of 1710 µs. A LOW signal is represented by a HIGH period of 550 µs, followed by a LOW period of 550 µs. The Idle-LOW at the end is represented by a HIGH period of 550 µs, followed by an Idle-LOW state.
Figure 3 provides a close-up view of the modulation for a LOW signal.

Similar to Figure 1, the blue lines represent the signal and the orange lines represent the 38 kHz carrier frequency. The green shading represents the 320 THz carrier frequency, generated by the IR LED, that is switched ON and OFF at 38 kHz. What is involved is a double modulation in which the primary carrier frequency, IR light, is modulated by a secondary carrier frequency of 38 kHz, which in turn is modulated by the signal. Dividing the HIGH period of a signal, 550 µs, by the period of the 38 kHz carrier frequency, 26 µs, reveals that approximately 21 cycles of the 38 kHz carrier frequency are required. Doing further calculations and dividing the HIGH period of one cycle of the 38 kHz carrier frequency, approximately 13 µs, by the period of the 320 THz IR carrier frequency reveals that approximately over 4 billion IR cycles are required. This is why it is impractical to display the green shading in Figure 2.
Figure 4 represents the Samsung Protocol for IR demodulation for an incoming signal associated with pressing button #1 on a television remote control.

Comparing Figure 4 to Figure 2, it can be seen that demodulation is a “mirror image” of modulation with both carrier frequencies, 320 THz and 38 kHz, “removed” by the IR receiver, leaving behind only the “envelope”/signal. The television’s MCU performs a task, i.e., changing the channel to #1, based on the incoming signal.