Lecture 10: Quantizing & PCM 1nd semester 1439-2017 By: Adal ALashban 1 Introduction - A digital signal is superior to an analog signal because it is more robust to noise and can easily be recovered, corrected and amplified. - For this reason, the tendency today is to change an analog signal to digital data. - Changing analog signal to digital signal: Sampling Quantizing 2 3 Quantization - In order to process the sampled signal digitally, the sample values have to be quantized to a finite number of levels, and each value can then be represented by a string of bits. - To quantize a sample value is to round it to the nearest point among a finite set of permissible values. - Therefore, a distortion will inevitably occur. This is called quantization noise (or error). 4 Quantization 5 Modulation Continuous wave (CW) modulation Pulse Modulation Angle modulation AM FM Analog Pulse Modulation Digital Pulse Modulation PM PAM PPM PDM DM PCM 6 Pulse-code Modulation (PCM) - Pulse-code Modulation (PCM), like PAM, is a digital communication technique that sends samples of the analog signal taken at a sufficiently high rate. - PCM differs than PAM in that it quantizes the samples by constraining them to only take a limited number of values, and then converts each value into a binary string of bits that are transmitted on the communication line. 7 Pulse-code Modulation (PCM) - PCM consists of three steps to digitize an analog signal: 1. Sampling 2. Quantization 3. Binary encoding - Before we sample, we have to filter the signal to limit the maximum frequency of the signal as it affects the sampling rate. - Filtering should ensure that we do not distort the signal, i.e. remove high frequency components that affect the signal shape. 8 Components of PCM Encoder 9 Sampling - Analog signal is sampled every Ts secs. - Ts is referred to as the sampling interval or period. - fs = 1/Ts is called the sampling rate or sampling frequency. - The process is referred to as pulse amplitude modulation PAM and the outcome is a signal with analog (non integer) values. 10 Note - According to the Nyquist theorem, the sampling rate must be at least 2 times the highest frequency contained in the signal. 11 12 Recovery of a sampled sine wave for different sampling rates 13 Quantization - Sampling results in a series of pulses of varying amplitude values ranging between two limits: a min and a max. - The amplitude values are infinite between the two limits. - We need to map the infinite amplitude values onto a finite set of known values. - This is achieved by dividing the distance between min and max into L zones, each of height height = (max - min)/L 14 15 Quantization Levels - The midpoint of each zone is assigned a value from 0 to L-1 (resulting in L values) n 16 - Each sample falling in a zone is then approximated to the value of the midpoint. 3 2 1 0 n approximating the value of the sample amplitude to the quantized values. 17 Assigning Codes to Zones - Each zone is then assigned a binary code. - The number of bits required to encode the zones, or the number of bits per sample as it is commonly referred to, is obtained as follows: nb = log2 L - Given our example, nb = 2 - The 4 zone (or level) codes are therefore: 00, 01, 10, 11 18 Assigning Codes to Zones 11 10 01 00 3 2 1 0 Each zone is assigned a binary code n 19 Assigning Codes to Zones Use one of the line code scheme to get the digital signal 20 Thank You 21