Research Article

Fast Algorithm of Truncated Burrows-Wheeler Transform Coding for Data Compression of Sensors

Algorithm 1

(CZ-BWT encoding ()).
function encode(s) {  / s is the BWT block data string (original data) /
  link = array();  / N is the length of string s /
  bucket = array(0…2563–1);  / bucket stores the link headers of (3) /
  for j = 0…2563–1 do {bucket[j] = null;}  / Initialize the link headers /
  for do {;link[i] = bucket[j]; bucket[j] = i;}  / Phase 1: build links of (4) /
  count = 0;  / count traces the start position of the block /
  for j = 0…2563–1 do {  / Phase 2: output data /
   i = bucket[j];
   while i is not null do {
    output(s[i + 1]); i = link[i]; count = count+ 1;  / output a character of s /
    if do {start = count;}  / start stores the start position /
   }
  }
  output(start);  / finally output the start position /
}