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

📄 tcemmfsk.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 5 页
字号:
add_block('built-in/Constant',[sys,'/',['Rayleigh fading',13,'channel/Constant']])
set_param([sys,'/',['Rayleigh fading',13,'channel/Constant']],...
		'Value','[in_p, -quad]',...
		'position',[30,70,105,100])

add_block('built-in/Inport',[sys,'/',['Rayleigh fading',13,'channel/in_1']])
set_param([sys,'/',['Rayleigh fading',13,'channel/in_1']],...
		'position',[30,20,50,40])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[260,135;285,135])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[175,165;190,165;190,140;215,140])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[175,80;190,80;190,125;215,125])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[55,30;120,30;120,75;145,75])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[120,75;120,160;145,160])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[110,170;145,170])
add_line([sys,'/',['Rayleigh fading',13,'channel']],[110,85;145,85])
set_param([sys,'/',['Rayleigh fading',13,'channel']],...
		'Mask Display','plot(0,0,100,100,x,y,v,w,u,z);Rayl F',...
		'Mask Type','Rayleigh fading channel, fixed parameter')
set_param([sys,'/',['Rayleigh fading',13,'channel']],...
		'Mask Dialogue','Rayleigh fading channel with fixed\nfading envelope and phase shift.|Rayleigh fading envelope:|Phase shift of the channel (rad):')
set_param([sys,'/',['Rayleigh fading',13,'channel']],...
		'Mask Translate','a=@1;b=@2;in_p=a*cos(b);quad=a*sin(b);[x,y]=chanicon;[v,w]=cmplxicn(0,50,get_param(gcb,''orientation''));[u,z]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['Rayleigh fading',13,'channel']],...
		'Mask Help','This block applies the fading and phase shifting to the transmitting signal. In general, the fading envelope should be no larger than one. The input and the output of this block are both complex signals.')
set_param([sys,'/',['Rayleigh fading',13,'channel']],...
		'Mask Entries','.5\/pi/50\/')


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

set_param([sys,'/',['Rayleigh fading',13,'channel']],...
		'hide name',0,...
		'position',[265,38,345,82])

add_block('built-in/Mux',[sys,'/','Mux1'])
set_param([sys,'/','Mux1'],...
		'hide name',0,...
		'inputs','2',...
		'position',[555,67,590,118])


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

new_system([sys,'/',['Coh MFSK',13,'demod baseband']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband']],'Location',[480,612,899,747])


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

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

add_block('built-in/S-Function',[sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/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',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Type','Moving window integration.')
set_param([sys,'/',['Coh MFSK',13,'demod baseband/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',13,'demod baseband/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',13,'demod baseband/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',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator1']],...
		'Mask Entries','N\/td\/ts\/''backward''\/',...
		'position',[510,128,585,172])

add_block('built-in/S-Function',[sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/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',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Limited-length',13,'integrator']],...
		'Mask Type','Moving window integration.')
set_param([sys,'/',['Coh MFSK',13,'demod baseband/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',13,'demod baseband/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',13,'demod baseband/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',13,'demod baseband/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/Sum',[sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Sum3']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Sum3']],...
		'position',[640,105,660,125])

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

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

add_block('built-in/S-Function',[sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Array sin1']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/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',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Product']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Product']],...
		'position',[450,21,475,54])

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

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

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

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

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

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

add_block('built-in/Constant',[sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Shift key']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband/Shift key']],...
		'Value','sft',...
		'position',[60,48,80,72])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[375,45;405,45;405,140;450,140])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[385,155;450,155])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[485,150;505,150])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[480,40;500,40])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[585,40;605,40;605,110;635,110])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[590,150;605,150;605,120;635,120])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[665,115;680,115])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[380,95;415,95;415,45;445,45])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[375,30;445,30])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[285,40;325,40])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[295,95;320,95])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[305,95;305,155;325,155])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[85,60;120,60])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[190,60;225,60;225,85;260,85])
add_line([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],[130,125;230,125;230,100;260,100])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/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',13,'demod baseband/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',13,'demod baseband/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',13,'demod baseband/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 input of this block is complex signal.')
set_param([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],...
		'Mask Entries','M\/Ton\/td\/Ph\/ts\/')


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

set_param([sys,'/',['Coh MFSK',13,'demod baseband/Coh MFSK demod',13,'corr baseband']],...
		'position',[90,28,170,72])


%     Subsystem  ['Coh MFSK',13,'demod baseband/Min//max index'].

new_system([sys,'/',['Coh MFSK',13,'demod baseband/Min//max index']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/Min//max index']],'Location',[192,461,623,564])

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

add_block('built-in/Zero-Order Hold',[sys,'/',['Coh MFSK',13,'demod baseband/Min//max index/Zero-Order',13,'Hold']])
set_param([sys,'/',['Coh MFSK',13,'demod baseband/Min//max index/Zero-Order',13,'Hold']],...

⌨️ 快捷键说明

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