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

📄 tcemmfsk.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 5 页
字号:
		'position',[330,26,385,54])

add_block('built-in/Fcn',[sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/sin']])
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/sin']],...
		'Expr','sin(u)',...
		'position',[330,86,385,114])

add_block('built-in/Mux',[sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Mux']])
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Mux']],...
		'inputs','2',...
		'position',[415,31,450,64])

add_block('built-in/Outport',[sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/out_1']])
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/out_1']],...
		'position',[550,40,570,60])

add_block('built-in/Gain',[sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Sensitivity']])
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Sensitivity']],...
		'Gain','pi2',...
		'position',[80,25,120,55])

add_block('built-in/S-Function',[sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Scheduled',13,'reset-int']])
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Scheduled',13,'reset-int']],...
		'function name','schdint',...
		'parameters','td, ts, limit',...
		'Mask Display','Schdld\nreset-int',...
		'Mask Type','Scheduled reset integration.')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Scheduled',13,'reset-int']],...
		'Mask Dialogue','Reset the state to be zero(s) at the scheduled reset point.|Scheduled reset time inteval and offset:|Sample time and offset:|Modulo bound:')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Scheduled',13,'reset-int']],...
		'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Scheduled',13,'reset-int']],...
		'Mask Help','This block resets the state(s) to be zero(s) at the begining of reset time inteval. The reset inteval can be a two elements vector with the second element being offset.')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband/Scheduled',13,'reset-int']],...
		'Mask Entries','td\/ts\/pi2\/',...
		'position',[155,14,215,56])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[290,40;325,40])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[300,40;300,100;325,100])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[210,100;250,100;260,45])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[220,35;260,35])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[390,40;410,40])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[455,50;545,50])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[390,100;395,100;395,55;410,55])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[60,35;60,40;75,40])
add_line([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],[125,40;150,35])
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);FM',...
		'Mask Type','FM CE')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],...
		'Mask Dialogue','Output the complex envelope of the FM signal.|Initial phase (rad):|Sample time (second):|Symbol interval (for digital mod, use Inf for analog mod):')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],...
		'Mask Translate','Kc=2*pi;Ph=@1;pi2=2*pi;ts=@2;td=@3;if isinf(td),td=inf;end;[x,y]=moduicon(3);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],...
		'Mask Help','This block outputs the complex envelope of the frequency modulated signal. The output is a complex signal. This block resets the phase at the very beginning of the symbol interval. For continuous-time simulation, the symbol interval can be set as infinity.')
set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],...
		'Mask Entries','Ph\/ts\/td\/')


%     Finished composite block ['MFSK mod',13,'baseband/FM',13,'baseband'].

set_param([sys,'/',['MFSK mod',13,'baseband/FM',13,'baseband']],...
		'ForeGround',4,...
		'position',[185,48,260,92])

add_block('built-in/Outport',[sys,'/',['MFSK mod',13,'baseband/out_1']])
set_param([sys,'/',['MFSK mod',13,'baseband/out_1']],...
		'position',[290,60,310,80])

add_block('built-in/Inport',[sys,'/',['MFSK mod',13,'baseband/in_1']])
set_param([sys,'/',['MFSK mod',13,'baseband/in_1']],...
		'position',[15,60,35,80])
