# DC Components and Frequency

I have started learning digital communication and was on line coding. I read there are certain characteristics that we need to keep in mind while choosing the right line coding method. One of these is considering DC component. I'm not quite able to understand what DC component really is, what and why does it poses a problem in digital communication?

To explain my doubt, I would like to tell two different definitions of DC component (at least they seem different to me) that I read from two different sources. First,

Signals creates very low frequencies when the voltage level in a digital signal is constant for a while. These frequencies around zero are called DC components, creates problems for a system that cannot pass low frequencies or system that uses electrical coupling.

Second,

Over one cycle period of a waveform, if all the positive voltages are cancelled by negative voltages, then, DC component of the waveform is 0. In line coding, the signal with the non-zero DC component is treated as a distorted one and it can create errors in received signals.

I don't seem to have any clue about what the first definition wants to say. As far as I know, the definition of frequency is number of cycles completed per unit time. Actually, how do you even measure the frequency of a digital signal? And how does it relate to the DC component?

I understand the second definition in itself pretty well but I don't understand how does it relates to the first definition. Also, what problem does it poses in transmission if the positive voltages do not cancel the negative ones?

P.S : A less mathematical reply would be highly appreciated since I'm new to this field.

The simplest waveform is one that encodes a bit $$1$$ with a pulse of positive amplitude, and a bit $$0$$ with a pulse of equal but negative amplitude. You may think that, for random bits, the negative pulses cancel out with the positive pulses and the average DC level of the signal is 0. This is in general not true over short time periods; even random bits will have sequences with many more $$1$$'s than $$0$$'s, or viceversa. This differential causes the signal's DC to grow, which causes distortion at the receiver end.
Line encoding can help with this problem. For example, the Alternate Mark Inversion line code encodes a bit $$0$$ to a pulse of amplitude zero, and a bit $$1$$ to pulses of positive and negative amplitude, alternating. So, every positive pulse is followed by a negative pulse, and the signal's DC never builds up.