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

📄 elg.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 5 页
字号:
add_block('built-in/Sum',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Sum2']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Sum2']],...
		'orientation',2,...
		'hide name',0,...
		'inputs','+-',...
		'position',[500,135,520,155])

add_block('built-in/Constant',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Constant']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Constant']],...
		'ForeGround',4,...
		'Value','-1',...
		'position',[90,135,110,155])

add_block('built-in/Product',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Product']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Product']],...
		'orientation',1,...
		'hide name',0,...
		'position',[170,160,205,180])

add_block('built-in/Sum',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Sum1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Sum1']],...
		'orientation',3,...
		'hide name',0,...
		'inputs','-+',...
		'position',[172,110,203,130])

add_block('built-in/Sum',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Sum']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Sum']],...
		'orientation',1,...
		'hide name',0,...
		'inputs','-+',...
		'position',[167,200,198,220])

add_block('built-in/Abs',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Abs1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Abs1']],...
		'hide name',0,...
		'position',[490,253,520,277])

add_block('built-in/Gain',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Gain1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Gain1']],...
		'hide name',0,...
		'Gain','1/tdd',...
		'position',[365,237,390,263])

add_block('built-in/Abs',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Abs']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Abs']],...
		'hide name',0,...
		'position',[500,48,530,72])


%     Subsystem  ['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold'].

new_system([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],'Location',[139,159,529,329])

add_block('built-in/Transport Delay',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Transport',13,'Delay']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Transport',13,'Delay']],...
		'hide name',0,...
		'Delay Time','tss/2',...
		'position',[80,25,120,55])

add_block('built-in/Inport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/in_2']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/in_2']],...
		'Port','2',...
		'position',[25,90,45,110])

add_block('built-in/Unit Delay',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Unit Delay']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Unit Delay']],...
		'hide name',0,...
		'Sample time','tss',...
		'position',[235,92,285,108])

add_block('built-in/Outport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/out_1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/out_1']],...
		'position',[340,90,360,110])

add_block('built-in/Switch',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Switch']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Switch']],...
		'hide name',0,...
		'Threshold','.5',...
		'position',[180,84,210,116])

add_block('built-in/Inport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/in_1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/in_1']],...
		'position',[25,30,45,50])


%     Subsystem  ['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1'].

new_system([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],'Location',[282,116,671,290])

add_block('built-in/Relational Operator',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Relational',13,'Operator']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Relational',13,'Operator']],...
		'position',[135,18,165,42])

add_block('built-in/Inport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/in_1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/in_1']],...
		'position',[10,15,30,35])

add_block('built-in/Memory',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Memory1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Memory1']],...
		'position',[125,80,165,110])

add_block('built-in/Constant',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/one1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/one1']],...
		'Value','thld',...
		'position',[30,135,60,155])

add_block('built-in/Relational Operator',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Relational',13,'Operator2']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Relational',13,'Operator2']],...
		'Operator','>',...
		'position',[265,23,295,47])

add_block('built-in/Relational Operator',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Relational',13,'Operator1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/Relational',13,'Operator1']],...
		'position',[200,88,230,112])

add_block('built-in/Outport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/out_1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1/out_1']],...
		'position',[340,25,360,45])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[300,35;335,35])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[235,100;240,100;240,40;260,40])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[170,30;260,30])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[65,145;100,145;100,35;130,35])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[100,145;180,145;180,105;195,105])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[170,95;195,95])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[35,25;130,25])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],[45,25;45,95;120,95])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],...
		'Mask Display','plot(0,0,100,100,x,y,v,w);Edge det.',...
		'Mask Type','Edge detection')
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],...
		'Mask Dialogue','Detect the rising edge of the input\nsignal. Output one when the rising\nedge is detected.|Threshold:')
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],...
		'Mask Translate','thld=@1;[v,w]=trigicon(0,50,get_param(gcb,''orientation''),2);[x,y]=trigicon(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],...
		'Mask Help','This block outputs one when the input signal reaches a value larger than or equal to the given threshold value at the current time and the value was below the threshold one time step before. Otherwise, the block outputs zero.')
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],...
		'Mask Entries','0.5\/')


%     Finished composite block ['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1'].

set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold/Rising edge',13,'detector1']],...
		'position',[65,78,145,122])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[125,40;155,40;155,90;175,90])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[50,40;75,40])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[290,100;335,100])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[305,100;305,140;160,140;160,110;175,110])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[215,100;230,100])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[50,100;60,100])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],[150,100;175,100])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],...
		'Mask Display','Discrete\nSample\nand Hold',...
		'Mask Type','Discrete Sample and Hold')


%     Finished composite block ['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold'].

set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Discrete',13,'trighold']],...
		'hide name',0,...
		'position',[415,28,485,92])

add_block('built-in/Gain',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Gain']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Gain']],...
		'hide name',0,...
		'Gain','1/tdd',...
		'position',[370,32,395,58])


%     Subsystem  ['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4'].

new_system([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],'Location',[74,124,605,322])

add_block('built-in/Sum',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/Sum']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/Sum']],...
		'position',[185,30,205,50])

add_block('built-in/Inport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/reset value']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/reset value']],...
		'Port','3',...
		'position',[65,140,85,160])

add_block('built-in/Switch',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/Switch1']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/Switch1']],...
		'Threshold','eps',...
		'position',[240,54,265,86])

add_block('built-in/Unit Delay',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/Unit Delay']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/Unit Delay']],...
		'Sample time','tss',...
		'position',[290,62,340,78])

add_block('built-in/Outport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/integrated',13,' output']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/integrated',13,' output']],...
		'position',[435,60,455,80])

add_block('built-in/Relational Operator',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/equal']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/equal']],...
		'Operator','==',...
		'position',[140,69,170,91])

add_block('built-in/Inport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/data']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/data']],...
		'position',[65,35,85,55])

add_block('built-in/Inport',[sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/trigger']])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4/trigger']],...
		'Port','2',...
		'position',[65,95,85,115])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[270,70;275,70;275,100;395,100;395,70;430,70])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[90,150;190,150;190,80;235,80])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[210,40;215,40;215,60;235,60])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[90,45;180,45])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[345,70;380,70;380,15;160,15;160,35;180,35])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[175,80;175,70;235,70])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[270,70;285,70])
add_line([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],[90,105;115,105;115,75;135,75])
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],...
		'Mask Display','Discrete\nResettable\nintegrator',...
		'Mask Type','Discrete Resettable integrator')
set_param([sys,'/',['Discrete',13,' Early-Late',13,' Gate/Descrete',13,' Resettable',13,'integrator4']],...
		'Mask Help','RESETTABLE INTEGRATOR  The resettable integrator is a masked function. This block has same functionality as the built-in RESET INTEGRATOR except that when input 2 is non-zero, the block stops integration.')

⌨️ 快捷键说明

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