⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tutbchsq.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 4 页
字号:
set_param([sys,'/',['Binary Error/Modulo',13,'operation']],...
		'Mask Help','This block output modulus operation of the input signal with module base as specified in block entry. The length of the output vector is the same as the input vector.')
set_param([sys,'/',['Binary Error/Modulo',13,'operation']],...
		'Mask Entries','2\/',...
		'position',[300,56,360,94])

add_block('built-in/Sum',[sys,'/','Binary Error/Sum'])
set_param([sys,'/','Binary Error/Sum'],...
		'position',[235,65,255,85])

add_block('built-in/Outport',[sys,'/','Binary Error/out_1'])
set_param([sys,'/','Binary Error/out_1'],...
		'position',[390,65,410,85])


%     Subsystem  ['Binary Error/Poisson',13,'noise'].

new_system([sys,'/',['Binary Error/Poisson',13,'noise']])
set_param([sys,'/',['Binary Error/Poisson',13,'noise']],'Location',[391,74,676,237])

add_block('built-in/Outport',[sys,'/',['Binary Error/Poisson',13,'noise/out_1']])
set_param([sys,'/',['Binary Error/Poisson',13,'noise/out_1']],...
		'position',[165,65,185,85])

add_block('built-in/S-Function',[sys,'/',['Binary Error/Poisson',13,'noise/Poisson distribution',13,'number']])
set_param([sys,'/',['Binary Error/Poisson',13,'noise/Poisson distribution',13,'number']],...
		'function name','srandpoi',...
		'parameters','seed,lambda',...
		'position',[65,55,135,95])
add_line([sys,'/',['Binary Error/Poisson',13,'noise']],[140,75;160,75])
set_param([sys,'/',['Binary Error/Poisson',13,'noise']],...
		'Mask Display','Poison\nrand int',...
		'Mask Type','Poisson distribution noise.',...
		'Mask Dialogue','Poisson distribution number generator.|Lambda:|Seed:')
set_param([sys,'/',['Binary Error/Poisson',13,'noise']],...
		'Mask Translate','seed=@2;lambda=@1;')
set_param([sys,'/',['Binary Error/Poisson',13,'noise']],...
		'Mask Help','The output of this block is poisson distributed integers. The output size is the same as the vector size for seed. Please use function disttool to see the distribution of the outputof this block.')
set_param([sys,'/',['Binary Error/Poisson',13,'noise']],...
		'Mask Entries','P\/(randint(1, M)+100)*1000*max(P)\/')


%     Finished composite block ['Binary Error/Poisson',13,'noise'].

set_param([sys,'/',['Binary Error/Poisson',13,'noise']],...
		'position',[40,94,115,136])

add_block('built-in/Inport',[sys,'/','Binary Error/in_1'])
set_param([sys,'/','Binary Error/in_1'],...
		'position',[95,30,115,50])
add_line([sys,'/','Binary Error'],[195,80;230,80])
add_line([sys,'/','Binary Error'],[210,80;210,135;270,135])
add_line([sys,'/','Binary Error'],[260,75;295,75])
add_line([sys,'/','Binary Error'],[120,115;140,115;140,80;160,80])
add_line([sys,'/','Binary Error'],[120,40;210,40;210,70;230,70])
add_line([sys,'/','Binary Error'],[365,75;385,75])
set_param([sys,'/','Binary Error'],...
		'Mask Display','Binary err\nchannel',...
		'Mask Type','Add binary errors')
set_param([sys,'/','Binary Error'],...
		'Mask Dialogue','The error probability can be a scalar or a vector with length the same as the input vector length.|Error probability:|Input vector length:')
set_param([sys,'/','Binary Error'],...
		'Mask Translate','M=@2;P=@1;if length(P)~=M, P=ones(1,M)*P(1); end;')
set_param([sys,'/','Binary Error'],...
		'Mask Help','This block is designed for adding errors into a transmitted binary signals. The error rate for the transmitted signal is provided in the input parameter. The first output port outputs the transmitted signal. The second port outputs the added error signal.')
set_param([sys,'/','Binary Error'],...
		'Mask Entries','0.05\/1\/')


%     Finished composite block 'Binary Error'.

set_param([sys,'/','Binary Error'],...
		'hide name',0,...
		'position',[260,59,330,101])


%     Subsystem  ['Binary-sequential',13,'BCH decode1'].

