Advertisement
akocius

reed-solomon

Nov 19th, 2021
795
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %% Rydo Solomono kodavimas
  2. clear all
  3. clc
  4. load('Temperature.mat')
  5.  
  6. m = 5;
  7. n = 2^m - 1;
  8. k = 3;
  9. t = (n - k) / 2;
  10.  
  11. tempOrig = Temperature;
  12. bitnumber = 1;
  13. row = 1;
  14.  
  15. for i = 1:length(tempOrig)
  16.     if bitnumber > 3
  17.         bitnumber = 1;
  18.         row = row + 1;
  19.     end
  20.     tempMatrix(row, bitnumber) = tempOrig(i);
  21.     bitnumber = bitnumber + 1;
  22. end
  23.  
  24. temp_gf = gf(tempMatrix, m);
  25.  
  26. code = rsenc(temp_gf, n, k)
  27.  
  28. %Duomenų padidėjimas
  29. %sizeOrig = length(dec2bin(max(tempOrig))) * length(tempOrig);
  30.  
Advertisement
RAW Paste Data Copied
Advertisement