CALIFORNIA STATE UNIVERSITY, NORTHRIDGE LOSSLESS COMPRESSION of SATELLITE TELEMETRY DATA for a NARROW-BAND DOWNLINK a Graduate P
Total Page:16
File Type:pdf, Size:1020Kb
CALIFORNIA STATE UNIVERSITY, NORTHRIDGE LOSSLESS COMPRESSION OF SATELLITE TELEMETRY DATA FOR A NARROW-BAND DOWNLINK A graduate project submitted in partial fulfillment of the requirements For the degree of Master of Science in Electrical Engineering By Gor Beglaryan May 2014 Copyright Copyright (c) 2014, Gor Beglaryan Permission to use, copy, modify, and/or distribute the software developed for this project for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Copyright by Gor Beglaryan ii Signature Page The graduate project of Gor Beglaryan is approved: __________________________________________ __________________ Prof. James A Flynn Date __________________________________________ __________________ Dr. Deborah K Van Alphen Date __________________________________________ __________________ Dr. Sharlene Katz, Chair Date California State University, Northridge iii Contents Copyright .......................................................................................................................................... ii Signature Page ................................................................................................................................ iii List of Figures .................................................................................................................................. vi List of Tables ................................................................................................................................. viii ABSTRACT ........................................................................................................................................ ix 1 Introduction ............................................................................................................................. 1 2 Background: Information Theory and Coding .......................................................................... 2 2.1 Outline ............................................................................................................................. 2 2.2 Formulas and Measures of Performance ......................................................................... 4 2.3 Lossy vs. Lossless Compression ........................................................................................ 5 3 Design Procedure ..................................................................................................................... 7 3.1 Problem Definition ........................................................................................................... 7 3.2 Huffman Codes ................................................................................................................ 8 3.2.1 How Huffman Codes Work ...................................................................................... 8 3.2.2 Huffman Algorithm Design .................................................................................... 10 3.2.3 Efficiency of Huffman Compression ....................................................................... 15 3.2.4 Sample Output of the Static Huffman Algorithm .................................................. 17 3.3 Adaptive Huffman Codes ............................................................................................... 20 3.3.1 How Adaptive Huffman Codes Work ..................................................................... 21 3.3.2 Adaptive Huffman Algorithm Design ..................................................................... 23 3.3.3 Efficiency of Adaptive Huffman Codes ................................................................... 29 3.3.4 Sample Output of the Adaptive Huffman Algorithm ............................................. 30 3.4 Arithmetic Coding .......................................................................................................... 31 3.4.1 How Arithmetic Coding Works ............................................................................... 32 3.4.2 Arithmetic Coding Algorithm Design ..................................................................... 36 3.4.3 Efficiency of Arithmetic Coding .............................................................................. 46 3.4.4 Sample Output of the Static Arithmetic Algorithm ................................................ 47 3.5 Adaptive Arithmetic Coding ........................................................................................... 48 3.5.1 How Adaptive Arithmetic Coding Works ............................................................... 48 3.5.2 Efficiency of Adaptive Arithmetic Coding .............................................................. 50 4 Performance Tests and Comparison ...................................................................................... 51 4.1 Pic33 Analog-to-Digital Converter Output Format ........................................................ 51 iv 4.2 Benchmark Test ............................................................................................................. 54 4.2.1 Test Data ................................................................................................................ 54 4.2.2 Compression Ratio Test ......................................................................................... 58 4.2.3 Timing Test ............................................................................................................. 63 4.2.4 Discussion of Test Results ...................................................................................... 68 4.3 Delta Compression ......................................................................................................... 70 5 Conclusions ............................................................................................................................ 72 Bibliography ................................................................................................................................... 73 Appendix A: MATLAB Code for Static Huffman Compression ....................................................... 75 Appendix B: MATLAB Code for Adaptive Huffman Compression .................................................. 84 Appendix C: MATLAB Code for Static Arithmetic Coding .............................................................. 94 Appendix D: MATLAB Code for Adaptive Arithmetic Coding ....................................................... 101 Appendix E: MATLAB Code for 10 bit Conversion ....................................................................... 106 Appendix F: MATLAB Code for 12 bit Conversion........................................................................ 112 v List of Figures Figure 2.1-Simplified source and channel coding system. ............................................................... 3 Figure 3.1-Static Huffman compression flowchart. ......................................................................... 8 Figure 3.2-Huffman binary tree example. ........................................................................................ 9 Figure 3.3-Flowchart for traversing a binary tree. ......................................................................... 13 Figure 3.4-Static Huffman compression output format. ............................................................... 14 Figure 3.5-Encoded binary tree example. ...................................................................................... 15 Figure 3.6-Output variable info of the Static Huffman program. .................................................. 17 Figure 3.7-Output variable info.codewords of the Static Huffman program. ............................... 19 Figure 3.8-Histogram generated by the Static Huffman Program. ................................................ 19 Figure 3.9-Adaptive Huffman encoding flowchart [15]. ................................................................ 22 Figure 3.10-Adaptive Huffman tree example. ............................................................................... 25 Figure 3.11-Adaptive Huffman tree node update example. .......................................................... 26 Figure 3.12-Adaptive Huffman compression output format. ........................................................ 27 Figure 3.13-Adaptive Huffman decoder flowchart [17]. ................................................................ 28 Figure 3.14- Output variable info of the Adaptive Huffman program. .......................................... 30 Figure 3.15-Final binary tree table of the Adaptive Huffman simulation. ..................................... 30 Figure 3.16-Output variable info.codewords of the Adaptive Huffman program. ........................ 31 Figure 3.17-Generating unique tag for Static Arithmetic Coding .................................................. 33 Figure 3.18-Arithmetic Coding Case 0 and Case 1 rescaling [23]. ................................................. 37 Figure 3.19-Arithmetic Coding Case S rescaling [23]. .................................................................... 38 Figure 3.20-Static Arithmetic Coding flowchart. ...........................................................................