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

📄 tstfs2cd.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 3 页
字号:
		'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['FM',13,'passband/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,'passband/Scheduled',13,'reset-int']],...
		'Mask Entries','td\/ts\/Inf\/',...
		'position',[200,39,260,81])

add_block('built-in/Sum',[sys,'/',['FM',13,'passband/Sum']])
set_param([sys,'/',['FM',13,'passband/Sum']],...
		'position',[130,42,150,78])
add_line([sys,'/',['FM',13,'passband']],[435,60;460,60])
add_line([sys,'/',['FM',13,'passband']],[265,60;285,60])
add_line([sys,'/',['FM',13,'passband']],[155,60;195,60])
add_line([sys,'/',['FM',13,'passband']],[65,95;90,95;90,70;125,70])
add_line([sys,'/',['FM',13,'passband']],[85,50;125,50])
set_param([sys,'/',['FM',13,'passband']],...
		'Mask Display','plot(0,0,100,100,x,y);FM',...
		'Mask Type','Passband FM')
set_param([sys,'/',['FM',13,'passband']],...
		'Mask Dialogue','Modulate the input signal using FM method.|Carrier frequency (Hz):|Initial phase (rad):|Sample time (sec):|Symbol interval (sec; Use Inf for analog mod);')
set_param([sys,'/',['FM',13,'passband']],...
		'Mask Translate','Fc=@1;Ph=@2;pi2=2*pi;ts=@3;td=@4;if isinf(td),td=inf;end;[x,y]=moduicon(3);')
set_param([sys,'/',['FM',13,'passband']],...
		'Mask Help','This block modulates the input signal using frequency modulation method. The frequency of the output of the carrier signal depends on the amplitude of the input signal.')
set_param([sys,'/',['FM',13,'passband']],...
		'Mask Entries','100/2/pi\/0\/ts\/td\/')


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

set_param([sys,'/',['FM',13,'passband']],...
		'hide name',0,...
		'position',[225,43,305,87])


%     Subsystem  'M-FSK coherent demodulation'.

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


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

set_param([sys,'/','M-FSK coherent demodulation'],...
		'ForeGround',3,...
		'position',[345,35,570,106])

add_block('built-in/Mux',[sys,'/','Mux'])
set_param([sys,'/','Mux'],...
		'hide name',0,...
		'inputs','2',...
		'position',[615,52,650,103])


%     Subsystem  'Min//max index'.

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

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

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

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

add_block('built-in/S-Function',[sys,'/','Min//max index/Maximum'])
set_param([sys,'/','Min//max index/Maximum'],...
		'function name','arymimai',...
		'parameters','mima',...
		'position',[240,20,320,40])
add_line([sys,'/','Min//max index'],[90,30;160,30])
add_line([sys,'/','Min//max index'],[325,30;330,30])
add_line([sys,'/','Min//max index'],[205,30;235,30])
set_param([sys,'/','Min//max index'],...
		'Mask Display','Min/Max\ndemap',...
		'Mask Type','Maximum/minimum index.')
set_param([sys,'/','Min//max index'],...
		'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 index'],...
		'Mask Translate','td=@1;mima=@2;')
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',[485,43,565,87])


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

new_system([sys,'/',['Coh MFSK demod',13,'corr passband']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],'Location',[210,425,800,670])

add_block('built-in/Gain',[sys,'/',['Coh MFSK demod',13,'corr passband/Gain']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Gain']],...
		'Gain','Fc',...
		'position',[70,155,110,185])

add_block('built-in/Sum',[sys,'/',['Coh MFSK demod',13,'corr passband/Sum2']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Sum2']],...
		'inputs','+-',...
		'position',[205,160,230,195])

add_block('built-in/Clock',[sys,'/',['Coh MFSK demod',13,'corr passband/Clock']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Clock']],...
		'position',[35,160,55,180])

add_block('built-in/Zero-Order Hold',[sys,'/',['Coh MFSK demod',13,'corr passband/Zero-Order',13,'Hold']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Zero-Order',13,'Hold']],...
		'Sample time','td',...
		'position',[135,184,170,216])

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

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

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

add_block('built-in/S-Function',[sys,'/',['Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
		'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 passband/Scheduled',13,'reset-int1']],...
		'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 passband/Scheduled',13,'reset-int1']],...
		'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Scheduled',13,'reset-int1']],...
		'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 passband/Scheduled',13,'reset-int1']],...
		'Mask Entries','td\/ts\/Inf\/',...
		'position',[470,44,530,86])

add_block('built-in/Product',[sys,'/',['Coh MFSK demod',13,'corr passband/Product']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Product']],...
		'position',[415,46,440,79])

add_block('built-in/Sum',[sys,'/',['Coh MFSK demod',13,'corr passband/Sum1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/Sum1']],...
		'inputs','+++',...
		'position',[265,75,290,115])

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

add_block('built-in/Inport',[sys,'/',['Coh MFSK demod',13,'corr passband/in_1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/in_1']],...
		'position',[365,45,385,65])

add_block('built-in/Outport',[sys,'/',['Coh MFSK demod',13,'corr passband/out_1']])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband/out_1']],...
		'position',[560,55,580,75])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[175,200;180,200;180,185;200,185])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[115,170;130,200])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[115,170;200,170])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[235,180;250,180;260,110])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[60,170;65,170])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[105,125;230,125;230,95;260,95])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[205,60;225,60;225,80;260,80])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[85,60;135,60])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[380,95;400,95;410,70])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[295,95;320,95])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[445,65;465,65])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[390,55;410,55])
add_line([sys,'/',['Coh MFSK demod',13,'corr passband']],[535,65;555,65])
set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],...
		'Mask Display','Coh corr\nMFSK dm',...
		'Mask Type','Passband coherent MFSK correlation')
set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],...
		'Mask Dialogue','Compute MFSK correlation. Take MFSK\nmodulated signal. Output a vector of\ncorrelation result.|M-ary number (input in range [0, M-1]):|Tone space (Hz):|Symbol interval and offset (sec):|Carrier frequency (Hz):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],...
		'Mask Translate','pi2=2*pi;N=@1;Fc=@4*pi2;Ph=@5;Ton=@2;sft=[0:N-1]*Ton*pi2;td=@3;ts=@6;')
set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],...
		'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, using the Min/max demap block. The computation is phase sensitive.')
set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],...
		'Mask Entries','M\/M/td/5\/td\/Fc\/0\/ts\/')


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

set_param([sys,'/',['Coh MFSK demod',13,'corr passband']],...
		'hide name',0,...
		'position',[360,43,440,87])


%     Subsystem  'Graph1'.

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

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_block('built-in/Inport',[sys,'/','Graph1/x'])
set_param([sys,'/','Graph1/x'],...
		'position',[65,55,85,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',[625,116,655,154])


%     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'],...

⌨️ 快捷键说明

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