Short for coder-decoder. A device that converts an incoming analog signal into an encoded representation as a digital stream (the coder), and converts an incoming stream of digital signals into an analog signal (the decoder). Codecs are used in both telephone and video systems to convert an analog speech or video signal into a digital form, which can then be treated as a stream of data for the purposes of transmission and switching; the advantages are that digitally encoded signals can be transmitted at higher data rates, with lower error rates, and are more readily switched using packet-switching means than can be achieved by circuit switching.
All codecs operate by sampling the analog signal at a sufficiently high rate (of the order of twice the frequency of the highest Fourier component that is to be transmitted). At the transmitting end, the sampled signal is converted by an A/D converter to a digital form with the necessary precision, and the resulting bit stream is transmitted across the network to the receiver's codec. At the receiving end each sample is converted by a digital-to-analog converter to recreate an approximation to the original analog signal. These same techniques can be applied to the storing of a signal, for example in a standard computer file, for later replaying.
A standard telephone codec operates at 8000 samples per second, and generates an 8-bit digital value for each sample, giving a total data rate of 64 000 bps. This is adequate for the realistic reproduction of speech, with a nominal frequency response up to 4 kilohertz and with a nominal accuracy of 0.4%. For broadcast-quality or high-fidelity audio transmissions, higher sampling rates and greater precision are used, giving a signal with a higher bit rate. It is also common to add redundancy to the digitally encoded signal to allow error recovery. For example, a normal compact-disk system uses two channels, each sampled approximately 44 000 times per second with 16-bit precision, giving a total data rate of 176 Kbytes/second. Many codecs use compression techniques (both lossless and lossy) to reduce this data rate.
A video codec must handle much higher sampling rates, and a variety of techniques are used. Rather than simply digitizing a standard broadcast composite video signal, which includes one or more audio channels as well as synchronization information, it is common practice to treat the video line and frame synchronization separately, and to isolate the audio from the video. It is also common to apply a considerable amount of data compression, in the digital domain, to reduce the overall bandwidth of the digital output. For videoconferencing the codec produces an encoded output at 128 Kbps, which can be transmitted over two B-channels of ISDN; the result gives a high-grade audio signal but with noticeable degradation of the colored video image, especially where the scene includes rapid movement. Other systems use higher data rates, achieving correspondingly improved video quality. For broadcast-quality video very high sampling rates are required, with a resulting high bandwidth for the digital signal.