?? tcemmpsk.m
字號:
'parameters','td, ts, limit',...
'Mask Display','Schdld\nreset-int')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int1']],...
'Mask Type','Scheduled reset integration.')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/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,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int1']],...
'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/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,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int1']],...
'Mask Entries','td\/ts\/Inf\/',...
'position',[420,19,480,61])
add_block('built-in/Product',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Product']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Product']],...
'position',[355,21,380,54])
add_block('built-in/Demux',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Demux']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Demux']],...
'ForeGround',2,...
'outputs','2',...
'position',[235,20,275,55])
add_block('built-in/S-Function',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Array cos']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Array cos']],...
'ForeGround',3,...
'function name','arysin',...
'parameters','''cos''',...
'position',[230,85,280,105])
add_block('built-in/Outport',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/out_1']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/out_1']],...
'position',[585,105,605,125])
add_block('built-in/S-Function',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Array sin']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Array sin']],...
'ForeGround',4,...
'function name','arysin',...
'parameters','''sin''',...
'position',[230,130,280,150])
add_block('built-in/Product',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Product3']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Product3']],...
'position',[355,116,380,149])
add_block('built-in/S-Function',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']],...
'function name','schdint',...
'parameters','td, ts, limit',...
'Mask Display','Schdld\nreset-int')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']],...
'Mask Type','Scheduled reset integration.')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']],...
'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,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']],...
'Mask Translate','td=@1;ts=@2;limit=@3;')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']],...
'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,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Scheduled',13,'reset-int2']],...
'Mask Entries','td\/ts\/Inf\/',...
'position',[420,114,480,156])
add_block('built-in/Inport',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/in_1']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/in_1']],...
'position',[175,30,195,50])
add_block('built-in/Sum',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Sum3']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Sum3']],...
'position',[535,105,555,125])
add_block('built-in/Constant',[sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Initial phase']])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband/Initial phase']],...
'Value','Ph',...
'position',[100,93,120,117])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[200,40;230,40])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[280,45;310,45;310,125;350,125])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[285,140;350,140])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[385,135;415,135])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[385,40;415,40])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[485,40;510,40;510,110;530,110])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[485,135;510,135;510,120;530,120])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[560,115;580,115])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[285,95;320,95;320,45;350,45])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[280,30;350,30])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[195,95;225,95])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[205,95;205,140;225,140])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[125,105;160,105])
add_line([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],[65,75;95,75;95,85;160,85])
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],...
'Mask Display','plot(0,0,100,100,u,v); MPSK corr',...
'Mask Type','Baseband MPSK correlationA')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],...
'Mask Dialogue','Compute Baseband MPSK correlation. Take\nMPSK CE modulated signal. Output a vector of correlation result.|M-ary number (integer in range [0, M-1]):|Symbol interval and offset (sec):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],...
'Mask Translate','pi2=2*pi;N=@1;sft=[0:N-1]*pi2/N;td=@2;Ph=@3;ts=@4;[u,v]=cmplxicn(0,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],...
'Mask Help','This block calculates the correlation value of the input signal with a vector of sinusoidal signals. These sinusoidal signals have their phase shift the same as that of PM modulated signal of possible resulting digits. The output is an M length vector. The MPSK demodulation result is the index of the largest output, using the Min/max demap block. The input of this block is complex signal.')
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],...
'Mask Entries','M\/td\/Ph\/ts\/')
% Finished composite block ['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband'].
set_param([sys,'/',['MPSK demod',13,'baseband/MPSK demod',13,'corr baseband']],...
'position',[60,53,140,97])
add_block('built-in/Inport',[sys,'/',['MPSK demod',13,'baseband/in_1']])
set_param([sys,'/',['MPSK demod',13,'baseband/in_1']],...
'position',[10,65,30,85])
add_block('built-in/Outport',[sys,'/',['MPSK demod',13,'baseband/out_1']])
set_param([sys,'/',['MPSK demod',13,'baseband/out_1']],...
'position',[295,65,315,85])
add_line([sys,'/',['MPSK demod',13,'baseband']],[145,75;175,75])
add_line([sys,'/',['MPSK demod',13,'baseband']],[35,75;55,75])
add_line([sys,'/',['MPSK demod',13,'baseband']],[265,75;290,75])
set_param([sys,'/',['MPSK demod',13,'baseband']],...
'Mask Display','plot(0,0,100,100,x,y,u,v);MPSK',...
'Mask Type','Baseband MPSK demodulation')
set_param([sys,'/',['MPSK demod',13,'baseband']],...
'Mask Dialogue','Demodulate the complex envelope of a\nMPSK modulated signal.|M-ary number (integer in range [0, M-1]):|Symbol interval and offset (sec):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['MPSK demod',13,'baseband']],...
'Mask Translate','M=@1;Ph=@3;td=@2;ts=@4;[x,y]=moduicon(8);[u,v]=cmplxicn(0,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['MPSK demod',13,'baseband']],...
'Mask Help','This block outputs the complex envelope of a MPSK modulated signal using correlation method. The output signal are digits in the range [0, M-1], where M is the M-ary number. When the symbol interval is a two-element vector, the second element is the offset (default 0).')
set_param([sys,'/',['MPSK demod',13,'baseband']],...
'Mask Entries','M\/td\/0\/ts\/')
% Finished composite block ['MPSK demod',13,'baseband'].
set_param([sys,'/',['MPSK demod',13,'baseband']],...
'hide name',0,...
'position',[470,68,550,112])
% Subsystem ['Rician noise',13,'channel'].
new_system([sys,'/',['Rician noise',13,'channel']])
set_param([sys,'/',['Rician noise',13,'channel']],'Location',[80,369,342,515])
add_block('built-in/Sum',[sys,'/',['Rician noise',13,'channel/Sum']])
set_param([sys,'/',['Rician noise',13,'channel/Sum']],...
'position',[150,55,170,75])
add_block('built-in/Outport',[sys,'/',['Rician noise',13,'channel/out_1']])
set_param([sys,'/',['Rician noise',13,'channel/out_1']],...
'position',[200,55,220,75])
% Subsystem ['Rician noise',13,'channel/Gaussian',13,'noise'].
new_system([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],'Location',[358,505,706,710])
add_block('built-in/Outport',[sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/out_1']])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/out_1']],...
'position',[295,85,315,105])
add_block('built-in/White Noise',[sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Random',13,'Number']])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Random',13,'Number']],...
'Seed','s',...
'position',[25,82,70,118])
add_block('built-in/State-Space',[sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Matrix',13,'Gain']])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Matrix',13,'Gain']],...
'A','[]',...
'B','[]',...
'C','[]',...
'D','K',...
'Mask Display','K',...
'Mask Type','Matrix Gain')
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Matrix',13,'Gain']],...
'Mask Dialogue','Matrix Gain.|Gain matrix:',...
'Mask Translate','K = @1;')
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Matrix',13,'Gain']],...
'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
'Mask Entries','d\/',...
'position',[115,86,140,114])
add_block('built-in/Constant',[sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Constant']])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Constant']],...
'Value','m',...
'position',[150,50,170,70])
add_block('built-in/Sum',[sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Sum']])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise/Sum']],...
'position',[235,85,255,105])
add_line([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],[175,60;205,60;205,90;230,90])
add_line([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],[75,100;110,100])
add_line([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],[145,100;230,100])
add_line([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],[260,95;290,95])
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],...
'Mask Display','Gaussian\nnoise',...
'Mask Type','Gaussian noise.',...
'Mask Dialogue','Gaussian distribution noise.|Mean value:|Standard deviation:|Initial Seed(s):')
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],...
'Mask Translate','m=@1;d=@2;s=@3;[m,d,s]=gwnoise(m,d,s);')
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],...
'Mask Help','When the mean value, seed are vectors, the output of this block is a vector with the length of the vector same as the length of mean value vector or that of the seed.')
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],...
'Mask Entries','[m1 m2]\/[d d]\/s\/')
% Finished composite block ['Rician noise',13,'channel/Gaussian',13,'noise'].
set_param([sys,'/',['Rician noise',13,'channel/Gaussian',13,'noise']],...
'position',[10,50,85,90])
add_block('built-in/Inport',[sys,'/',['Rician noise',13,'channel/in_1']])
set_param([sys,'/',['Rician noise',13,'channel/in_1']],...
'position',[45,10,65,30])
add_line([sys,'/',['Rician noise',13,'channel']],[90,70;145,70])
add_line([sys,'/',['Rician noise',13,'channel']],[70,20;115,20;115,60;145,60])
add_line([sys,'/',['Rician noise',13,'channel']],[175,65;195,65])
set_param([sys,'/',['Rician noise',13,'channel']],...
'Mask Display','plot(0,0,100,100,x,y,v,w,u,z);Rician N',...
'Mask Type','Rician noise channel, fixed parameter')
set_param([sys,'/',['Rician noise',13,'channel']],...
'Mask Dialogue','Additive Rician noise channel for\nbaseband signal simulation. Input\nand output signals are complex.|In-phase m:|Quadrature m:|sigma:|Seed (1x2 vector):')
set_param([sys,'/',['Rician noise',13,'channel']],...
'Mask Translate','m1=@1;m2=@2;d=@3;s=@4;if length(s)<2,s=[s s+s];end;[x,y]=chanicon;[v,w]=cmplxicn(0,50,get_param(gcb,''orientation''));[u,z]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['Rician noise',13,'channel']],...
'Mask Help','This block adds Rician noise to the input signal. The input and output of this block are complex signals. The Rician noise is composed with two independant Gaussian noise elements. The two Gaussian components have the same standard deviation, sigma. Their mean values are in-phase m and quadrature m respectively.')
set_param([sys,'/',['Rician noise',13,'channel']],...
'Mask Entries','.1\/.2\/.2\/[12324 4321]\/')
% Finished composite block ['Rician noise',13,'channel'].
set_param([sys,'/',['Rician noise',13,'channel']],...
'hide name',0,...
'position',[250,68,330,112])
add_line(sys,[105,90;135,90])
add_line(sys,[115,90;115,25;580,25;580,70;600,70])
add_line(sys,[555,90;600,90])
add_line(sys,[225,90;245,90])
add_line(sys,[335,90;350,90])
add_line(sys,[440,90;465,90])
drawnow
% Return any arguments.
if (nargin | nargout)
% Must use feval here to access system in memory
if (nargin > 3)
if (flag == 0)
eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
else
eval(['ret =', sys,'(t,x,u,flag);'])
end
else
[ret,x0,str,ts,xts] = feval(sys);
end
else
drawnow % Flash up the model and execute load callback
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -