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

📄 tmpfs2cd.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 3 页
字号:
set_param([sys,'/','Min//max index'],...
		'Mask Help','This block outputs the index of the vector element that has the maximum or minimum value in the input vector. The computation starts at the sampling time point. The block holds the value for the rest of the interval.')
set_param([sys,'/','Min//max index'],...
		'Mask Entries','td\/''max''\/')


%     Finished composite block 'Min//max index'.

set_param([sys,'/','Min//max index'],...
		'hide name',0,...
		'position',[495,63,575,107])


%     Subsystem  'M-FSK noncoherent demodulation'.

new_system([sys,'/','M-FSK noncoherent demodulation'])
set_param([sys,'/','M-FSK noncoherent demodulation'],'Location',[657,455,963,648])
set_param([sys,'/','M-FSK noncoherent demodulation'],...
		'Mask Display','.',...
		'Mask Dialogue',' ')


%     Finished composite block 'M-FSK noncoherent demodulation'.

set_param([sys,'/','M-FSK noncoherent demodulation'],...
		'ForeGround',3,...
		'position',[360,175,585,246])


%     Subsystem  'Min//max index1'.

new_system([sys,'/','Min//max index1'])
set_param([sys,'/','Min//max index1'],'Location',[192,461,623,564])

add_block('built-in/Inport',[sys,'/','Min//max index1/in_1'])
set_param([sys,'/','Min//max index1/in_1'],...
		'position',[65,20,85,40])

add_block('built-in/Zero-Order Hold',[sys,'/',['Min//max index1/Zero-Order',13,'Hold']])
set_param([sys,'/',['Min//max index1/Zero-Order',13,'Hold']],...
		'Sample time','td',...
		'position',[165,14,200,46])

add_block('built-in/Outport',[sys,'/','Min//max index1/out_1'])
set_param([sys,'/','Min//max index1/out_1'],...
		'position',[335,20,355,40])

add_block('built-in/S-Function',[sys,'/','Min//max index1/Maximum'])
set_param([sys,'/','Min//max index1/Maximum'],...
		'function name','arymimai',...
		'parameters','mima',...
		'position',[240,20,320,40])
add_line([sys,'/','Min//max index1'],[90,30;160,30])
add_line([sys,'/','Min//max index1'],[325,30;330,30])
add_line([sys,'/','Min//max index1'],[205,30;235,30])
set_param([sys,'/','Min//max index1'],...
		'Mask Display','Min/Max\ndemap',...
		'Mask Type','Maximum/minimum index.')
set_param([sys,'/','Min//max index1'],...
		'Mask Dialogue','Choose the index of the input vector with\nmax/min value at sampling point. Hold the\nvalue for the rest of the period.|Symbol interval (sec):|''max'' or ''min'':')
set_param([sys,'/','Min//max index1'],...
		'Mask Translate','td=@1;mima=@2;')
set_param([sys,'/','Min//max index1'],...
		'Mask Help','This block outputs the index of the vector element that has the maximum or minimum value in the input vector. The computation starts at the sampling time point. The block holds the value for the rest of the interval.')
set_param([sys,'/','Min//max index1'],...
		'Mask Entries','td\/''max''\/')


%     Finished composite block 'Min//max index1'.

set_param([sys,'/','Min//max index1'],...
		'hide name',0,...
		'position',[495,188,575,232])


%     Subsystem  ['FM',13,'baseband'].

new_system([sys,'/',['FM',13,'baseband']])
set_param([sys,'/',['FM',13,'baseband']],'Location',[55,571,668,718])

add_block('built-in/S-Function',[sys,'/',['FM',13,'baseband/Scheduled',13,'reset-int']])
set_param([sys,'/',['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,'/',['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,'/',['FM',13,'baseband/Scheduled',13,'reset-int']],...
		'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['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,'/',['FM',13,'baseband/Scheduled',13,'reset-int']],...
		'Mask Entries','td\/ts\/pi2\/',...
		'position',[155,14,215,56])

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

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

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

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

add_block('built-in/Fcn',[sys,'/',['FM',13,'baseband/cos']])
set_param([sys,'/',['FM',13,'baseband/cos']],...
		'Expr','cos(u)',...
		'position',[330,26,385,54])

add_block('built-in/Inport',[sys,'/',['FM',13,'baseband/in_1']])
set_param([sys,'/',['FM',13,'baseband/in_1']],...
		'position',[35,25,55,45])

add_block('built-in/Sum',[sys,'/',['FM',13,'baseband/Sum']])
set_param([sys,'/',['FM',13,'baseband/Sum']],...
		'position',[265,30,285,50])

add_block('built-in/Constant',[sys,'/',['FM',13,'baseband/Constant']])
set_param([sys,'/',['FM',13,'baseband/Constant']],...
		'Value','Ph',...
		'position',[180,90,205,110])
