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

📄 tmpfs2cd.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 3 页
字号:
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband']],...
		'Mask Entries','M\/M/td/5\/td\/0\/ts\/')


%     Finished composite block ['Coh MFSK demod',13,'corr baseband'].

set_param([sys,'/',['Coh MFSK demod',13,'corr baseband']],...
		'hide name',0,...
		'position',[370,63,450,107])


%     Subsystem  ['Non-coh MFSK dm',13,'corr baseband'].

new_system([sys,'/',['Non-coh MFSK dm',13,'corr baseband']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],'Location',[69,218,990,452])

add_block('built-in/Constant',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Shift key']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Shift key']],...
		'Value','sft',...
		'position',[40,43,60,67])

add_block('built-in/S-Function',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Scheduled',13,'reset-int']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr 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,'/',['Non-coh MFSK dm',13,'corr 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,'/',['Non-coh MFSK dm',13,'corr baseband/Scheduled',13,'reset-int']],...
		'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr 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,'/',['Non-coh MFSK dm',13,'corr baseband/Scheduled',13,'reset-int']],...
		'Mask Entries','td\/ts\/Inf\/',...
		'position',[105,34,165,76])

add_block('built-in/Sum',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Sum1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Sum1']],...
		'position',[210,72,235,103])

add_block('built-in/Sum',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Sum3']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Sum3']],...
		'position',[285,108,305,137])

add_block('built-in/Constant',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Initial phase']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Initial phase']],...
		'Value','Ph',...
		'position',[85,118,105,142])

add_block('built-in/Mux',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Mux']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Mux']],...
		'inputs','2',...
		'position',[325,78,355,122])

add_block('built-in/S-Function',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Array sin']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Array sin']],...
		'ForeGround',3,...
		'function name','arysin',...
		'parameters','''cos''',...
		'position',[390,90,440,110])

add_block('built-in/S-Function',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Array sin1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Array sin1']],...
		'ForeGround',4,...
		'function name','arysin',...
		'parameters','''sin''',...
		'position',[395,150,445,170])

add_block('built-in/Sum',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Sum4']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Sum4']],...
		'inputs','++++',...
		'position',[785,87,805,133])

add_block('built-in/Product',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product2']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product2']],...
		'position',[645,141,670,174])

add_block('built-in/Product',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product3']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product3']],...
		'position',[480,136,505,169])

add_block('built-in/Inport',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/in_1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/in_1']],...
		'position',[345,40,365,60])

add_block('built-in/Demux',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Demux1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Demux1']],...
		'ForeGround',2,...
		'outputs','2',...
		'position',[395,30,435,65])

add_block('built-in/Product',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product1']],...
		'position',[645,36,670,69])

add_block('built-in/Product',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Product']],...
		'position',[490,31,515,64])

add_block('built-in/Outport',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/out_1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/out_1']],...
		'position',[830,100,850,120])

add_block('built-in/Demux',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Demux2']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Demux2']],...
		'outputs','2',...
		'position',[695,140,735,175])

add_block('built-in/Demux',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Demux']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Demux']],...
		'outputs','2',...
		'position',[685,35,725,70])

add_block('built-in/S-Function',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']],...
		'function name','moveint',...
		'parameters','vec,T,sample_time,method',...
		'Mask Display','Windowed\nInt')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Type','Moving window integration.')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Dialogue','Output the integration  of the input from time t-T to t, where T is the integration window.|Input vector size:|Integration window length:|Sample time:|Method (''forward'', ''backward'', or ''first order''):')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Translate','vec=@1;T=@2;sample_time=@3;method=@4;')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Help','This block output\n   t\nint u(t) dt\n t-T\nThe output vector length is the same as the input vector length.')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Entries','N*2\/td\/ts\/''backward''\/',...
		'position',[530,28,605,72])

add_block('built-in/S-Function',[sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']],...
		'function name','moveint',...
		'parameters','vec,T,sample_time,method',...
		'Mask Display','Windowed\nInt')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Type','Moving window integration.')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Dialogue','Output the integration  of the input from time t-T to t, where T is the integration window.|Input vector size:|Integration window length:|Sample time:|Method (''forward'', ''backward'', or ''first order''):')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Translate','vec=@1;T=@2;sample_time=@3;method=@4;')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Help','This block output\n   t\nint u(t) dt\n t-T\nThe output vector length is the same as the input vector length.')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Entries','N*2\/td\/ts\/''backward''\/',...
		'position',[525,133,600,177])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[310,125;320,110])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[520,50;525,50])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[610,50;615,45;640,45])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[610,50;615,60;640,60])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[675,55;680,55])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[730,45;760,45;760,95;780,95])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[730,60;755,60;755,105;780,105])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[810,110;825,110])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[65,55;100,55])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[170,55;185,55;185,80;205,80])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[240,90;320,90])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[260,90;260,115;280,115])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[110,130;185,130;185,95;205,95])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[185,130;280,130])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[360,100;385,100])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[370,100;370,160;390,160])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[370,50;390,50])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[675,160;690,160])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[605,155;615,155;615,165;640,165])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[605,155;615,155;615,150;640,150])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[510,155;520,155])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[740,150;755,150;755,115;780,115])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[740,165;760,165;760,125;780,125])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[450,160;475,160])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[440,55;450,55;450,145;475,145])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[440,40;485,40])
