Digital Filters in 16-QAM Communication By: Eric Palmgren Fabio Ussher Samuel Whisler Joel Yin
Digital Filters in 16-QAM Communication By: Eric Palmgren Fabio Ussher Samuel Whisler Joel Yin Online: < http://cnx.org/content/col11384/1.1/ > C O N N E X I O N S Rice University, Houston, Texas
This selection and arrangement of content as a collection is copyrighted by Eric Palmgren, Fabio Ussher, Samuel Whisler, Joel Yin. It is licensed under the Creative Commons Attribution 3.0 license (http://creativecommons.org/licenses/by/3.0/). Collection structure revised: December 11, 2011 PDF generated: October 29, 2012 For copyright and attribution information for the modules contained in this collection, see p. 28.
Table of Contents 1 Motivation......................................................................................... 1 2 Quadrature Amplitude Modulation (QAM).................................................... 3 3 Digital Filtering................................................................................... 9 4 Results............................................................................................ 19 5 Code for Digital Communication in MATLAB................................................ 25 6 Future Work...................................................................................... 27 Attributions.........................................................................................28
iv
Chapter 1 Motivation 1 1.1 Motivation Noise caused by the channel in digital communication can be catastrophic to a signal. In particular, noise can destroy an image and make it indistinguishable. As a result, some endeavor to reduce noise is necessary when transmitting digital images. We investigated the eects of upsampling with and without ltering as well as the eects of using dierent lters on the noise level of an image after being transmitted through a simulated channel. The problem we will tackle in regard to this is the transmission of a gray-scale image. This image will be ltered before and after subjection to a noisy channel and the result will be analyzed. 1 This content is available online at <http://cnx.org/content/m41717/1.1/>. 1
2 CHAPTER 1. MOTIVATION
Chapter 2 Quadrature Amplitude Modulation (QAM) 1 2.1 Quadrature Amplitude Modulation (QAM) All signal communications must adhere to frequency restrictions so that they can be received without interference. This gives rise to the notion of carrier modulation, where a baseband signal is moved to an unoccupied section of the frequency domain before transmission. This is also known as frequency modulation. This also simultaneously addresses the issue that low-frequency signals suer greatly from attenuation during transmission through a medium. In order to transmit digital information, symbols are needed to represent the bits. The simplest set is known as BPSK, which consists of just two symbols; one represents 0, while the other represents 1. The baud rate in this case is only one; more complicated methods are necessary if we wish to improve upon this. While there are many types of modulation of varying complexity, we will focus on one of the popular methods known as 16-Quadrature Amplitude Modulation (16-QAM). 16-QAM utilizes both amplitude and phase alterations in conjunction with frequency modulation in a way that allows each symbol to represent four bits rather than just one. This increase in baud rate comes at the cost of design complexity and cost. The transmitter must send two signals simultaneously; in order to do this in a way that the signals can be separated by the receiver, the two signals must be orthogonal to each other. This is implemented via the frequency modulation, except one signal is modulated by a cosine and the other a sine. Thus, the output s(t) can be dened as s (t) = I (t) cos (2πf c t) Q (t) sin (2πf c t) (2.1) The rst signal is known as the in-phase component, while the other is known as the quadrature component. The fact that 2πk cos (ωt) sin (ωt) = cos (ωt) sin (ωt) dt = 0, k Z 0 implies the signals' orthogonality. Multiplication by these sinusoids, via properties of the Fourier Transform, centers the frequency representation of the signal around plus and minus f c rather than at baseband. 1 This content is available online at <http://cnx.org/content/m41714/1.1/>. 3
4 CHAPTER 2. QUADRATURE AMPLITUDE MODULATION (QAM) Figure 2.1 Figure 2.2
The various amplitudes paired with the two phases can be succinctly represented by a constellation map as shown below. 5 Figure 2.3 Each point corresponds to a particular pair of amplitudes of the two signals. To combat the eects of noise, the points of the constellation are placed as far away from each other as possible so avoid misinterpretation. Many constellation congurations can be used; ours is described below:
6 CHAPTER 2. QUADRATURE AMPLITUDE MODULATION (QAM) Bits I(t) Q(t) 0001 1 1 0010 3 1 0011 1 3 0100 3 3 0101 1-1 0110 1-3 0111 3-1 1000 3-3 1001-1 1 1010-1 3 1011-3 1 1101-3 3 1110-1 -1 1111-3 -1 1110-1 -3 1111-3 -3 Table 2.1 In order to correctly interpret the data from r(t), the received signal s(t) with the addition of white noise after it passes through the channel, the receiver must recover I(t) and Q(t). I(t) is obtained by modulating s(t) by a cosine of identical frequency and phase as the original modulation, while Q(t) is obtained in the same way but with a sine instead. A low-pass lter will then yield the original signal, as the following equations illustrate: r (t) = I (t) cos (ωt) + Q (t) sin (ωt) (2.2) I rcvd (t) = LPF [r (t) cos (ωt)] I rcvd (t) = LPF [ I (t) cos 2 (ωt) + Q (t) sin (ωt) cos (ωt) ] I rcvd (t) = LPF [ 1 2 I (t) (1 + cos (2ωt)) + 1 2Q (t) sin (2ωt)] I rcvd (t) = The low-pass lter removes the components of frequency 2ω, leaving only a baseband signal. A similar approach shows that indeed Q rcvd (t) = LPF [r (t) sin (ωt)] = Q (t) (2.4) 2 Thus, both signals I(t) and Q(t) can successfully be recovered at the receiver. Below is the block diagram implementation of a transmitter using 16 QAM: I(t) 2 (2.3)
7 Figure 2.4 Below is the block diagram implementation of a receiver using 16 QAM: Figure 2.5
8 CHAPTER 2. QUADRATURE AMPLITUDE MODULATION (QAM)
Chapter 3 Digital Filtering1 3.1 Purpose of Upsampling in Digital Filters in Communication In digital communications lters are important in the process of upsampling. Upsampling is required for transmission because we want the signal's frequency representation to be narrow and conned to frequencies around the carrier frequency. By upsampling the signal, the frequency response of the signal to be transmitted gets compressed and becomes band limited to a signicantly smaller range of frequencies, which is necessary for transmission. 1 This content is available online at <http://cnx.org/content/m41715/1.1/>. 9
10 CHAPTER 3. DIGITAL FILTERING Figure 3.1 As can be seen from the gure above, (a) shows the frequency domain representation of the signal to be transmitted, (b) shows the upsampled version of the frequency response, and upon low pass ltering the upsampled signal we get only two spikes. When the signal is modulated to the carrier frequency, both spikes appear at the corresponding carrier frequency in (c). This is important because we don't want information to be spread across the frequency spectrum, rather we want to transmit the signal at a specic carrier frequency. The upsampling process is accomplished by taking a signal, inserting L zeros between each sample and then low pass ltering the result. Below is a description of possible low pass lters that can be used to achieve this result.
11 3.2 Raised Cosine Filter The raised cosine lter is a type of low pass lter that accomplishes the interpolation necessary after inserting the L zeros between each sample. It's frequency response is given by: Figure 3.2 In the lter α is a parameter which is between 0 and 1 and is called the rollo factor. The larger α is, the wider the bandwidth of the lter. As α approaches zero the lter will become a brick wall and will look like a box in the frequency domain. The Impulse response of the lter is shown in the gure below:
12 CHAPTER 3. DIGITAL FILTERING Figure 3.3 As can be seen above, the time domain representation is given by a sinc and so in reality the raised cosine lter would extend to plus and minus innity. However, above the impulse response was truncated and selected to have a length of 41 for the purposes of our digital communication scheme. The raised cosine lter is the best lter for digital communication, specically 16 QAM, because it removes interference that may occur from one symbol to the next. This means that the waveform can be recovered perfectly at the receiver and this is why the raised cosine lter is typically used in digital communication. In order to complete the upsampling process it is necessary to convolve the impulse response of the raised cosine lter and the vector that contains the signal with zeros inserted between the samples. The output of this convolution will be the upsampled signal. Below is the output of the real part of a [1 0 1 0] sequence convolved with the raised cosine lter.
13 Figure 3.4 As can be seen above, the absolute value of the maximum value is -3. This is because the rst two bits, [1 0] correspond to the real part of the sequence and they get mapped to a value of I=-3. Below is the imaginary part of the signal, and as we can see the absolute value of the maximum value is 1. This is because the last to bits, [1 0] correspond to the imaginary part of the sequence and they get mapped to a value of Q=1.
14 CHAPTER 3. DIGITAL FILTERING Figure 3.5 The raised cosine lter is used because it limits the bandwidth of the signal and decays quickly in the time domain. The advantages of this is that it allows for data transmission in specic frequency ranges with an insignicant amount of information spread out across large frequencies. 3.3 Butterworth Filter Butterworth lters are another type of low pass lter which can be used to complete the upsampling process. The frequency response of the Butterworth lter is given by: 1 H (jω) = ( ) 2N (3.1) ω 1 + ω c Where N is a parameter which is called the order of the lter and ω c is the cuto frequency. The Butterworth lter acts like a low pass lter because it has a at frequency response that is usually unity gain in the passband and gradually rolls o to zero in the stopband. In between the passband and the stop band we have the cuto frequency which will occur at the point where the gain is equal to 0.707 (1/sqrt(2)). Butterworth lters have a relatively slow roll o, especially when compared to the raised cosine lter. Below is the impulse response of the Butterworth lter:
15 Figure 3.6 Given a sequence of [1 0 1 0] the output of the low pass ltering of the real part of the signal will be:
16 CHAPTER 3. DIGITAL FILTERING Figure 3.7 The output of low pass ltering the imaginary part of the signal with a Butterworth lter will be:
17 Figure 3.8 As can be seen the output of the Butterworth lter is similar to that of the raised cosine lter, where both map the real part of the sequence to -3 and the imaginary part of the sequence to 1. The main dierence is that the raised cosine lter's output has ripples extending on both sides, while the Butterworth lter does not. This means that the Butterworth lter's output does not need to be truncated since it does not extend to innity like the output of the raised cosine lter does. The output of these lters would then be modulated appropriately as described, summed together and then transmitted through the channel as described in the QAM module.
18 CHAPTER 3. DIGITAL FILTERING
Chapter 4 Results 1 4.1 Results Our goal in digital communications was to transmit a grayscale image shown below: 1 This content is available online at <http://cnx.org/content/m41710/1.2/>. 19
20 CHAPTER 4. RESULTS Figure 4.1 This image was represented as a matrix with dimensions 512x512 with each entry having values from 0 to 255. The values from 0 to 255 in each entry of the matrix were taken, converted into a string of 0s and 1s and fed in four bits at a time into the 16 QAM modulator. This was then passed through a noisy channel which added an error of random numbers between -2.5 to 2.5 to the transmitted signal. The receiver collected the received signal, demodulated it and reconstructed the received image with noise. This was done with a raised cosine lter, a Butterworth lter and with no lter at all. We also compared the bit error with the original image for the raised cosine lter and the Butterworth lter. Below is the image received with noise using a raised cosine lter in the modulation phase:
21 Figure 4.2 Using the Butterworth lter in the modulation phase the received image with noise was:
22 CHAPTER 4. RESULTS Figure 4.3 Using no lter at all during the modulation scheme the received image was:
23 Figure 4.4 4.2 Error Calculations and Filter Evaluations The bit error was calculated by analyzing the bit-representation of the original grayscale image and comparing it the bit-representation of the received image. The percentage of incorrect bits was calculated to be 34.55% when using the raised cosine lter, and 34.45% when using the Butterworth lter. From these results we can see that the performance of the Butterworth lter and the raised cosine lter are about the same, with the Butterworth lter performing slightly better. The bit error in the received image using no lter was 47%, however, percent error for the number of incorrect grayscale pixels was calculated to be 99%. The percent error for the number of incorrect grayscale pixels using the Butterworth lter was 95.64%. The percent error for the number of incorrect grayscale pixels using the raised cosine lter was 95.66%. This is high because this includes even the slightest error which might be indistinguishable to the human eye. We can also see the importance of using lters in the upsampling stage of the modulation phase of the digital communication scheme by looking at the received image without the use of a lter. The use of a
24 CHAPTER 4. RESULTS digital lter allows the image to be recovered with far greater accuracy.
Chapter 5 Code for Digital Communication in MATLAB 1 Attached are the functions which were written to simulate 16 QAM, construct the lters and transmit the image. All cases require the decimal to binary converters and binary to decimal converters and noise (these function are called in the other examples given below):d2b, b2d, channela. For the Raised Cosine Filter use:constructnew, demodcn, imagegray, imagebw. For the Butterworth lter use:constructnewb, demodcn, imagegrayb, For no lter use: constructnewn, demodcn, imagegrayn. d2b 2 b2d 3 modulator with noise rcf 4 modulator with noise bwf 5 modulator with noise nf 6 demodulator 7 image simulator rcf 8 image simulator bwf 9 image simulator nf 10 image simulator rcf bw 11 channel noise 12 1 This content is available online at <http://cnx.org/content/m41709/1.1/>. 2 See the le at <http://cnx.org/content/m41709/latest/d2b.m> 3 See the le at <http://cnx.org/content/m41709/latest/b2d.m> 4 See the le at <http://cnx.org/content/m41709/latest/constructnew.m> 5 See the le at <http://cnx.org/content/m41709/latest/constructnewb.m> 6 See the le at <http://cnx.org/content/m41709/latest/constructnewn.m> 7 See the le at <http://cnx.org/content/m41709/latest/demodcn.m> 8 See the le at <http://cnx.org/content/m41709/latest/imagegray.m> 9 See the le at <http://cnx.org/content/m41709/latest/imagegrayb.m> 10 See the le at <http://cnx.org/content/m41709/latest/imagegrayn.m> 11 See the le at <http://cnx.org/content/m41709/latest/imagebw.m> 12 See the le at <http://cnx.org/content/m41709/latest/channela.m> 25
26 CHAPTER 5. CODE FOR DIGITAL COMMUNICATION IN MATLAB
Chapter 6 Future Work1 6.1 Future Work Our work utilized, but did not rigorously analyze, multiple digital lters. Future students could build upon our work by computing SNRs of more types of lters, mathematically determining which provide the least errors. Not all noise is the same; there are many models of channel noise. Future work could investigate how each of the proposed digital lters handle dierent types of noise, and conclude which lter behaves best for a given channel type. Our project does not attempt to eliminate the noise once it has been introduced. Error-correcting codes could be implemented to further reduce the eects of noise on the transmitted signal. 1 This content is available online at <http://cnx.org/content/m41708/1.1/>. 27
28 ATTRIBUTIONS Attributions Collection: Digital Filters in 16-QAM Communication Edited by: Eric Palmgren, Fabio Ussher, Samuel Whisler, Joel Yin URL: http://cnx.org/content/col11384/1.1/ License: http://creativecommons.org/licenses/by/3.0/ Module: "Motivation" By: Fabio Ussher URL: http://cnx.org/content/m41717/1.1/ Page: 1 Copyright: Fabio Ussher License: http://creativecommons.org/licenses/by/3.0/ Module: "Quadrature Amplitude Modulation (QAM)" By: Fabio Ussher URL: http://cnx.org/content/m41714/1.1/ Pages: 3-7 Copyright: Fabio Ussher License: http://creativecommons.org/licenses/by/3.0/ Module: "Digital Filtering" By: Eric Palmgren URL: http://cnx.org/content/m41715/1.1/ Pages: 9-17 Copyright: Eric Palmgren License: http://creativecommons.org/licenses/by/3.0/ Module: "Results" By: Eric Palmgren, Fabio Ussher, Joel Yin URL: http://cnx.org/content/m41710/1.2/ Pages: 19-24 Copyright: Eric Palmgren, Fabio Ussher, Joel Yin License: http://creativecommons.org/licenses/by/3.0/ Module: "Code for Digital Communication in MATLAB" By: Fabio Ussher URL: http://cnx.org/content/m41709/1.1/ Page: 25 Copyright: Fabio Ussher License: http://creativecommons.org/licenses/by/3.0/ Module: "Future Work" By: Eric Palmgren, Samuel Whisler, Fabio Ussher URL: http://cnx.org/content/m41708/1.1/ Page: 27 Copyright: Eric Palmgren, Samuel Whisler, Fabio Ussher License: http://creativecommons.org/licenses/by/3.0/
About Connexions Since 1999, Connexions has been pioneering a global system where anyone can create course materials and make them fully accessible and easily reusable free of charge. We are a Web-based authoring, teaching and learning environment open to anyone interested in education, including students, teachers, professors and lifelong learners. We connect ideas and facilitate educational communities. Connexions's modular, interactive courses are in use worldwide by universities, community colleges, K-12 schools, distance learners, and lifelong learners. Connexions materials are in many languages, including English, Spanish, Chinese, Japanese, Italian, Vietnamese, French, Portuguese, and Thai. Connexions is part of an exciting new information distribution system that allows for Print on Demand Books. Connexions has partnered with innovative on-demand publisher QOOP to accelerate the delivery of printed course materials and textbooks into classrooms worldwide at lower prices than traditional academic publishers.