Pulse Code Modulation (PCM) unity Pulse Code Modulation is the method by which analog transmissions are converted into a digital (or pulse) format to be carried by a digital line or digital switch. Digital switches operate on streams of ones and zeros, while analog transmission are a waveform, hence the need for conversion from an analog signal to a digital signal is needed. PCM conversion happens in three major steps: sampling, quantizing, conversion. Lets back up for a second. When you speak into regular telephone handset, a carbon diaphragm in the handset responds to your voice, and impresses an analog signal on the wire (This impressed analog signal is the words you speak). A theoretical analog signal looks something like this: . ` ` ` . . . . . . . . . . . ---------------------------------------------- . . . . . , , . . ' ` ` But thats only in theory. Since the current in telephones is actually a DC current, our model of an analog signal has to change somewhat to reflect how a DC current operates. A DC current is a "push" current, rather than alternating it moves in one direction, "pushing" the electrons along. So the analog signal modeled in terms of a DC current would actually look something like this: ( . = electron ) ( direction of electron flow ---> ) Trough Equilibrium Peak | . . . . . . . . . . . .. . . . . | | . . . . . . . . . . . .. . . . . | | . . . . . . . . . . . .. . . . . | | . . . . . . . . . . . .. . . . . | | . . . . . . . . . . . .. . . . . | | . . . . . . . . . . . .. . . . . | | . . . . . . . . . . . .. . . . . | It becomes apparent that the actual, physical model of an analog signal is far removed from the theoretical model of an analog signal. For our purposes, the theoretical model of an analog signal will work just fine, and will be far less complex than attempting to demonstrate PCM with the "real" model. Heh. Just thought I would put that there for reference. Digital Signals Digital signals operate on an "on-off" system. Like a two position toggle switch, or a bigger and better (and faster) morse code. On a digital line, the state of the line is either on or off. In other words, the line is either pushing an electron (signal) or not. If there is no electron (signal) being pushed, then the line is zero, or off. Alternately, if there is an electron (signal) being pushed, then the state of the line is on. The model of a digital signal is something like this: ( direction of electron flow ---> ) 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 | . . . . .. . . . .. .. .. . .. . . . | | . . . . .. . . . .. .. .. . .. . . . | | . . . . .. . . . .. .. .. . .. . . . | | . . . . .. . . . .. .. .. . .. . . . | . /|\ | | You can see where the arrow indicates, that the electrons are being "pushed" close together. The presence of the proximate electrons being pushed down the line indicate a signal, or a "1" going down the line. A digital current can also be represented in the form: 1" or "on" state | | | | \./ |----| |----| |----| | | | | | | >--| |-------------------| |----| |----------> <-- Equilibrium . /|\ | | "0" or "off" state Pulse Code Modulation As previously stated, PCM encoding happens in three major steps as illustrated: Analog |--------------| |--------------| |------------| Digital (PCM) Signal | | | | | | Information --> --> | Sampling | --> | Quantizing | --> | Encoding | --> --> | | | | | | |--------------| |--------------| |------------| Sampling is the act of measuring the amplitude of an analog signal or waveform at fixed intervals. So, if given an analog waveform such as: . ` ` ` . . . . . . . . . . . ------------------------------------------- . . . . . , , . . ' ` ` The sampling step in PCM conversion would measure the amplitude of the signal at fixed intervals. The intervals are usually about 125 microseconds. . | | | | . | | | | | | | | | | | | | | | | | | <-- PAM Signal | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ' | | | | ' The results of the sampling is a PAM signal, a Pulse Amplitude Modulation signal that reflects the original amplitude of the analog signal. So, if each vertical line in the PAM Signal illustration represents a square pulse, and each space between each line represents a certian fixed time interval, then you can see that after sampling you are left with a number of values that can be converted. Sampling is often done with a number of fixed-width square pulses. These square pulses create a sampled pattern that appears like steps. Each step has a flat top, hence the name of this type of sampling, "flat top" sampling. Flat top sampling is good because the square waves are easy to reproduce. The only disadvantage of this system is distortion. Distortion can occur with square pulse sampling due to the fact that the square pulses are not the most accurate things ever created. But this can be overcome by using shorter intervals for the square pulses, ie to use more square pulses. Square pulse shapes are also easy to re-transmit, so repeaters will have an easy time re-transmitting the shapes, if that is neccessary. After the analog signal is sampled, each sampled value has to be matched to the closest cooresponding value (quantizing step). This process is illustrated below. 4.50 | . | | | | . 3.00 | | | | | | | | | 2.50 | | | | | | | | | | | 2.00 | | | | | | | | | | | | 1.50 | | | | | | | | | | | | | 1.00 | | | | | | | | | | | | | 0.50 | | | | | | | | | | | | | 0.00 | -------------------------------------------- 0.50 | | | | | | | | | | | | 1.00 | | | | | | | | | | | | 1.50 | | | | | | | | | | | | 2.00 | | | | | | | | | | 2.50 | | | | | | | | | | 3.00 | | | | | | | | 3.50 | ' | | | | ' Each step in the sampled pattern has to be matched to a co-responding quantizing step so that the third step, the converter will have a finite set of values that it is required to convert. It is not feasible to expect the converter to pass the exact values that the sampler gets, because this would lead the converter to having to create patterns that could be infinately large. Hence the need for a fixed-amount of decimal places that the sampled signal could be rounded to, as illustrated in the above picture. The difference between the nearest quantizing level and the actual sampled value is called "quantizing noise". This quantizing noise can be reduced by using more quantizing levels, but this also increases the number of different waveforms (bit patterns) that the converter is responsible to create. There are two types of quantizing, linear and non-linear quantizing. Liner quantizing has evenly spaced quantizing steps. Non-linear quantizing does not. The human voice is generally focused more on the low-amplitudes rather than the high amplitudes. Non-linear quantizing can be used to reflect this, by putting more quantizing steps near the lower amplitudes, and using less quantizing steps for the higher amplitudes. Once the quantizer has matched each value passed by the sampler, it forwards the newly rounded (ie quantized) values to the converter, which creates a stream of bits (or bit pattern) for each quantized value. The converter then passes the digital signal onto the digital network, which will then transmit the signal across the network to the destination where the signal will be converted back into an analog signal and sent to the receiver. [shouts:] StankDawg and w1nt3rmut3: RFA is amazing. Miscellaneous elite people: Epiphany, Scramble45, Token, Intrepid Sanguin, Data_Nose, All at stankdawg.com, undergroundsystems.org, hackershomepage.com, port7alliance.com. [/shouts] K-1ine owns you. You know it. - Timscott 07/26/03