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

📄 tutconcd.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 3 页
字号:
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/S-function1']],...
		'function name','homopuls',...
		'parameters','samp_time, out_divid, offset',...
		'position',[40,31,105,59])

add_block('built-in/Outport',[sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/Outport']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/Outport']],...
		'position',[160,35,180,55])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],[110,45;155,45])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Display','Vector\nPulse',...
		'Mask Type','Pulse generator')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'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,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'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,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Entries','ts\/1\/off\/')


%     Finished composite block ['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1'].

set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'position',[50,56,110,94])

add_block('built-in/Outport',[sys,'/',['Sampled read with',13,'synchronized pulse/out_1']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/out_1']],...
		'position',[295,65,315,85])

add_block('built-in/Outport',[sys,'/',['Sampled read with',13,'synchronized pulse/out_2']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/out_2']],...
		'Port','2',...
		'position',[195,115,215,135])

add_block('built-in/S-Function',[sys,'/',['Sampled read with',13,'synchronized pulse/Message source']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'BackGround',5,...
		'function name','trigwksp',...
		'parameters','var,thd,cyclFlag,ini',...
		'Mask Display','Triggered\nread')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Type','Read from workspace')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Dialogue','The raising edge of input pulse trigger the block output the next row from the workspace variable.|Read the variable:|Threshold for the input pulse:|Cyclic read variable (1) or amend zeros (0).|Output before first trigger:')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Translate','var=@1;thd=@2;cyclFlag=@3;ini=@4;')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Help','This block reads the data from a workspace variable. The output is refreshed at the raising edge of the input pulse.')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Entries','var\/.1\/cyc\/ini\/',...
		'position',[180,53,255,97])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse']],[260,75;290,75])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse']],[115,75;175,75])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse']],[135,75;135,125;190,125])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Display','plot(0,0,100,100,x,y,v,w);Rd wksp',...
		'Mask Type','Read from workspace')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Dialogue','Read from a workspace variable at\nsampling time point.|Variable (column_number=block_output_length):|Data output sample time (sec):|Cyclic control (1: cyclic read, 0: output zeros after eof).|Initial output:')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Translate','var=@1;td=@2;ts=td(1);if (length(td)>=2),off=td(2);else off=0;end;cyc=@3;ini=@4;[x,y]=srcsicon(7);[v,w]=trigicon(1,75,get_param(gcb,''orientation''),2);')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Help','This block reads from a workspace variable at a given sample time. The column number is the block output vector length. When the simulation reaches the end of the variable (eof) row, the block will cyclically output from the first row of the variable or output zeros based on the cyclic control entree. The second output is the synchronization pulse, which outputs a spike when the data is refreshed.')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Entries','randint(300,1,4)\/1\/1\/0\/')


%     Finished composite block ['Sampled read with',13,'synchronized pulse'].

set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'hide name',0,...
		'position',[10,48,90,92])


%     Subsystem  'Error rate1'.

new_system([sys,'/','Error rate1'])
set_param([sys,'/','Error rate1'],'Location',[255,368,509,510])

add_block('built-in/Inport',[sys,'/','Error rate1/in_2'])
set_param([sys,'/','Error rate1/in_2'],...
		'Port','2',...
		'position',[15,60,35,80])

add_block('built-in/Inport',[sys,'/','Error rate1/in_1'])
set_param([sys,'/','Error rate1/in_1'],...
		'position',[15,45,35,65])

add_block('built-in/Mux',[sys,'/','Error rate1/Mux'])
set_param([sys,'/','Error rate1/Mux'],...
		'inputs','2',...
		'position',[65,46,100,79])

add_block('built-in/S-Function',[sys,'/','Error rate1/S-function'])
set_param([sys,'/','Error rate1/S-function'],...
		'function name','sbiterr',...
		'parameters','num_lin, K, TDelay, Sample',...
		'position',[130,52,195,78])
add_line([sys,'/','Error rate1'],[40,70;60,70])
add_line([sys,'/','Error rate1'],[40,55;60,55])
add_line([sys,'/','Error rate1'],[105,65;125,65])
set_param([sys,'/','Error rate1'],...
		'Mask Display','Error\nmeter',...
		'Mask Type','Symbol/bit error counter')
set_param([sys,'/','Error rate1'],...
		'Mask Dialogue','Use the input data from the 1st port as the reference signal to detect the number of errors and error rate of the 2nd port inputted signal.|Bit per symbol:|Number of digits on display:|Delay between input (1st port) and output (2nd port):|Sampling time (sec):')
set_param([sys,'/','Error rate1'],...
		'Mask Translate','K=@1;num_lin=@2;TDelay=@3;Sample=@4;')
set_param([sys,'/','Error rate1'],...
		'Mask Help','The signal from the first port must be a scalar. The second input port can be a vector with a same-time delay to the input signal. The comparison happens only at the sampling point.')
set_param([sys,'/','Error rate1'],...
		'Mask Entries','2\/20\/8\/1\/')


%     Finished composite block 'Error rate1'.

set_param([sys,'/','Error rate1'],...
		'hide name',0,...
		'position',[675,28,755,72])


%     Subsystem  ['Binary vector',13,'convol encode1'].

new_system([sys,'/',['Binary vector',13,'convol encode1']])
set_param([sys,'/',['Binary vector',13,'convol encode1']],'Location',[214,496,654,646])

add_block('built-in/Inport',[sys,'/',['Binary vector',13,'convol encode1/in_1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/in_1']],...
		'position',[25,20,45,40])

add_block('built-in/Outport',[sys,'/',['Binary vector',13,'convol encode1/out_1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/out_1']],...
		'position',[365,30,385,50])

add_block('built-in/S-Function',[sys,'/',['Binary vector',13,'convol encode1/Modulo',13,'operation1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Modulo',13,'operation1']],...
		'function name','sconvenc',...
		'parameters','tf',...
		'position',[270,25,330,55])

add_block('built-in/Mux',[sys,'/',['Binary vector',13,'convol encode1/Mux']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Mux']],...
		'inputs','2',...
		'Mask Display','',...
		'position',[205,21,240,54])


%     Subsystem  ['Binary vector',13,'convol encode1/Rising edge',13,'detector'].

new_system([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],'Location',[282,116,671,290])

add_block('built-in/Relational Operator',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Relational',13,'Operator']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Relational',13,'Operator']],...
		'position',[135,18,165,42])

add_block('built-in/Inport',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/in_1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/in_1']],...
		'position',[10,15,30,35])

add_block('built-in/Memory',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Memory1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Memory1']],...
		'position',[125,80,165,110])

add_block('built-in/Constant',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/one1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/one1']],...
		'Value','thld',...
		'position',[30,135,60,155])

add_block('built-in/Relational Operator',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Relational',13,'Operator2']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Relational',13,'Operator2']],...
		'Operator','>',...
		'position',[265,23,295,47])

add_block('built-in/Relational Operator',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Relational',13,'Operator1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/Relational',13,'Operator1']],...
		'position',[200,88,230,112])

add_block('built-in/Outport',[sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/out_1']])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector/out_1']],...
		'position',[340,25,360,45])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[300,35;335,35])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[235,100;240,100;240,40;260,40])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[170,30;260,30])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[65,145;100,145;100,35;130,35])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[100,145;180,145;180,105;195,105])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[170,95;195,95])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[35,25;130,25])
add_line([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],[45,25;45,95;120,95])
set_param([sys,'/',['Binary vector',13,'convol encode1/Rising edge',13,'detector']],...
		'Mask Display','Edge\nDetector',...
		'Mask Type','Edge Detection',...

⌨️ 快捷键说明

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