Applicability of the Julia Programming Language to Forward Error-Correction Coding in Digital Communications Systems
Total Page:16
File Type:pdf, Size:1020Kb
Applicability of the Julia Programming Language to Forward Error-Correction Coding in Digital Communications Systems A project presented to Department of Computer and Information Sciences State University of New York Polytechnic Institute At Utica/Rome Utica, New York In partial fulfillment Of the requirements of the Master of Science Degree by Ryan Quinn May 2018 Declaration I declare that this project is my own work and has not been submitted in any form for another degree of diploma at any university of other institute of tertiary education. Information derived from published and unpublished work of others has been acknowledged in the text and a list of references given. _ Ryan Quinn 2 | P a g e SUNY POLYTECHNIC INSTITUTE DEPARTMENT OF COMPUTER AND INFORMATION SCIENCES Approved and recommended for acceptance as a project in partial fulfillment of the requirements for the degree of Master of Science in computer and information science _ DATE _ Dr. Bruno R. Andriamanalimanana Advisor _ Dr. Saumendra Sengupta _ Dr. Scott Spetka 3 | P a g e 1 ABSTRACT Traditionally SDR has been implemented in C and C++ for execution speed and processor efficiency. Interpreted and high-level languages were considered too slow to handle the challenges of digital signal processing (DSP). The Julia programming language is a new language developed for scientific and mathematical purposes that is supposed to write like Python or MATLAB and execute like C or FORTRAN. Given the touted strengths of the Julia language, it bore investigating as to whether it was suitable for DSP. This project specifically addresses the applicability of Julia to forward error correction (FEC), a highly mathematical topic to which Julia should be well suited. It has been found that Julia offers many advantages to faithful implementations of FEC specifications over C/C++, but the optimizations necessary to use FEC in real systems are likely to blunt this advantage during normal use. The Julia implementations generally effected a 33% or higher reduction in source lines of code (SLOC) required to implement. Julia implementations of FEC algorithms were generally not more than 1/3 the speed of mature C/C++ implementations. While Julia has the potential to achieve the required performance for FEC, the optimizations required to do so will generally obscure the closeness of the implementation and specification. At the current time it seems unlikely that Julia will pose a serious challenge to the dominance of C/C++ in the field of DSP. 4 | P a g e 2 TABLE OF CONTENTS 1 Abstract ................................................................................................................................................. 4 3 List of Figures ........................................................................................................................................ 7 4 List of Tables ......................................................................................................................................... 8 5 List of Abbreviations ............................................................................................................................. 9 6 Background ......................................................................................................................................... 10 6.1 Overview ..................................................................................................................................... 10 6.2 Information: a Definition ............................................................................................................ 15 6.3 Communications Systems ........................................................................................................... 16 6.4 Basic Principles of Digital Communication .................................................................................. 17 6.4.1 Overview ............................................................................................................................. 17 6.4.2 Framing/Source Encoding ................................................................................................... 19 6.4.3 Modulation .......................................................................................................................... 20 6.5 Forward Error-Correction Coding (FEC) ...................................................................................... 21 6.5.1 The FEC Paradigm ............................................................................................................... 21 6.5.2 Hamming Notation .............................................................................................................. 23 6.5.3 The Principle of Error Correction ........................................................................................ 24 6.5.4 A survey of Common Error-Correction Codes ..................................................................... 25 6.6 Implementing Communications Systems in Software ................................................................ 39 6.6.1 Python and Other 4th-Generation Languages for DSP ....................................................... 39 6.6.2 C/C++ for DSP ...................................................................................................................... 42 6.6.3 The Julia Programming Language ....................................................................................... 44 7 Tools and Programs Used ................................................................................................................... 49 8 Design and Implementation ................................................................................................................ 50 9 Results ................................................................................................................................................. 51 9.1 Notes on Implementing FEC in Julia ............................................................................................ 51 9.1.1 Basic Repetition and Parity Check Codes ............................................................................ 51 9.1.2 Hamming Codes .................................................................................................................. 51 9.1.3 Hadamard Codes ................................................................................................................. 51 9.1.4 Golay Codes......................................................................................................................... 52 9.1.5 Reed-Solomon Codes .......................................................................................................... 52 9.1.6 Convolutional Codes ........................................................................................................... 54 5 | P a g e 9.2 Comparison of SLOC Required in C versus Julia .......................................................................... 54 9.2.1 Basic Repetition and Parity-Check Codes ........................................................................... 55 9.2.2 Hamming Codes .................................................................................................................. 55 9.2.3 Hadamard Codes ................................................................................................................. 55 9.2.4 Golay Codes......................................................................................................................... 56 9.2.5 Reed-Solomon Codes .......................................................................................................... 56 9.2.6 Convolutional Codes ........................................................................................................... 56 9.3 Comparison of Execution Times in C versus Julia ....................................................................... 57 9.3.1 Basic Repetition Codes ........................................................................................................ 57 9.3.2 Hamming Codes .................................................................................................................. 58 9.3.3 Hadamard Codes ................................................................................................................. 61 9.3.4 Golay Codes......................................................................................................................... 61 9.3.5 Reed-Solomon Codes .......................................................................................................... 62 9.3.6 Convolutional Codes ........................................................................................................... 63 9.4 Further Exploration ..................................................................................................................... 64 10 Conclusions ..................................................................................................................................... 66 11 References ...................................................................................................................................... 68 12 Appendix 1: Example Julia code for Hamming Code ...................................................................... 76 13 Appendix 2: Example Julia Code for Reed-Solomon Code .............................................................. 82 6 | P a g e 3 LIST OF FIGURES 1. The Shannon model of communication, Page 16 2. The Sklar Diagram for digital communications