Implementation and Optimization of LZW Compression Algorithm Based on Bridge Vibration Data

Similar documents
An Extended Byte Carry Labeling Scheme for Dynamic XML Data

Lempel-Ziv-Welch (LZW) Compression Algorithm

Multimedia Systems. Part 20. Mahdi Vasighi

The IIC interface based on ATmega8 realizes the applications of PS/2 keyboard/mouse in the system

An Image Lossless Compression Patent

Data Compression. Media Signal Processing, Presentation 2. Presented By: Jahanzeb Farooq Michael Osadebey

Intro. To Multimedia Engineering Lossless Compression

Lossless Compression Algorithms

Development of a Rapid Design System for Aerial Work Truck Subframe with UG Secondary Development Framework

The Analysis and Detection of Double JPEG2000 Compression Based on Statistical Characterization of DWT Coefficients

CIS 121 Data Structures and Algorithms with Java Spring 2018

Chapter 7 Lossless Compression Algorithms

EE-575 INFORMATION THEORY - SEM 092

An Improved Reversible Data-Hiding Scheme for LZW Codes

Design of a Chinese Input Method on the Remote Controller Based on the Embedded System

IMAGE COMPRESSION TECHNIQUES

Ch. 2: Compression Basics Multimedia Systems

EE67I Multimedia Communication Systems Lecture 4

ITCT Lecture 8.2: Dictionary Codes and Lempel-Ziv Coding

Data Compression. An overview of Compression. Multimedia Systems and Applications. Binary Image Compression. Binary Image Compression

IMAGE PROCESSING (RRY025) LECTURE 13 IMAGE COMPRESSION - I

Parallel 3D Images Surface Texture Editing

Research on monitoring technology of Iu-PS interface in WCDMA network

Lempel-Ziv-Welch Compression

Welcome Back to Fundamentals of Multimedia (MR412) Fall, 2012 Lecture 10 (Chapter 7) ZHU Yongxin, Winson

Research on Impact of Ground Control Point Distribution on Image Geometric Rectification Based on Voronoi Diagram

Digital Communication Prof. Bikash Kumar Dey Department of Electrical Engineering Indian Institute of Technology, Bombay

Fundamentals of Multimedia. Lecture 5 Lossless Data Compression Variable Length Coding

WIRE/WIRELESS SENSOR NETWORKS USING K-RLE ALGORITHM FOR A LOW POWER DATA COMPRESSION

An Efficient Implementation of LZW Compression in the FPGA

Citation for the original published paper (version of record):

Research on software development platform based on SSH framework structure

Entropy Coding. - to shorten the average code length by assigning shorter codes to more probable symbols => Morse-, Huffman-, Arithmetic Code

Random Traversing Based Reversible Data Hiding Technique Using PE and LSB

The Research on Coding Scheme of Binary-Tree for XML

Design of a High Speed CAVLC Encoder and Decoder with Parallel Data Path

DSP-Based Parallel Processing Model of Image Rotation

Engineering Mathematics II Lecture 16 Compression

IMAGE COMPRESSION- I. Week VIII Feb /25/2003 Image Compression-I 1

Data Processing System to Network Supported Collaborative Design

A Compression Method for PML Document based on Internet of Things

The Design of the Embedded WEB Server Based on ENC28J60

Image compression. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

CS/COE 1501

Research on Sine Dynamic Torque Measuring System

Available online at ScienceDirect. The 4th International Conference on Electrical Engineering and Informatics (ICEEI 2013)

CS/COE 1501

Analysis of Parallelization Effects on Textual Data Compression

Implementation of LZW Data Lossless Compression Algorithm Based on VB Yuan Qinghui 1, a,*, Nie Xiujun 1, b and Yuan Qingfei 2,c

Compressing Data. Konstantin Tretyakov

Encoding. A thesis submitted to the Graduate School of University of Cincinnati in

HARDWARE IMPLEMENTATION OF LOSSLESS LZMA DATA COMPRESSION ALGORITHM

Overview. Last Lecture. This Lecture. Next Lecture. Data Transmission. Data Compression Source: Lecture notes

Design on a method for interactive editing fault polygon

Research on Embedded CNC Device Based on ARM and FPGA

An effective algorithm for mining sequential generators

Speech Recognition Based on Efficient DTW Algorithm and Its DSP Implementation

Implementation and Improvement of DSR in Ipv6

LSB Based Audio Steganography Based On Text Compression

Comparative data compression techniques and multi-compression results

ScienceDirect. Analogy between immune system and sensor replacement using mobile robots on wireless sensor networks

An On-line Variable Length Binary. Institute for Systems Research and. Institute for Advanced Computer Studies. University of Maryland