new_system([sys,'/',['Binary-sequential',13,'BCH decode1']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1']],'Location',[298,166,908,319])

add_block('built-in/Demux',[sys,'/',['Binary-sequential',13,'BCH decode1/Demux']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Demux']],...
		'outputs','2',...
		'position',[110,80,150,115])


%     Subsystem  ['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time'].

new_system([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],'Location',[55,192,283,286])

add_block('built-in/S-Function',[sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time/S-function1']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time/S-function1']],...
		'function name','homopuls',...
		'parameters','samp_time, out_divid, offset',...
		'position',[40,31,105,59])

add_block('built-in/Outport',[sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time/Outport']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time/Outport']],...
		'position',[160,35,180,55])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],[110,45;155,45])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],...
		'Mask Display','Vector\nPulse',...
		'Mask Type','Pulse generator')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],...
		'Mask Dialogue','Vector pulses with sample rate of each pulse as Sample_time ./Divider. |Sample time (scalar, sec):|Divider (integer vector):|Offset (have same dimension as Divider):')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],...
		'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],...
		'Mask Help','This block generator a vector pulses. The output length is the same as the vector defined in "Divider". The ith element of the output has the sample time Sample_time/Divider(i). All elements in "Divider" must be integers.')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],...
		'Mask Entries','samp*k\/[n, k]\/[0 0]\/')


%     Finished composite block ['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time'].

set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Pulses deivide',13,'same sample time']],...
		'ForeGround',2,...
		'position',[25,81,85,119])

add_block('built-in/Outport',[sys,'/',['Binary-sequential',13,'BCH decode1/sequential',13,'message-out']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/sequential',13,'message-out']],...
		'position',[560,30,580,50])

add_block('built-in/Inport',[sys,'/',['Binary-sequential',13,'BCH decode1/sequential',13,'code-word-in']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/sequential',13,'code-word-in']],...
		'position',[100,25,120,45])


%     Subsystem  ['Binary-sequential',13,'BCH decode1/Register-shift'].

new_system([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],'Location',[19,610,374,740])

add_block('built-in/Inport',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/in_2']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/in_2']],...
		'Port','2',...
		'position',[40,70,60,90])

add_block('built-in/Inport',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/in_1']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/in_1']],...
		'position',[10,55,30,75])

add_block('built-in/Demux',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/Demux']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/Demux']],...
		'outputs','[len_rg, 1]',...
		'position',[260,55,300,90])

add_block('built-in/S-Function',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/S-function']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/S-function']],...
		'function name','regshift',...
		'parameters','shft_out, thrhld',...
		'position',[150,65,200,85])

add_block('built-in/Mux',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/Mux']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/Mux']],...
		'inputs','2',...
		'position',[80,56,115,89])

add_block('built-in/Outport',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/out_1']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/out_1']],...
		'position',[330,55,350,75])

add_block('built-in/Outport',[sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/out_2']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift/out_2']],...
		'Port','2',...
		'position',[330,70,350,90])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],[120,75;145,75])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],[205,75;255,75])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],[305,65;325,65])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],[305,80;325,80])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],[35,65;75,65])
add_line([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],[65,80;75,80])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],...
		'Mask Display','Register\nshift',...
		'Mask Type','Register-shift')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],...
		'Mask Dialogue','Store and shift the input from 1st port by raising edge of the pulse from second port.|Vector specify ouput delay length(non-negative integer):|Threshold for the pulse signal from the 2nd port:')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],...
		'Mask Translate','shft_out=@1; thrhld=@2; len_rg=length(@1);')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],...
		'Mask Help','This block store the 1st inport signal at the raising edge of 2nd inport pulse. The 1st outport outputs a vector with its size same as the the size of the 1st entree of this block. The maximum delay is the register size of this block. The second outport output a positive pulse at the begining of entire register refreshment.')
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],...
		'Mask Entries','[n:-1:1]\/.1\/')


%     Finished composite block ['Binary-sequential',13,'BCH decode1/Register-shift'].

set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Register-shift']],...
		'BackGround',3,...
		'position',[185,25,240,65])


%     Subsystem  ['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode'].

new_system([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode']],'Location',[157,499,740,659])

add_block('built-in/Memory',[sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/Memory']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/Memory']],...
		'orientation',2,...
		'x0','zeros(1,k+1)',...
		'position',[295,95,335,125])

add_block('built-in/Switch',[sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/Switch']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/Switch']],...
		'Threshold','0.5',...
		'position',[295,44,325,76])

add_block('built-in/S-Function',[sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/S-function']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/S-function']],...
		'function name','simbchdc',...
		'parameters','n, k, t,tp,dim',...
		'position',[170,20,235,40])

add_block('built-in/Mux',[sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/Mux']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/Mux']],...
		'inputs','[n, 1]',...
		'position',[80,41,115,74])

add_block('built-in/Inport',[sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/in_1']])
set_param([sys,'/',['Binary-sequential',13,'BCH decode1/Binary-vector',13,'BCH decode/in_1']],...
		'position',[20,15,40,35])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -