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

📄 com_sour.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 5 页
字号:
%     Subsystem  ['QASK Mo//Dem',13,'demo10'].

new_system([sys,'/',['QASK Mo//Dem',13,'demo10']])
set_param([sys,'/',['QASK Mo//Dem',13,'demo10']],'Location',[175,552,335,697])
set_param([sys,'/',['QASK Mo//Dem',13,'demo10']],...
		'Mask Display','Binary\nvector\ndemo',...
		'Mask Dialogue','eval(''tbrand'')')


%     Finished composite block ['QASK Mo//Dem',13,'demo10'].

set_param([sys,'/',['QASK Mo//Dem',13,'demo10']],...
		'BackGround',7,...
		'hide name',0,...
		'position',[595,338,675,382])


%     Subsystem  ['QASK Mo//Dem',13,'demo11'].

new_system([sys,'/',['QASK Mo//Dem',13,'demo11']])
set_param([sys,'/',['QASK Mo//Dem',13,'demo11']],'Location',[175,552,335,697])
set_param([sys,'/',['QASK Mo//Dem',13,'demo11']],...
		'Mask Display','Uniform\ninteger\ndemo',...
		'Mask Dialogue','eval(''td=.1;tirand'')')


%     Finished composite block ['QASK Mo//Dem',13,'demo11'].

set_param([sys,'/',['QASK Mo//Dem',13,'demo11']],...
		'BackGround',7,...
		'hide name',0,...
		'position',[595,188,675,232])


%     Subsystem  ['QASK Mo//Dem',13,'demo12'].

new_system([sys,'/',['QASK Mo//Dem',13,'demo12']])
set_param([sys,'/',['QASK Mo//Dem',13,'demo12']],'Location',[175,552,335,697])
set_param([sys,'/',['QASK Mo//Dem',13,'demo12']],...
		'Mask Display','Rayleigh\nrandom\ndemo',...
		'Mask Dialogue','eval(''td=.1;tstrayl'')')


%     Finished composite block ['QASK Mo//Dem',13,'demo12'].

set_param([sys,'/',['QASK Mo//Dem',13,'demo12']],...
		'BackGround',7,...
		'hide name',0,...
		'position',[595,413,675,457])


%     Subsystem  ['QASK Mo//Dem',13,'demo13'].

new_system([sys,'/',['QASK Mo//Dem',13,'demo13']])
set_param([sys,'/',['QASK Mo//Dem',13,'demo13']],'Location',[175,552,335,697])
set_param([sys,'/',['QASK Mo//Dem',13,'demo13']],...
		'Mask Display','Rician\nrandom\ndemo',...
		'Mask Dialogue','eval(''td=.1;tstricia'')')


%     Finished composite block ['QASK Mo//Dem',13,'demo13'].

set_param([sys,'/',['QASK Mo//Dem',13,'demo13']],...
		'BackGround',7,...
		'hide name',0,...
		'position',[595,488,675,532])


%     Subsystem  ['Poisson int',13,'generator'].

new_system([sys,'/',['Poisson int',13,'generator']])
set_param([sys,'/',['Poisson int',13,'generator']],'Location',[391,74,676,237])

add_block('built-in/S-Function',[sys,'/',['Poisson int',13,'generator/Poisson distribution',13,'number']])
set_param([sys,'/',['Poisson int',13,'generator/Poisson distribution',13,'number']],...
		'function name','srandpoi',...
		'parameters','seed,lambda',...
		'position',[65,55,135,95])

add_block('built-in/Outport',[sys,'/',['Poisson int',13,'generator/out_1']])
set_param([sys,'/',['Poisson int',13,'generator/out_1']],...
		'position',[165,65,185,85])
add_line([sys,'/',['Poisson int',13,'generator']],[140,75;160,75])
set_param([sys,'/',['Poisson int',13,'generator']],...
		'Mask Display','plot(0,0,100,100,x,y);Poisson int',...
		'Mask Type','Poisson random integer generator',...
		'Mask Dialogue','Generate Poisson distributed random integers.|Lambda:|Seed:')
set_param([sys,'/',['Poisson int',13,'generator']],...
		'Mask Translate','seed=@2;lambda=@1;[x,y]=srcsicon(4);')
set_param([sys,'/',['Poisson int',13,'generator']],...
		'Mask Help','This block generates Poisson distributed integer values. The output size is the same as the seed vector size. The variance and mean value equal to Lambda. Add a limiter to the output of this block to generate binary noise.')
set_param([sys,'/',['Poisson int',13,'generator']],...
		'Mask Entries','[.1 3]\/[1 2]\/')


%     Finished composite block ['Poisson int',13,'generator'].

set_param([sys,'/',['Poisson int',13,'generator']],...
		'position',[455,263,535,307])


%     Subsystem  ['Pulses divide',13,'sample time'].

new_system([sys,'/',['Pulses divide',13,'sample time']])
set_param([sys,'/',['Pulses divide',13,'sample time']],'Location',[55,192,283,286])

add_block('built-in/S-Function',[sys,'/',['Pulses divide',13,'sample time/S-function1']])
set_param([sys,'/',['Pulses divide',13,'sample time/S-function1']],...
		'function name','homopuls',...
		'parameters','samp_time, out_divid, offset',...
		'position',[40,31,105,59])

add_block('built-in/Outport',[sys,'/',['Pulses divide',13,'sample time/Outport']])
set_param([sys,'/',['Pulses divide',13,'sample time/Outport']],...
		'position',[160,35,180,55])
add_line([sys,'/',['Pulses divide',13,'sample time']],[110,45;155,45])
set_param([sys,'/',['Pulses divide',13,'sample time']],...
		'Mask Display','plot(0,0,100,100,x,y);Pulse',...
		'Mask Type','Pulse generator')
set_param([sys,'/',['Pulses divide',13,'sample time']],...
		'Mask Dialogue','Vector pulses with sample rate of each pulse as Sample_time / Divider.|Sample time (scalar, sec):|Divider (integer vector):|Offset (same length as Divider):')
set_param([sys,'/',['Pulses divide',13,'sample time']],...
		'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;[x,y]=srcsicon(2);')
set_param([sys,'/',['Pulses divide',13,'sample time']],...
		'Mask Help','This block generates a vector pulse. The output length is the same as the divider vector length. The ith element of the output has the sample time Sample_time/Divider(i). All elements in divider must be integers.')
set_param([sys,'/',['Pulses divide',13,'sample time']],...
		'Mask Entries','1\/[1 3 5 1 3 5]\/[0 0 0 4.1 2.1 4.1]\/')


%     Finished composite block ['Pulses divide',13,'sample time'].

set_param([sys,'/',['Pulses divide',13,'sample time']],...
		'position',[35,263,115,307])


%     Subsystem  'Sources'.

new_system([sys,'/','Sources'])
set_param([sys,'/','Sources'],'Location',[15,243,212,738])

add_block('built-in/Note',[sys,'/','Sources/Signal Source Library'])
set_param([sys,'/','Sources/Signal Source Library'],...
		'position',[100,0,105,5])
set_param([sys,'/','Sources'],...
		'Mask Display','SIMULINK\nsource\nblocks',...
		'Mask Dialogue','eval(''com_clos;com_smsc;'')')


%     Finished composite block 'Sources'.

set_param([sys,'/','Sources'],...
		'position',[35,413,115,457])


%     Subsystem  ['Sampled read with',13,'synchronized pulse'].

new_system([sys,'/',['Sampled read with',13,'synchronized pulse']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],'Location',[355,527,737,674])


%     Subsystem  ['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1'].

new_system([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],'Location',[55,192,283,286])

add_block('built-in/S-Function',[sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/S-function1']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/S-function1']],...
		'function name','homopuls',...
		'parameters','samp_time, out_divid, offset',...
		'position',[40,31,105,59])

add_block('built-in/Outport',[sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/Outport']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1/Outport']],...
		'position',[160,35,180,55])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],[110,45;155,45])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Display','Vector\nPulse',...
		'Mask Type','Pulse generator')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Dialogue','Vector pulses with sample rate of each pulse as Sample_time ./Divider. |Sample time (scalar, sec):|Divider (integer vector):|Offset (have same dimension as Divider:')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Help','This block generator a vector pulses. The output length is the same as the vector defined in "Divider". The ith element of the output has the sample time Sample_time/Divider(i). All elements in "Divider" must be integers.')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'Mask Entries','ts\/1\/off\/')


%     Finished composite block ['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1'].

set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Pulses deivide',13,'same sample time1']],...
		'position',[50,56,110,94])

add_block('built-in/Outport',[sys,'/',['Sampled read with',13,'synchronized pulse/out_1']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/out_1']],...
		'position',[295,65,315,85])

add_block('built-in/Outport',[sys,'/',['Sampled read with',13,'synchronized pulse/out_2']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/out_2']],...
		'Port','2',...
		'position',[195,115,215,135])

add_block('built-in/S-Function',[sys,'/',['Sampled read with',13,'synchronized pulse/Message source']])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'BackGround',5,...
		'function name','trigwksp',...
		'parameters','var,thd,cyclFlag,ini',...
		'Mask Display','Triggered\nread')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Type','Read from workspace')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Dialogue','The raising edge of input pulse trigger the block output the next row from the workspace variable.|Read the variable:|Threshold for the input pulse:|Cyclic read variable (1) or amend zeros (0).|Output before first trigger:')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Translate','var=@1;thd=@2;cyclFlag=@3;ini=@4;')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Help','This block reads the data from a workspace variable. The output is refreshed at the raising edge of the input pulse.')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse/Message source']],...
		'Mask Entries','var\/.1\/cyc\/ini\/',...
		'position',[180,53,255,97])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse']],[260,75;290,75])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse']],[115,75;175,75])
add_line([sys,'/',['Sampled read with',13,'synchronized pulse']],[135,75;135,125;190,125])
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Display','plot(0,0,100,100,x,y,v,w);Rd wksp',...
		'Mask Type','Read from workspace')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Dialogue','Read from a workspace variable at sample time.|Variable (column_number=block_output_length):|Data output sample time (sec):|Repeat flag (1: repeat read, 0: output zeros after eof).|Initial output:')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Translate','var=@1;td=@2;ts=td(1);if (length(td)>=2),off=td(2);else off=0;end;cyc=@3;ini=@4;[x,y]=srcsicon(7);[v,w]=trigicon(1,75,get_param(gcb,''orientation''),2);')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Help','This block reads from a workspace variable at a given sample time. The column number is the block output vector length. When the simulation reaches the end of the variable (eof), the block will cyclically output from the first row of the variable or output zeros based on the repeat flag entree. The second output is the synchronization pulse, which outputs a spike when the data is refreshed.')
set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'Mask Entries','randint(100,1,16)\/1\/1\/0\/')


%     Finished composite block ['Sampled read with',13,'synchronized pulse'].

set_param([sys,'/',['Sampled read with',13,'synchronized pulse']],...
		'position',[35,338,115,382])


%     Subsystem  ['Sampled read',13,'from wksp'].

new_system([sys,'/',['Sampled read',13,'from wksp']])
set_param([sys,'/',['Sampled read',13,'from wksp']],'Location',[355,528,737,675])

add_block('built-in/S-Function',[sys,'/',['Sampled read',13,'from wksp/Message source']])
set_param([sys,'/',['Sampled read',13,'from wksp/Message source']],...

⌨️ 快捷键说明

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