PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 0ms

/dvbt/trunk/release/mm/ml/xxbm/main.m

http://github.com/zaqwes8811/decoder-reed-solomon
Objective C | 62 lines | 56 code | 6 blank | 0 comment | 5 complexity | 8b53f7b87a83d0722d6eed36693bf26b MD5 | raw file
 1% ??????????? ????
 2addpath(cat(2,pwd,'\src'));
 3clear;  clc;
 4
 5% ???????? ??????
 6names = {'-- Errors : ' '-- data_in[]  ' '-- sidd_[]    '...
 7 '-- lambb_[]   ' 	'-- root_[]    ' '-- lamdd_[]   '...
 8 '-- corpp_[]   ' '-- out_dec[]  '};
 9%%% ????? ???????? ?????????? %%%
10
11% ????????? ????
12N = 255;  % ????? ???????? ?????
13t = 8;  % ??????? ?????? ????? ?????????
14K = N-t*2;  
15Short = 51;  % dvbt - 51, drm - 0
16K = K-Short
17p_sourse = [1 0 0 0 1 1 1 0 1];  % x8+x+1'
18%p_sourse = [1 0 0 0 0 1 0 0 0 1];  % x9+x4+1'
19% ???????????? ??????? ??????
20Tmp = [];
21for i = 1:K  % ??????? ??????
22  Tmp = [Tmp i];    
23end
24% ??????????? %%%
25fprintf('??????????? ??????...');
26w = rs_coder(Tmp,p_sourse, K, t);
27w(end-48:end) % ??????. ???.
28fprintf('O?\n');
29
30%w(1) = 0;
31w(2) = 0;
32w(3) = 0;
33% ???????? ?????? %%%
34%for i = 1:20%1  % erroring
35 % w(i) = 00;
36%end
37%w(end-4) = 0;
38%w(end-2) = 0;
39w(end-1) = 0;
40w(end-0) = 0;
41
42%%% ????????????? %%%
43fprintf('????????????? ??????...\n');
44q = rs_decoder(w, p_sourse, K, t);
45
46%????????? ??????????
47fprintf('?????? ????? ? ???????????? - Monitor.mif...');
48fid = fopen('Monitor.mif', 'wt');
49  smesh = 0;  r = 0;
50  fwrite(fid, [names{1,1} q{1,1} char([10 10])]); 
51  for i = 1:7
52    fwrite(fid, [names{1,i+1} char([10])]);
53      [cBuf, r] = int2hexchar(q{1,i+1}, smesh);
54      if mod(r, 32) == 0  smesh = smesh+r+1;
55      else smesh = smesh+r; end
56      fwrite(fid, [cBuf char([10 10])]);
57    end
58	fprintf('??\n');  close('all');
59% ???????? ?????
60%edit Monitor.mif 
61%! notepad Monitor.mif 
62