add_line([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],[445,100;460,100;460,55;485,55])
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],...
		'Mask Display','plot(0,0,100,100,u,v);  NC MFSK',...
		'Mask Type','Baseband non-coherent MFSK correlation')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],...
		'Mask Dialogue','Compute baseband MFSK correlation. Take\nMFSK CE modulated signal. Output a vector\nof correlation result.|M-ary number (input in range [0, M-1]):|Tone space (Hz):|Symbol interval and offset (sec):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],...
		'Mask Translate','pi2=2*pi;N=@1;Ph=@4;Ton=@2;sft=[0:N-1]*Ton*pi2;td=@3;ts=@5;[u,v]=cmplxicn(0,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],...
		'Mask Help','This block calculates the noncoherent correlation value of the input signal with a vector of sinusoidal signals. These sinusoidal signals have their frequency the same as that of FM modulated signal of possible resulting digits. The output is an M length vector. M is the M-ary number. The MFSK demodulation result is the index of the largest output, using the Min/max demap block. The input of this block is complex signal.')
set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],...
		'Mask Entries','M\/M/td/5\/td\/0\/ts\/')


%     Finished composite block ['Non-coh MFSK dm',13,'corr baseband'].

set_param([sys,'/',['Non-coh MFSK dm',13,'corr baseband']],...
		'hide name',0,...
		'position',[370,188,450,232])


%     Subsystem  'Graph1'.

new_system([sys,'/','Graph1'])
set_param([sys,'/','Graph1'],'Location',[0,59,274,252])

add_block('built-in/Inport',[sys,'/','Graph1/x'])
set_param([sys,'/','Graph1/x'],...
		'position',[65,55,85,75])

add_block('built-in/S-Function',[sys,'/',['Graph1/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['Graph1/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfuny',...
		'parameters','ax, color,dt',...
		'position',[130,55,180,75])
add_line([sys,'/','Graph1'],[90,65;125,65])
set_param([sys,'/','Graph1'],...
		'Mask Display','plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,90,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60,48,46,56,75,81,84])',...
		'Mask Type','Graph scope.')
set_param([sys,'/','Graph1'],...
		'Mask Dialogue','Graph scope using MATLAB graph window.\nEnter plotting ranges and line type.|Time range:|y-min:|y-max:|Line type (rgbw-:*). Seperate each plot by ''/'':|Sample time:')
set_param([sys,'/','Graph1'],...
		'Mask Translate','color = @4; ax = [0, @1, @2, @3]; dt = @5;')
set_param([sys,'/','Graph1'],...
		'Mask Help','This block plots to the MATLAB graph window and can be used as an improved version of the Scope block. Look at the m-file sfuny.m to see how it works. This block can take scalar or vector input signal.')
set_param([sys,'/','Graph1'],...
		'Mask Entries','5*td\/-.1\/.15\/''r-/y--/b-./g-/c--/w-./m:/r:/y--/b--/g--/c--/w--/m--/r:/y:/b:/g:''\/ts\/')


%     Finished composite block 'Graph1'.

set_param([sys,'/','Graph1'],...
		'position',[635,136,665,174])


%     Subsystem  'Graph2'.

new_system([sys,'/','Graph2'])
set_param([sys,'/','Graph2'],'Location',[0,59,274,252])

add_block('built-in/S-Function',[sys,'/',['Graph2/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['Graph2/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfuny',...
		'parameters','ax, color,dt',...
		'position',[130,55,180,75])

add_block('built-in/Inport',[sys,'/','Graph2/x'])
set_param([sys,'/','Graph2/x'],...
		'position',[65,55,85,75])
add_line([sys,'/','Graph2'],[90,65;125,65])
set_param([sys,'/','Graph2'],...
		'Mask Display','plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,90,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60,48,46,56,75,81,84])',...
		'Mask Type','Graph scope.')
set_param([sys,'/','Graph2'],...
		'Mask Dialogue','Graph scope using MATLAB graph window.\nEnter plotting ranges and line type.|Time range:|y-min:|y-max:|Line type (rgbw-:*). Seperate each plot by ''/'':|Sample time:')
set_param([sys,'/','Graph2'],...
		'Mask Translate','color = @4; ax = [0, @1, @2, @3]; dt = @5;')
set_param([sys,'/','Graph2'],...
		'Mask Help','This block plots to the MATLAB graph window and can be used as an improved version of the Scope block. Look at the m-file sfuny.m to see how it works. This block can take scalar or vector input signal.')
set_param([sys,'/','Graph2'],...
		'Mask Entries','5*td\/-.001\/.03\/''r-/y--/b-./g-/c--/w-./m:/r:/y--/b--/g--/c--/w--/m--/r:/y:/b:/g:''\/ts\/')


%     Finished composite block 'Graph2'.

set_param([sys,'/','Graph2'],...
		'position',[645,251,675,289])
add_line(sys,[455,210;490,210])
add_line(sys,[475,210;475,270;640,270])
add_line(sys,[455,85;490,85])
add_line(sys,[475,85;475,155;630,155])
add_line(sys,[315,85;365,85])
add_line(sys,[345,85;345,210;365,210])
add_line(sys,[580,210;595,210;595,110;620,110])
add_line(sys,[220,85;225,85])
add_line(sys,[100,85;100,30;675,30;675,80;695,80])
add_line(sys,[580,85;620,85])
add_line(sys,[100,85;130,85])
add_line(sys,[665,100;695,100])

drawnow

% Return any arguments.
if (nargin | nargout)
	% Must use feval here to access system in memory
	if (nargin > 3)
		if (flag == 0)
			eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
		else
			eval(['ret =', sys,'(t,x,u,flag);'])
		end
	else
		[ret,x0,str,ts,xts] = feval(sys);
	end
else
	drawnow % Flash up the model and execute load callback
end

⌨️ 快捷键说明

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