EE390 PULSE CODE MODULATION Prelab #5
Total Page:16
File Type:pdf, Size:1020Kb
EE390 PULSE CODE MODULATION PreLab #5 I. OBJECTIVE · To become familiar with sampling, A/D conversion, PCM, and quantization noise. II. REFERENCES · EE 390 textbook, PCM and related sections. III. BASIC THEORY Pulse code modulation (PCM) is the simplest waveform coding technique. The pulse code modulator consists of three basic modules: (1) a sampler; (2) a quantizer; and (3) an encoder. · The role of the sampler module is to sampling the input (analog) signal with frequency at least twice the maximum frequency of the signal. For example, in telephony (voice) channel, the maximum frequency is 3.4 kHz, the voice signal is sampled at 8 kHz. · The quantizer performs the analog to digital (A/D) conversion so that the input signal can be sent over digital transmission network. · The encoder assigns the quantized samples with sequences of bits ‘0’ and ‘1’. There are two types of encoding: Natural and Gray coding. In the natural method, the quantized levels are numbers consecutively (in binary or decimal values), whereas, in the Gray encoding, the adjacent levels are only one bit different from each other. In our experiment, natural encoding is employed. The number of bit representing a sampled analog signal decides the quality of the recovered. The more bits, the better quality. If the sampled signal is uniformly distributed, then uniform quantizer is the best in terms of signal-to-quantization noise ratio (SQNR). However, the most popular signals such as voice or TV signals are not uniformly distributed. Therefore, non-uniform quantizers can improve SQNR significantly. A non-linear quantization standard for the public telephony service in North America is µ -law companding (compression and expansion). Non-linear companding quantizes lower amplitude values in more detail than higher amplitude ones. This method works well for telephone communication because it reduces the SQNR in the area where it matters most – in low amplitude values, which are common in human speech and are particularly subject to noise distortion. The equation for non-linear compression by µ -law encoding is y = log(1+m*sign(x))/log(1+m) * sign(x) where -1 ≤ x ≤ 1 , and sign(x) is -1 if x is negative and 1 otherwise. Figure 1 plots the relation ship between the input signal x and the output of the compander y(x). If µ = 0, the quantizer is in linear mode. In Figure 2, the output signal is non-linear quantized by µ -law with µ = 255. The range of the output signal in the positive half is divided into 4 segments; each segment has 4 quantization levels. Thus by using non-linear quantization, the overall signal-to-quantization-noise is increased significantly by using the same number of bits per sample. If the signal-to-quantization-noise is not required to improve, the number of bits per sample can be reduced. This case will be observed in our experiments. For example, in µ 2 compression mode, the encoder produces 8 bits/sample. The 1st bit is the polarity bit showing the sign of the quantized signal, the 2nd and 3rd bits indicate the segment number, the bits 4, 5 and 6 represent the quantization level in each segment. The last two bits 7 and 8 are unused. The 8-bit words can be represented in BIN or HEX. Note that for both uniform and non-uniform quantization methods, the boundaries of the quantization regions are the midpoint of the two neighbor’s quantization levels. Prelab #4 Page 1 of 15 Figure 1: Graphs of m-law compander characteristic function. Figure 2: Example of the A/D transfer function. Calculate the resolution of A/D Linear quantization: Measured: 00HEX represents -0.995 Vdc 01HEX represents -0.987 Vdc Resolution= -0.987-(-0.995)=0.008 Vdc for 1 count (01HEX-00HEX) Theoretical: Range of A/D is 2 Vdc (00HEX-FFHEX) Resolution= 2/256=0.008 Vdc. Prelab #4 Page 2 of 15 m2 Compression Law: According to the bit setup, we know there are 8 segments including 4 positive segments and 4 negative segments. For each segment, check the voltage change for only one bit change in “Bits” part with the consideration that the last two bits are always 00. For example: code E0 E4 (only one bit change in “Bits”), Resolution= Voltage change between these two codes. The breakpoint can be obtained by taking the midpoint of the voltage change from one segment to another segment. For example: Seg 00, code 111 Seg 01, code 000 X Vdc Y Vdc Breakpoint = X+ (Y-X)/2 Prelab #4 Page 3 of 15 IV. EQUIPMENT REQUIRED · Agilent Oscilloscope 54621A · Lab-Volt Accessories 8948 · Lab-Volt Accessories 8949 · Lab-Volt Power Supply / Dual Audio Amplifier 9401 · Lab-Volt Dual Function Generator 9402 · Lab-Volt FM / PM Receiver 9415 · Lab-Volt Logic Analyzer 9424 · Lab-Volt DC Voltmeter / DC Source 9425 · Lab-Volt Lowpass Audio Filter 9426 · Lab-Volt Signal Interrupter / Selector 9428 · Lab-Volt Noise Measurement Filters 9429 · Lab-Volt PAM / ASK Generator 9441 · Lab-Volt PCM Encoder 9444 · Lab-Volt PCM Decoder 9445 · Computer Module Arrangement Noise Measurement Lowpass Filters Audio Filter Signal Logic Interruptor/ Analyzer Selector DC Voltmeter/ PCM DC Source Encoder FM/PM Receiver PAM/ PCM ASK Decoder Dual Function Generator Generator Power Supply Dual Audio Amplifier Oscilloscope Computer Prelab #4 Page 4 of 15 V. EQUIPMENT DESCRIPTIONS We summarized the main features of these devices for brevity. However, students are advice to read the user manuals for full details. The equipments are described according to their uses in the experiments. 1. PAM/ASK Generator: The PAM/ASK Generator, Model 9440, is designed for the study of pulse-amplitude modulation (PAM) signal generation and amplitude-shift keying (ASK) signal generation. The PAM signals can be sampled using either natural sampling (with chopper circuit) of flat-top sampling (with sample and hold S&H circuit). The block diagram of PAM/ASK Generator is depicted in Figure 3. Figure 3: Front Panel of the PAM/PSK Generator, model 9440. AUDIO / CARRIER INPUT - This BNC connector receives a modulating signal (PAM) or a carrier signal (ASK) depending on whether the module is used as a PAM generator or as an ASK generator. S & H OUTPUT - This BNC connector gives access to the output signal of the sample-and-hold circuit. GAIN control - This knob, when pulled out, allows the voltage gain of the PAM/ASK OUTPUT amplifier to be set. PAM / ASK OUTPUT - This BNC connector gives access to the PAM or ASK signal depending on whether the module is used as a PAM generator or as an ASK generator. POWER ON indicator-This green LED lights when power is correctly applied to the module. TEST POINTS -This g-pin connector gives access to the test point signals. The pin configuration is given in Figure 1. THUMB-SCREW FASTENER - Secures the module to the enclosure. MODE selector - These three interlock push buttons allow the operating mode of the module to be selected. CLOCK /DATA INPUT - This BNC connector receives a clock signal (PAM) or a data signal (ASK) depending on whether the module is used as a PAM generaior or as an ASK generator. Prelab #4 Page 5 of 15 Technical specifications: Clock / Data Input Level: TTL Maximum Frequency (PAM): 100 kHz Maximum Bit Rate (ASK): 200 kbit/s S & H Output Maximum level: 1V peak Impedance: 600 W PAM /ASK Output Maximum Level: 10 V peak Impedance: 600 W 2. DC Voltmeter/DC Source: The DC Voltmeter / DC Source module, Model 9425, is to supply reference voltage which the user can adjust or to display accurate readings of the DC voltage. This module is used mainly in the study of analog-to-digital (A/D) conversions and of digital-to-analog (D/A) conversions. The output DC voltage can be set at any value between +2 V and -2 V using a ten-turn potentiometer. In the SOURCE MODE, the DC source voltage can be read on the DC Voltmeter without making connections. Specification: Source Mode - Output voltage: -2V to +2V variable - Maximum output current: 25 mA The front panel of the module is showed in Figure 4. Figure 4: Front panel of DC Voltmeter / DC Source module, Model 9425. THUMB-SCREW FASTENER - The DC Voltmeter / DC Source is secured to the Digital System Enclosure by means of a thumb-screw fastener. 1 MW INPUT - This BNC connector allows voltage to be measured. Prelab #4 Page 6 of 15 RANGE - This switch is used to select one of the two voltage ranges (2 V or 20 V) of the DC Voltmeter. 3.5digits VOLTAGE DISPLAY - This display shows the continuous voltage measured by the DC Voltmeter. VOLTAGE DISPLAY switches - These switches are used to measure the voltage at the input of the DC Voltmeter or at the output of the DC Source. VOLTAGE ADJUST - This adjustment knob provides an easy and accurate adjustment of the output voltage at the DC Source. OUTPUT - This BNC connector provides access to the output signal from the DC source. POWER ON -This green LED comes on when the power is applied to the module. lt shows proper connection to the Enclosure. 3. LOGIC ANALYZER 9424 The Logic Analyzer, Model 9424, is designed to observe successive bytes (8-bit words) of any input sources synchronized by an external clock. At first, the Logic Analyzer stores the incoming binary-bit words on its data input, until its memory is full. The capacity of that memory is of 2048 B-bit words. Once the data acquisition has been carried oul, the Logic Analyzer automatically proceeds with the data display in hexadecimal.