📄 com_chan.m
字号:
add_block('built-in/Outport',[sys,'/',['Rayleigh fading channel',13,'w vary para CE/out_1']])
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE/out_1']],...
'position',[625,90,645,110])
add_block('built-in/Product',[sys,'/',['Rayleigh fading channel',13,'w vary para CE/Product4']])
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE/Product4']],...
'position',[565,90,590,110])
add_block('built-in/Inport',[sys,'/',['Rayleigh fading channel',13,'w vary para CE/in_2']])
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE/in_2']],...
'Port','2',...
'position',[495,40,515,60])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[70,170;80,170;80,145;105,145])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[80,170;80,205;110,205])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[100,35;135,35])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[185,25;295,25])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[240,25;240,95;290,95])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[185,40;215,40;215,135;295,135])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[215,135;215,195;295,195])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[185,145;230,145;230,35;295,35])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[230,145;295,145])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[190,205;240,205;240,105;290,105])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[240,205;295,205])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[330,30;370,30;370,75;420,75])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[330,200;370,200;370,85;420,85])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[325,100;385,100;385,130;420,130])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[330,140;420,140])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[450,80;465,80;465,105;490,105])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[450,135;465,135;465,120;490,120])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[535,115;540,115;540,105;560,105])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[595,100;620,100])
add_line([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],[520,50;540,50;540,95;560,95])
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],...
'Mask Display','plot(0,0,100,100,x,y,v,w,u,z);Rayl F',...
'Mask Type','Rayleigh fading channel, vary parameter')
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],...
'Mask Dialogue','The fading envelope and the phase shift of the channel changes with the 2nd and 3rd input port values.')
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],...
'Mask Translate','[x,y]=chanicon;x=x*.9+10;[v,w]=cmplxicn(0,85,get_param(gcb,''orientation''));[u,z]=cmplxicn(1,55,get_param(gcb,''orientation''));')
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],...
'Mask Help','This block applies Rayleigh fading to the transmitting signals. The fading envelope and the phase of the channel are provided in the 2nd and the 3rd input port. The 1st input port and the output of this block are complex signals.')
% Finished composite block ['Rayleigh fading channel',13,'w vary para CE'].
set_param([sys,'/',['Rayleigh fading channel',13,'w vary para CE']],...
'position',[325,153,405,197])
% Subsystem ['QASK Mo//Dem',13,'demo2'].
new_system([sys,'/',['QASK Mo//Dem',13,'demo2']])
set_param([sys,'/',['QASK Mo//Dem',13,'demo2']],'Location',[175,552,335,697])
set_param([sys,'/',['QASK Mo//Dem',13,'demo2']],...
'Mask Display','Rayleigh\nfading\ndemo',...
'Mask Dialogue','eval(''ts=.01;td=.2;Fc=100/2/pi;M=16;num=1;den=1;tceps3cd'')')
% Finished composite block ['QASK Mo//Dem',13,'demo2'].
set_param([sys,'/',['QASK Mo//Dem',13,'demo2']],...
'BackGround',7,...
'hide name',0,...
'position',[470,78,550,122])
add_block('built-in/Note',[sys,'/','Passband Channel'])
set_param([sys,'/','Passband Channel'],...
'Font Name','Arial',...
'Font Size',11,...
'position',[145,45,150,50])
% Subsystem ['QASK Mo//Dem',13,'demo6'].
new_system([sys,'/',['QASK Mo//Dem',13,'demo6']])
set_param([sys,'/',['QASK Mo//Dem',13,'demo6']],'Location',[175,552,335,697])
set_param([sys,'/',['QASK Mo//Dem',13,'demo6']],...
'Mask Display','AWGN\nnoise\ndemo',...
'Mask Dialogue','eval(''ts=.01;td=.1;M=8;Fc=100/2/pi;tddmqask'')')
% Finished composite block ['QASK Mo//Dem',13,'demo6'].
set_param([sys,'/',['QASK Mo//Dem',13,'demo6']],...
'BackGround',7,...
'hide name',0,...
'position',[180,78,260,122])
% Subsystem ['Max-err lmtd',13,'b-err channel'].
new_system([sys,'/',['Max-err lmtd',13,'b-err channel']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],'Location',[103,574,409,680])
add_block('built-in/Outport',[sys,'/',['Max-err lmtd',13,'b-err channel/out_1']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/out_1']],...
'hide name',0,...
'position',[275,20,295,40])
add_block('built-in/S-Function',[sys,'/',['Max-err lmtd',13,'b-err channel/Mdu']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/Mdu']],...
'hide name',0,...
'function name','arymodu',...
'parameters','md',...
'Mask Display','Modulo',...
'Mask Type','Modulo')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/Mdu']],...
'Mask Dialogue','Modulus operation:|Modulus base:',...
'Mask Translate','md = @1;')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/Mdu']],...
'Mask Help','This block output modulus operation of the input signal with module base as specified in block entry. The length of the output vector is the same as the input vector.')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/Mdu']],...
'Mask Entries','2\/',...
'position',[195,11,255,49])
add_block('built-in/Sum',[sys,'/',['Max-err lmtd',13,'b-err channel/S']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/S']],...
'hide name',0,...
'position',[150,20,170,40])
add_block('built-in/Inport',[sys,'/',['Max-err lmtd',13,'b-err channel/in_1']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/in_1']],...
'hide name',0,...
'position',[40,5,60,25])
add_block('built-in/Outport',[sys,'/',['Max-err lmtd',13,'b-err channel/out_2']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/out_2']],...
'hide name',0,...
'Port','2',...
'position',[275,50,295,70])
% Subsystem ['Max-err lmtd',13,'b-err channel/B-n'].
new_system([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],'Location',[36,445,326,560])
add_block('built-in/S-Function',[sys,'/',['Max-err lmtd',13,'b-err channel/B-n/S-function']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n/S-function']],...
'function name','srandbit',...
'parameters','n, prob, seed',...
'position',[90,35,140,55])
add_block('built-in/Outport',[sys,'/',['Max-err lmtd',13,'b-err channel/B-n/out_1']])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n/out_1']],...
'position',[190,35,210,55])
add_line([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],[145,45;185,45])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],...
'Mask Display','B-vector\ngenerator',...
'Mask Type','Binary noise generator')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],...
'Mask Dialogue','Generate a binary vector with the probability of "1"s in the vector being specified.|Vector length(can''t be changed during simulation):|Probability of a "one", two "ones",three "ones"...:|Seed:')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],...
'Mask Translate','n=@1;prob=@2;seed=@3;')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],...
'Mask Help','This block outputs a zero vector with "1"s randomly distributed the vector. The maximum number of "1"s in the vector is the same as the length of the vector probability. The value of ith element of the probability is the probability of i number of "1"s in the vector.')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],...
'Mask Entries','leng\/prob\/seed\/')
% Finished composite block ['Max-err lmtd',13,'b-err channel/B-n'].
set_param([sys,'/',['Max-err lmtd',13,'b-err channel/B-n']],...
'hide name',0,...
'position',[30,38,110,82])
add_line([sys,'/',['Max-err lmtd',13,'b-err channel']],[175,30;190,30])
add_line([sys,'/',['Max-err lmtd',13,'b-err channel']],[260,30;270,30])
add_line([sys,'/',['Max-err lmtd',13,'b-err channel']],[115,60;130,60;130,35;145,35])
add_line([sys,'/',['Max-err lmtd',13,'b-err channel']],[115,60;270,60])
add_line([sys,'/',['Max-err lmtd',13,'b-err channel']],[65,15;90,15;90,25;145,25])
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],...
'Mask Display','plot(0,0,100,100,x,y);Lmtd b-err',...
'Mask Type','Limited binary error channel')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],...
'Mask Dialogue','Add binary errors with specified error\nnumber probability.|Vector length(can''t be changed during simulation):|Probability of one err, two errs, three errs...:|Seed:')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],...
'Mask Translate','leng=@1;prob=@2;seed=@3;[x,y]=chanicon;')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],...
'Mask Help','This block adds binary errors to the input signal. The maximum number of errors added to the signal is the same as the length of the vector probability. The value of ith element of the probability is the probability of i number of errors in the vector. The 1st outport is the signal with added noise. The 2nd outport is the added noise.')
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],...
'Mask Entries','7\/1/2\/12345\/')
% Finished composite block ['Max-err lmtd',13,'b-err channel'].
set_param([sys,'/',['Max-err lmtd',13,'b-err channel']],...
'position',[35,303,115,347])
% Subsystem ['Binary error',13,'channel'].
new_system([sys,'/',['Binary error',13,'channel']])
set_param([sys,'/',['Binary error',13,'channel']],'Location',[154,494,633,699])
add_block('built-in/Outport',[sys,'/',['Binary error',13,'channel/out_2']])
set_param([sys,'/',['Binary error',13,'channel/out_2']],...
'Port','2',...
'position',[275,125,295,145])
add_block('built-in/Saturation',[sys,'/',['Binary error',13,'channel/Saturation']])
set_param([sys,'/',['Binary error',13,'channel/Saturation']],...
'Lower Limit','0',...
'Upper Limit','1',...
'position',[165,70,190,90])
add_block('built-in/S-Function',[sys,'/',['Binary error',13,'channel/Modulo',13,'operation']])
set_param([sys,'/',['Binary error',13,'channel/Modulo',13,'operation']],...
'function name','arymodu',...
'parameters','md',...
'Mask Display','Modulo',...
'Mask Type','Modulo',...
'Mask Dialogue','Modulo operation:|Modulo base:')
set_param([sys,'/',['Binary error',13,'channel/Modulo',13,'operation']],...
'Mask Translate','md = @1;')
set_param([sys,'/',['Binary error',13,'channel/Modulo',13,'operation']],...
'Mask Help','This block output modulus operation of the input signal with module base as specified in block entry. The length of the output vector is the same as the input vector.')
set_param([sys,'/',['Binary error',13,'channel/Modulo',13,'operation']],...
'Mask Entries','2\/',...
'position',[300,56,360,94])
add_block('built-in/Sum',[sys,'/',['Binary error',13,'channel/Sum']])
set_param([sys,'/',['Binary error',13,'channel/Sum']],...
'position',[235,65,255,85])
add_block('built-in/Outport',[sys,'/',['Binary error',13,'channel/out_1']])
set_param([sys,'/',['Binary error',13,'channel/out_1']],...
'position',[390,65,410,85])
% Subsystem ['Binary error',13,'channel/Poisson',13,'noise'].
new_system([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']])
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']],'Location',[391,74,676,237])
add_block('built-in/Outport',[sys,'/',['Binary error',13,'channel/Poisson',13,'noise/out_1']])
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise/out_1']],...
'position',[165,65,185,85])
add_block('built-in/S-Function',[sys,'/',['Binary error',13,'channel/Poisson',13,'noise/Poisson distribution',13,'number']])
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise/Poisson distribution',13,'number']],...
'function name','srandpoi',...
'parameters','seed,lambda',...
'position',[65,55,135,95])
add_line([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']],[140,75;160,75])
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']],...
'Mask Display','Poison\nrand int',...
'Mask Type','Poisson distribution noise.',...
'Mask Dialogue','Poisson distribution number generator.|Lambda:|Seed:')
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']],...
'Mask Translate','seed=@2;lambda=@1;')
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']],...
'Mask Help','The output of this block is poisson distributed integers. The output size is the same as the vector size for seed. Please use function disttool to see the distribution of the outputof this block.')
set_param([sys,'/',['Binary error',13,'channel/Poisson',13,'noise']],...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -