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

📄 testamc2.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 4 页
字号:
set_param([sys,'/',['AM with carrier',13,'baseband/Constant']],...
		'Value','Offset',...
		'position',[35,80,85,100])


%     Subsystem  ['AM with carrier',13,'baseband/DSB AM CE'].

new_system([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],'Location',[212,430,575,573])

add_block('built-in/Outport',[sys,'/',['AM with carrier',13,'baseband/DSB AM CE/out_1']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE/out_1']],...
		'position',[320,50,340,70])

add_block('built-in/Product',[sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Product']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Product']],...
		'position',[255,42,280,73])

add_block('built-in/Inport',[sys,'/',['AM with carrier',13,'baseband/DSB AM CE/in_1']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE/in_1']],...
		'position',[115,15,135,35])

add_block('built-in/Mux',[sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Mux']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Mux']],...
		'inputs','2',...
		'position',[170,66,205,99])

add_block('built-in/Constant',[sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Constant1']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Constant1']],...
		'Value','x2',...
		'position',[90,90,110,110])

add_block('built-in/Constant',[sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Constant']])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE/Constant']],...
		'Value','x1',...
		'position',[40,65,60,85])
add_line([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],[65,75;165,75])
add_line([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],[115,100;130,100;130,90;165,90])
add_line([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],[140,25;185,25;185,50;250,50])
add_line([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],[285,60;315,60])
add_line([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],[210,85;230,85;230,65;250,65])
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],...
		'Mask Display','DSB AM\ncmplx env',...
		'Mask Type','DSB-SC AM complex envelop')
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],...
		'Mask Dialogue','Double-sideband suppressed-carrier amplitude modulation complex envelop.|Initial Phase (rad):',...
		'Mask Translate','Ph=@1;x1=cos(Ph);x2=sin(Ph);pi2=2*pi;')
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],...
		'Mask Help','The Double-Sideband-Supressed-Carrier Amplitude Modulation causes the amplitude of the sinusoidal carrier to depend on the input message signal, resulting in amplitude modulation. This block outputs the complex envelop of the modulation, which is a complex number.')
set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],...
		'Mask Entries','Ph\/')


%     Finished composite block ['AM with carrier',13,'baseband/DSB AM CE'].

set_param([sys,'/',['AM with carrier',13,'baseband/DSB AM CE']],...
		'position',[180,25,255,65])
add_line([sys,'/',['AM with carrier',13,'baseband']],[90,90;100,90;100,50;120,50])
add_line([sys,'/',['AM with carrier',13,'baseband']],[260,45;275,45])
add_line([sys,'/',['AM with carrier',13,'baseband']],[75,40;120,40])
add_line([sys,'/',['AM with carrier',13,'baseband']],[150,45;175,45])
set_param([sys,'/',['AM with carrier',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);AM w TC',...
		'Mask Type','AM CE with TC')
set_param([sys,'/',['AM with carrier',13,'baseband']],...
		'Mask Dialogue','Output complex envelope of an AM with\ntransport carrier modulated signal.|Input signal offset:|Initial phase (rad):')
set_param([sys,'/',['AM with carrier',13,'baseband']],...
		'Mask Translate','Offset=@1;Ph=@2;[x,y]=moduicon(1);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['AM with carrier',13,'baseband']],...
		'Mask Help','This block causes the amplitude of the sinusoid carrier to depend on the message signal. An offset is added to the input signal before modulation. The output of this block is a complex signal. This modulation technique is not efficient.')
set_param([sys,'/',['AM with carrier',13,'baseband']],...
		'Mask Entries','1\/0\/')


%     Finished composite block ['AM with carrier',13,'baseband'].

set_param([sys,'/',['AM with carrier',13,'baseband']],...
		'ForeGround',2,...
		'hide name',0,...
		'position',[130,118,210,162])


%     Subsystem  ['ADM with carrier',13,'baseband'].

new_system([sys,'/',['ADM with carrier',13,'baseband']])
set_param([sys,'/',['ADM with carrier',13,'baseband']],'Location',[468,490,803,640])

add_block('built-in/Outport',[sys,'/',['ADM with carrier',13,'baseband/out_1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/out_1']],...
		'position',[290,30,310,50])

add_block('built-in/Sum',[sys,'/',['ADM with carrier',13,'baseband/Sum']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Sum']],...
		'inputs','+-',...
		'position',[240,30,260,50])

add_block('built-in/Inport',[sys,'/',['ADM with carrier',13,'baseband/in_1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/in_1']],...
		'position',[40,25,60,45])

add_block('built-in/Constant',[sys,'/',['ADM with carrier',13,'baseband/Constant']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Constant']],...
		'Value','Offset',...
		'position',[150,100,190,120])


%     Subsystem  ['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE'].

new_system([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE']],'Location',[103,111,653,332])

add_block('built-in/Filter',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/Filter1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/Filter1']],...
		'Numerator','num',...
		'Denominator','den',...
		'Sample time','ts',...
		'position',[260,156,315,194])


%     Subsystem  ['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO'].

new_system([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],'Location',[114,165,727,312])


%     Subsystem  ['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator'].

new_system([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],'Location',[40,403,515,507])

add_block('built-in/Discrete Transfer Fcn',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/Dis. Transfer Fcn']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/Dis. Transfer Fcn']],...
		'Numerator','ts(1)',...
		'Denominator','1',...
		'Sample time','ts',...
		'position',[90,17,135,53])

add_block('built-in/Inport',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/in_1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/in_1']],...
		'position',[15,25,35,45])

add_block('built-in/Fcn',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/module']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/module']],...
		'Expr','rem(u[1],modu)',...
		'position',[235,29,325,51])

add_block('built-in/Sum',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/Sum']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/Sum']],...
		'position',[195,30,215,50])

add_block('built-in/Unit Delay',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/Unit Delay']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/Unit Delay']],...
		'Sample time','ts',...
		'x0','init',...
		'position',[345,30,395,50])

add_block('built-in/Outport',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/out_1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator/out_1']],...
		'position',[445,30,465,50])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],[140,35;190,35])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],[40,35;85,35])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],[220,40;230,40])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],[330,40;340,40])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],[400,40;410,40;410,90;175,90;175,45;190,45])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],[410,40;440,40])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],...
		'Mask Display','discrete\nmod-int',...
		'Mask Type','Module Integrator')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],...
		'Mask Dialogue','Module the given number when state exceed limit|Module bound:|Initial value:|Sample time:')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],...
		'Mask Translate','init=@2; modu=@1;ts=@3;')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],...
		'Mask Help','The absolute value of this integrator will not exceed the specified module bound. The state value is set to be zero when the module bound is reached. This block can only be used for scale value calculation.')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],...
		'Mask Entries','pi2\/0\/ts\/')


%     Finished composite block ['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator'].

set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Dis module',13,'integrator']],...
		'position',[155,16,215,54])

add_block('built-in/Outport',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/out_1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/out_1']],...
		'position',[490,35,510,55])

add_block('built-in/Gain',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Sensitivity1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Sensitivity1']],...
		'Gain','Ac',...
		'position',[420,31,460,59])

add_block('built-in/Mux',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Mux']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Mux']],...
		'inputs','2',...
		'position',[355,26,390,59])

add_block('built-in/Fcn',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/sin']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/sin']],...
		'Expr','sin(u)',...
		'position',[270,81,325,109])

add_block('built-in/Fcn',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/cos']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/cos']],...
		'Expr','cos(u)',...
		'position',[270,21,325,49])

add_block('built-in/Gain',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Sensitivity']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/Sensitivity']],...
		'Gain','Kc',...
		'position',[80,21,120,49])

add_block('built-in/Inport',[sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/in_1']])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO/in_1']],...
		'position',[35,25,55,45])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[330,95;335,95;335,50;350,50])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[395,45;415,45])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[330,35;350,35])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[465,45;485,45])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[220,35;265,35])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[240,35;240,95;265,95])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[125,35;150,35])
add_line([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],[60,35;75,35])
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],...
		'Mask Display','FM\ncmplx env',...
		'Mask Type','FM with cmplx env out')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],...
		'Mask Dialogue','Frequency modulation with complex envelop output:|Amplitude constant:|Modulation sensitivity constant:|Initial phase (rad):|Sample time:')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],...
		'Mask Translate','Ac=@1;Kc=@2*2*pi;Ph=@3;pi2=2*pi;ts=@4;')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],...
		'Mask Help','The FM block cause the frequency of the sinusoidal carrier to depend on the input signal voltage, resulting in frequency of the output change depending on the amplitude of the input signal.')
set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],...
		'Mask Entries','1\/1\/0\/ts\/')


%     Finished composite block ['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO'].

set_param([sys,'/',['ADM with carrier',13,'baseband/Costas DSB-ADM',13,'CE/FM CE//VCO']],...
		'orientation',2,...
		'position',[205,80,285,120])

⌨️ 快捷键说明

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