add_line([sys,'/',['FM',13,'baseband']],[125,40;150,35])
add_line([sys,'/',['FM',13,'baseband']],[60,35;60,40;75,40])
add_line([sys,'/',['FM',13,'baseband']],[390,100;395,100;395,55;410,55])
add_line([sys,'/',['FM',13,'baseband']],[455,50;545,50])
add_line([sys,'/',['FM',13,'baseband']],[390,40;410,40])
add_line([sys,'/',['FM',13,'baseband']],[220,35;260,35])
add_line([sys,'/',['FM',13,'baseband']],[210,100;250,100;260,45])
add_line([sys,'/',['FM',13,'baseband']],[290,40;325,40])
add_line([sys,'/',['FM',13,'baseband']],[300,40;300,100;325,100])
set_param([sys,'/',['FM',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);FM',...
		'Mask Type','FM CE')
set_param([sys,'/',['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,'/',['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,'/',['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,'/',['FM',13,'baseband']],...
		'Mask Entries','0\/ts\/td\/')


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

set_param([sys,'/',['FM',13,'baseband']],...
		'hide name',0,...
		'position',[230,63,310,107])


%     Subsystem  ['Coh MFSK demod',13,'corr baseband'].

new_system([sys,'/',['Coh MFSK demod',13,'corr baseband']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband']],'Location',[124,519,842,743])

add_block('built-in/Constant',[sys,'/',['Coh MFSK demod',13,'corr baseband/Shift key']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Shift key']],...
		'Value','sft',...
		'position',[60,48,80,72])

add_block('built-in/Sum',[sys,'/',['Coh MFSK demod',13,'corr baseband/Sum1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Sum1']],...
		'position',[265,77,290,108])

add_block('built-in/S-Function',[sys,'/',['Coh MFSK demod',13,'corr baseband/Array sin']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Array sin']],...
		'ForeGround',3,...
		'function name','arysin',...
		'parameters','''cos''',...
		'position',[325,85,375,105])

add_block('built-in/Constant',[sys,'/',['Coh MFSK demod',13,'corr baseband/Initial phase']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Initial phase']],...
		'Value','Ph',...
		'position',[105,113,125,137])

add_block('built-in/S-Function',[sys,'/',['Coh MFSK demod',13,'corr baseband/Scheduled',13,'reset-int']])
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband/Scheduled',13,'reset-int']],...
		'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband/Scheduled',13,'reset-int']],...
		'Mask Entries','td\/ts\/Inf\/',...
		'position',[125,39,185,81])

add_block('built-in/Inport',[sys,'/',['Coh MFSK demod',13,'corr baseband/in_1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/in_1']],...
		'position',[260,30,280,50])

add_block('built-in/Demux',[sys,'/',['Coh MFSK demod',13,'corr baseband/Demux']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Demux']],...
		'ForeGround',2,...
		'outputs','2',...
		'position',[330,20,370,55])

add_block('built-in/Product',[sys,'/',['Coh MFSK demod',13,'corr baseband/Product']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Product']],...
		'position',[450,21,475,54])

add_block('built-in/S-Function',[sys,'/',['Coh MFSK demod',13,'corr baseband/Array sin1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Array sin1']],...
		'ForeGround',4,...
		'function name','arysin',...
		'parameters','''sin''',...
		'position',[330,145,380,165])

add_block('built-in/Product',[sys,'/',['Coh MFSK demod',13,'corr baseband/Product3']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Product3']],...
		'position',[455,131,480,164])

add_block('built-in/Outport',[sys,'/',['Coh MFSK demod',13,'corr baseband/out_1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/out_1']],...
		'position',[685,105,705,125])

add_block('built-in/Sum',[sys,'/',['Coh MFSK demod',13,'corr baseband/Sum3']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Sum3']],...
		'position',[640,105,660,125])

add_block('built-in/S-Function',[sys,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']],...
		'function name','moveint',...
		'parameters','vec,T,sample_time,method',...
		'Mask Display','Windowed\nInt')
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Type','Moving window integration.')
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Translate','vec=@1;T=@2;sample_time=@3;method=@4;')
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Entries','N\/td\/ts\/''backward''\/',...
		'position',[505,18,580,62])

add_block('built-in/S-Function',[sys,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']],...
		'function name','moveint',...
		'parameters','vec,T,sample_time,method',...
		'Mask Display','Windowed\nInt')
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Type','Moving window integration.')
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Translate','vec=@1;T=@2;sample_time=@3;method=@4;')
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Entries','N\/td\/ts\/''backward''\/',...
		'position',[510,128,585,172])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[130,125;230,125;230,100;260,100])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[190,60;225,60;225,85;260,85])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[85,60;120,60])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[295,95;320,95])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[305,95;305,155;325,155])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[285,40;325,40])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[375,30;445,30])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[380,95;415,95;415,45;445,45])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[665,115;680,115])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[590,150;605,150;605,120;635,120])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[585,40;605,40;605,110;635,110])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[480,40;500,40])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[485,150;505,150])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[385,155;450,155])
add_line([sys,'/',['Coh MFSK demod',13,'corr baseband']],[375,45;405,45;405,140;450,140])
set_param([sys,'/',['Coh MFSK demod',13,'corr baseband']],...
		'Mask Display','plot(0,0,100,100,u,v);   Co MFSK',...
		'Mask Type','Baseband coherent MFSK correlation')
set_param([sys,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',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,'/',['Coh MFSK demod',13,'corr baseband']],...
		'Mask Help','This block calculates the coherent 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. The computation is phase sensitive. The input of this block is complex signal.')

⌨️ 快捷键说明

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