The Design and Implementation of University Vedio Resources Platform Based on Podcast

Available online at ScienceDirect. Procedia Engineering 99 (2015 )

DEFLATE COMPRESSION ALGORITHM

The Design and Realization of Visual Education System for Bridge Structure Analysis

An Information Hiding Scheme Based on Pixel- Value-Ordering and Prediction-Error Expansion with Reversibility

OPTIMIZATION OF LZW (LEMPEL-ZIV-WELCH) ALGORITHM TO REDUCE TIME COMPLEXITY FOR DICTIONARY CREATION IN ENCODING AND DECODING

FPGA based Data Compression using Dictionary based LZW Algorithm

The GPU-based Parallel Calculation of Gravity and Magnetic Anomalies for 3D Arbitrary Bodies

University of Waterloo CS240 Spring 2018 Help Session Problems

A Compression Technique Based On Optimality Of LZW Code (OLZW)

A New Compression Method Strictly for English Textual Data

Information Technology Department, PCCOE-Pimpri Chinchwad, College of Engineering, Pune, Maharashtra, India 2

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Compression. storage medium/ communications network. For the purpose of this lecture, we observe the following constraints:

A Comprehensive Review of Data Compression Techniques

An Efficient AC Algorithm with GPU

Optimized Compression and Decompression Software

A Novel Image Compression Technique using Simple Arithmetic Addition

A QUAD-TREE DECOMPOSITION APPROACH TO CARTOON IMAGE COMPRESSION. Yi-Chen Tsai, Ming-Sui Lee, Meiyin Shen and C.-C. Jay Kuo

Available online at ScienceDirect. Procedia Technology 24 (2016 )

Reducing Solid-State Storage Device Write Stress Through Opportunistic In-Place Delta Compression

Department of electronics and telecommunication, J.D.I.E.T.Yavatmal, India 2

Simple variant of coding with a variable number of symbols and fixlength codewords.

Sensors State Monitoring based on LabVIEW and Wireless Nodes

Code Transformation of DF-Expression between Bintree and Quadtree

An Improved Frequent Pattern-growth Algorithm Based on Decomposition of the Transaction Database

Keywords Data compression, Lossless data compression technique, Huffman Coding, Arithmetic coding etc.

Available online at ScienceDirect. Procedia Engineering 154 (2016 )

Figure-2.1. Information system with encoder/decoders.

Data compression with Huffman and LZW

Research on the Application of Interactive Electronic Whiteboard in Network Teaching

An Effective Approach to Improve Storage Efficiency Using Variable bit Representation

Unified VLSI Systolic Array Design for LZ Data Compression

Dictionary techniques

Surface Wave Suppression with Joint S Transform and TT Transform

Numerical simulation of 3-D seepage field in tailing pond and its practical application

International Journal of Advanced Research in Computer Science and Software Engineering

Some Improved Encoding and Decoding Schemes for Balanced Codes *

Transcription:

Available online at www.sciencedirect.com Procedia Engineering 15 (2011) 1570 1574 Advanced in Control Engineeringand Information Science Implementation and Optimization of LZW Compression Algorithm Based on Bridge Vibration Data Fengyuan Zhang a, Zhao Li b, Mengli ChenLili Wen, Xiaolu Jia, Cheng Chen,a* a Associate professor, Beijing University of Chemical And Technology,Beijing,100029,China b Nongraduate, Beijing University of Chemical And Technology,Beijing,100029,China Abstract LZW algorithm is adopted in this paper to compress the bridge vibration data. Based on the data structure of chained lists, an improved version of the algorithm, in which a new method called forward-moving on frequently-used entries is applied, is implemented and optimized. It can be drawn that using the above-mentioned method can effectively improve the searching speed and save compression time. In addition, optimizing the location of forward-moved frequently-used entries and selecting the appropriate statistical frequency have better optimization effects. Finally, implemented with C language, the algorithm is proved to have high compression efficiency with less time cost in the practical compression of bridge vibration data. 2011 Published by Elsevier Ltd. Open access under CC BY-NC-ND license. Selection and/or peer-review under responsibility of [CEIS 2011] Keywords: bridge vibration; LZW; chained lists; compression time; compression efficiency; statistic 1 Introduction In recent years, bridge accidents occur frequently, which leads to higher requirements on the real-time monitoring on bridge vibration. The bridge vibration data from sensors is very large. And, in the practical application, Transmission Over Radio is always adopted to transmit the data to upper computer so that to monitor the real situation. While, the TOR transmission time is too long to achieve real-time monitoring * Zhao Li. Tel.: 15101172100. E-mail address: lizhao180@163.com. 1877-7058 2011 Published by Elsevier Ltd. doi:10.1016/j.proeng.2011.08.292 Open access under CC BY-NC-ND license.

