Technically speaking, modulation involves combining two signals, either of which can be analog or digital, to produce a resultant signal, which can be analog or digital. Encoding, then, is the representation of data by a signal using any method. Finally, digital data is also regularly represented by digital signals. Any time you send e-mail, load a file, or download Web pages, you're encoding digital data with digital signals. The enemies of both analog and digital signals include attenuation, noise, and crosstalk.
Attenuation is the tendency of a signal to get weaker with distance.
Analog signals must be amplified before they become too diminished to be detectable. Unfortunately, analog signals accumulate noise with repeated amplification. Digital signals, while they are degraded by attenuation, can be detected and repeated indefinitely with no loss of data. This property is one of the principal reasons digital communication became increasingly important in the last years of the 20th century. Noise is the backdrop of the universe.