Biomedical Engineering Reference
In-Depth Information
Appendix II
The algorithm for magnitude and sign encoding is separately given as follows:
% Sign encoding
k = 1;
% (source array index)
k1 = 0;
% (temporary index)
k2 = 1;
% (destination array index)
1. if c(k) > = 0 go to step 4
2. d1(k1) = 1;
% (encoded sign bit)
3. go to step 5
4. d1(k1) = 0
5. k = k+1; k1 = k1+1;
6. if k1>= 8 skip step 7
7. go to step 1 for next group sign encoding
8. d(k2) = [128*d1(0)) + (64*d1(1))+(32*d1(2))+(16*d1(3))+ (8*d1(4))+(4*d1(5))+(2*d1(6)) + d1(7)];
9. k1 =1; k = k+1; k2 = k2+8;
10. go to step 1 for next sign byte generation
% magnitude encoding (nibble combination)
c: starting array; d: Derived array; d(j) = encoded sign byte,
1. i=1; % (source array index)
2. j= 1; % (destination array index)
3. j= j+1; % ( j= 1 place for encoded sign bye)
4. if abs{c(i) }<10 and abs{c(i+1)}< 10 go to step 7
5. d(j)= 100+abs{c(i)}, d(j+1) = 100+abs{c(i+1)};
6. i= i+2; j= j+2; go to step 9
7. d(j)= 10*abs{c(i)} + abs{c(i+1)}
8. j= j+1, i= i+2
9. if i <8 go to step 4
10. group complete, go to step 2 for next group encoding
Search WWH ::




Custom Search