add_line([sys,'/',['MFSK mod',13,'baseband']],[40,70;65,70])
add_line([sys,'/',['MFSK mod',13,'baseband']],[155,70;180,70])
add_line([sys,'/',['MFSK mod',13,'baseband']],[265,70;285,70])
set_param([sys,'/',['MFSK mod',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);MFSK',...
		'Mask Type','Baseband MFSK modulation')
set_param([sys,'/',['MFSK mod',13,'baseband']],...
		'Mask Dialogue','Output the complex envelope of the\nmultiple-frequency shift keying modulation.|Tone space(Hz):|Symbol interval (sec):|Initial phase (rad):|Sample frequency (sec):')
set_param([sys,'/',['MFSK mod',13,'baseband']],...
		'Mask Translate','Ton=@1;td=@2;Ph=@3;ts=@4;if isinf(td),td=inf;end;[x,y]=moduicon(7);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['MFSK mod',13,'baseband']],...
		'Mask Help','This block outputs the complex envelop of MFSK modulated signal. The input signal is integers in the range [0, M-1]. The maximum amplitude of the output is 1. When the symbol interval is a two-element vector, the second element is the offset (default 0). The block takes the input value at the sampling time point.')
set_param([sys,'/',['MFSK mod',13,'baseband']],...
		'Mask Entries','M/td/5\/td\/0\/ts\/')


%     Finished composite block ['MFSK mod',13,'baseband'].

set_param([sys,'/',['MFSK mod',13,'baseband']],...
		'hide name',0,...
		'position',[150,38,230,82])


%     Subsystem  ['Rayleigh fading',13,'channel'].

new_system([sys,'/',['Rayleigh fading',13,'channel']])
set_param([sys,'/',['Rayleigh fading',13,'channel']],'Location',[476,508,847,748])

add_block('built-in/Outport',[sys,'/',['Rayleigh fading',13,'channel/out_1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/out_1']],...
		'position',[290,125,310,145])

add_block('built-in/Mux',[sys,'/',['Rayleigh fading',13,'channel/Mux']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Mux']],...
		'inputs','2',...
		'position',[220,116,255,149])


%     Subsystem  ['Rayleigh fading',13,'channel/Inner',13,'Product1'].

new_system([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],'Location',[33,479,253,634])

add_block('built-in/Product',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/Product']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/Product']],...
		'position',[65,55,90,75])

add_block('built-in/Sum',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/Sum']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/Sum']],...
		'inputs','+',...
		'position',[125,55,145,75])

add_block('built-in/Outport',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/out_1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/out_1']],...
		'position',[185,55,205,75])

add_block('built-in/Inport',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/in_2']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/in_2']],...
		'Port','2',...
		'position',[15,90,35,110])

add_block('built-in/Inport',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/in_1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1/in_1']],...
		'position',[15,25,35,45])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],[40,100;60,70])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],[40,35;60,60])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],[95,65;120,65])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],[150,65;180,65])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],...
		'Mask Display','.\n',...
		'Mask Type','Dot Product',...
		'Mask Dialogue','Inner (dot) product.\ny=sum(u1.*u2)')
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],...
		'Mask Help','Computes the inner (dot) product of the inputs: sum(u1.*u2).  The inputs are vectors of the same length. Output is a scalar.')


%     Finished composite block ['Rayleigh fading',13,'channel/Inner',13,'Product1'].

set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product1']],...
		'position',[150,154,170,176])

add_block('built-in/Constant',[sys,'/',['Rayleigh fading',13,'channel/Constant1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Constant1']],...
		'Value','[quad, in_p]',...
		'position',[30,155,105,185])


%     Subsystem  ['Rayleigh fading',13,'channel/Inner',13,'Product'].

new_system([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],'Location',[33,479,253,634])

add_block('built-in/Inport',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/in_1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/in_1']],...
		'position',[15,25,35,45])

add_block('built-in/Inport',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/in_2']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/in_2']],...
		'Port','2',...
		'position',[15,90,35,110])

add_block('built-in/Outport',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/out_1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/out_1']],...
		'position',[185,55,205,75])

add_block('built-in/Sum',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/Sum']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/Sum']],...
		'inputs','+',...
		'position',[125,55,145,75])

add_block('built-in/Product',[sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/Product']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product/Product']],...
		'position',[65,55,90,75])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],[150,65;180,65])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],[95,65;120,65])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],[40,35;60,60])
add_line([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],[40,100;60,70])
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],...
		'Mask Display','.\n',...
		'Mask Type','Dot Product',...
		'Mask Dialogue','Inner (dot) product.\ny=sum(u1.*u2)')
set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],...
		'Mask Help','Computes the inner (dot) product of the inputs: sum(u1.*u2).  The inputs are vectors of the same length. Output is a scalar.')


%     Finished composite block ['Rayleigh fading',13,'channel/Inner',13,'Product'].

set_param([sys,'/',['Rayleigh fading',13,'channel/Inner',13,'Product']],...
		'position',[150,69,170,91])

⌨️ 快捷键说明

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