Fengyuan Zhang et al. / Procedia Engineering 15 (2011) 1570 1574 1571 purpose. Therefore, before transmitted, the huge data must be compressed [1]. Whereas the bridge vibration data is huge and have no regularity, this paper adopt LZW algorithm that is suitale to the data. The original Lempel Ziv approach to data compression was first published in 1977, followed by an alternate approach in 1978. Terry Welch's refinements to the 1978 algorithm were published in 1984. The algorithm is surprisingly simple and is applied extensively. In a nutshell, LZW compression replaces strings of characters with single codes [2]. LZW can be implemented based on arrays, chained lists or tree. While being implemented by chained lists, and in the progress of building dictionary table, the algorithm will search for the codes with sequential traversal. Therefore, it may cost a little long time to find the codes, which will make the whole compression time get long [2]. To solve this problem, the paper use chained lists to implement LZW, and add a new variable to each node to keep count of the codes s amount of usage.when building a table, the high frequency codes are moved and inserted to the front end of the chained lists in order to save search time. Furthermore, through optimizing the front -insert location and adopting suitable statistic number, the optimization will have a better effect. This paper s main content contains: Chapter2 describes the principles and features of LZW, Chapter3 presents the process of LZW s implementation and optimization, Chapter 4 draws the conclusion. 2 Principles and features of LZW At the beginning, the dictionary contains only single characters and their code. Then start the compression, read new string, match it to the strings have been in the dictionary until it cannot match further. For the string matched successfully, output its corresponding code. Then combine this string with the character which causes the match failed together as a new string, and add it to the string table with the corresponding code. LZW string table is a table having prefix, that is to say each prefix of the string is also in the table. The dictionary is dynamically generated. In the process of extraction, the decoder can recover a same dictionary on the base of the codes and output the encoded data stream [3]. 2.1 Principles of the LZW algorithm The LZW algorithm s coding steps are as follows [4] : Step1: Initialize dictionary. Dictionary contains all single characters in the data stream. Step2: Set the Prefix P Null. Step3: Read the next character in the data stream as the current character C. Step4: Judge whether the string P + C is in the current dictionary. 1) Yes, set P = P + C, that is extending P with C. 1output P s corresponding code to the encoded data stream. 2Judge whether the dictionary achieve to the maximum capacity: If it doesn t, add the string P + C to the dictionary, otherwise don t do that. 3Define P = C(P only contains C right now) Step5: Judge whether there are characters in the data stream: 1) Yes, return step3 to continue the encoding process. 2) No, output P s corresponding code to the encoded data stream. End. LZW decoding algorithm is the reverse process of encoding. The steps are as follows. Step1: Initialize the dictionary, the dictionary contains all the single characters of data stream. Step2: Read the first codeword CW in the encoded data stream. Step3: Output CW s corresponding string to the decoded data stream. Step4: PW = CW, read the next codeword CW. Step5: Judge whether there is a CW in dictionary:

1572 Fengyuan Zhang et al. / Procedia Engineering 15 (2011) 1570 1574 1) Yes. 1 Output the String.cW to the decoded data stream. 2 P = String.pW. 3 C = the first character of String.cW. 4Add string P + C to the dictionary. 1 P = String.pW. 2 C = the first character of String.pW. 3 Output string P + C to decoded data stream and add it to the dictionary. Step6: Judge whether there are code words in the encoded data stream. 1) Yes, return Step2 to continue decoding. 2) No, end decoding. 2.2 Features of LZW LZW compression has good effect on the data which is unpredictable. And it has a high compression efficiency for consecutive bytes and strings in the data stream. It is a lossless compression so that the document is exactly the same as what it was before compression, and there are no any errors on every bit. In this way, it completely maintained the characteristics of the original document. It has a widely application during the field of data compression in image data processing and documents etc. The speed of compression and decompression is faster than any other algorithms. It can run in the Intel80386 computer [5]. 3 The process of LZW s implementation and optimization 3. 1 The basic implementation of LZW The original bridge vibration data are denary decial, whose length is long. What s more, the data have little repeatability and no regularity. Therefore, the original vibration data need to be preprocessed at first.that is, the data should be transformed into binary digit before be compressed. Afterwards, on the base of unidirectional chained lists, the LZW algorithm compression and extraction are implemented with C programming language. The initial dictionary contains three parts. They are 0, 1 and.. The compression is a process that build the dictionary dynamically while compress the raw data. When new entrys need to be added to the dictionary, they should be inserted at the tail of the list. The process is shown in Fig.1. The compression and extraction dictionary are both fixed-length, and the length is 256. Searching for the codes in the dictionary adopt sequential traversal. Implemented algorithm could fullfill the requirement for bridge vibration data and its compression efficiency is relatively high. However, because of sequential traversal in the search, each time spending on it is long so that to make compression time long. This is the main problem that the paper solves. Fig. 1. building dictionary 3. 2 The optimization of LZW On the strength of that problem, the algorithm should be optimized.in the program with chained lists, because of sequential traversal, it waste some time to find the codes. So we came up with a new method called forward-moving on frequently-used entries. A concrete realization is that adding a new variable

Fengyuan Zhang et al. / Procedia Engineering 15 (2011) 1570 1574 1573 counter to each node for keeping count of the amount of usage. And make the list bidirectional in order to move the node conveniently. When the codes amount of usage meeting the specified amount, which is a mark of moving, the node is moved behind the head node ( shown in Fig.2.(a) ). Thus, nonexpondable codes will be located in the front end of the chained lists, which will accelerate the process to search for codes, thereby, save compression time. Then, we compressed the data of 4.76MB and compared each result. The comparison is shown in Table1. Fig. 2. (a)forward-moving on frequently-used entries;(b) forward-moving and sorting on frequently-used entries The algorithm is optimized further. As the counter comes to the specified amount and the node need to be moved forward, the node is not inserted behind the head node, however, behind the last nonexpondable code ( shown in Fig.2.(b) ). Thus, the first one coming to the specified amount will be located in the foremost end of the list, the latter ones will be arranged in descending order on the base of amount of usage.this is equal to ordering the nonexpondable codes simply. As a consequence, this method is called forward-moving and sorting on frequently-used entries. This improvement effectively shorten the time. The comparison results is also shown in Table1. The coding steps of algorithm, which has been optimized, are as follows: Step1: Initialize dictionary. Dictionary contains all single characters in the data stream. Step2: Set the specified amount for the mark of moving. Step3: Set the Prefix P Null. Step4: Read the next character in the data stream as the current character C. Step5: Judge whether the string P + C is in the current dictionary. 1) Yes, set P = P + C, that is extending P with C. 1Output P s corresponding code to the encoded data stream. And the counter of P s corresponding code add 1. Judge the present counter whether meet the mark: a.yes, move this node behind the last nonexpondable code. b.no, do nothing. 2Judge whether the dictionary achieve to the maximum capacity: If it doesn t, add the string P + C to the dictionary, otherwise don t do that. 3Define P = C. (P only contains C right now.) Step6: Judge whether there are characters in the data stream: 1) Yes, return step3 to continue the encoding process. 2) No, output P s corresponding code to the encoded data stream. End.

1574 Fengyuan Zhang et al. / Procedia Engineering 15 (2011) 1570 1574 Table 1.Comparison of different algorithms Different algorithms Compression Efficiency(%) Compression Time(s) Basic chained lists 77.52 28.425 Nonexpondable codes move forward 77.52 27.826 Nonexpondable codes move forward and be ordered 77.52 22.239 Based on the nonexpondable codes move forward and be ordered, we change the specified amount keeping the count of usage, the compression time will also change. The results are shown in Table2. It is seen from the table that when the mark of moving is 3000, that is to say, simply order the 90% of the codes, the speed of sequential traversal is fastest, and the compression time is the shortest. Table 2.Comparison of different marks Mark of Moving Compression Time(s) 3000 21.352 4000 21.845 5000 22.239 10000 23.737 30000 26.815 50000 27.513 5 The conclusion In this paper, LZW algorithm is implemented with chained lists data structure and optimized by the method of putting high-frequency lexical item forward. After comparing and study, it draws a conclusion that using the method mentioned above can shorten the compression time effectively and the time is shortest when the specified amount is an appropriate number. Sorting the high-frequency lexical items that have been put forward is proposed in this paper as a further optimization method. And this method can shorten the compression time further. The greater the amount of compressed data, the effect is more evident. Optimal algorithm can be widely used in bridge vibration data, and other decimal or binary data compression. References [1] Jianting Zhou, Jianxi Yang, Zongbao Liang. Bridge's real-time monitoring and life prediction theory and application, Beijing: Science Press;2010 [2] Terry A. Welch. A Technique for High-Performance Data Compression. IEEE COMPUTER,;1984. [3] Lin Xiaozhu, Ji Junwei. An Improved LZW Compression Algorithm. Computer Engineering;2005.7 [4] Wang ping. Realization and Research of LZW Lossless Compression Algorithm. Computer Engineering;2002.7 [5] Chang-Chu Chen, Chin-Chen Chang. High-capacity Reversible Data-hiding for LZW Codes. Computer Modeling and Simulation;2010