📄 tceps3cd.m
字号:
'position',[445,45,450,50])
add_block('built-in/Sum',[sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/Sum']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/Sum']],...
'inputs','+-',...
'position',[375,60,395,80])
add_block('built-in/Product',[sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/Product1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/Product1']],...
'position',[300,93,330,117])
add_block('built-in/Product',[sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/Product']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/Product']],...
'position',[300,33,330,57])
add_block('built-in/Note',[sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/R1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2/R1']],...
'position',[190,15,195,20])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[410,220;425,220;425,150;465,150])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[400,70;425,70;425,130;465,130])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[335,45;345,45;345,65;370,65])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[335,105;345,105;345,75;370,75])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[120,40;295,40])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[238,40;238,190;305,190])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[105,155;270,155;270,50;295,50])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[270,155;270,235;305,235])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[155,175;280,175;280,110;295,110])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[280,175;280,200;305,200])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[160,65;245,65;245,100;295,100])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[250,100;250,245;305,245])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[345,195;355,195;355,215;380,215])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[345,240;355,240;355,225;380,225])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],[550,140;580,140])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],...
'Mask Display','plot(0,0,100,100,x,y,u,v);QAM',...
'Mask Type','QM DSB-SC AM CE')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],...
'Mask Dialogue','Modulate the in-phase and quadrature\ncomponent signal from the 1st and 2nd\ninput ports, baseband simulation.|Initial phase (rad):')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],...
'Mask Translate','Ph=@1;x1=cos(Ph);x2=sin(Ph);[x,y]=moduicon(1);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],...
'Mask Help','This block outputs the complex envelope of the quadratic multiplexed double-sideband suppressed-carrier amplitude modulated signal. The 1st and 2nd input ports input the in-phase and quadrature components. The output is a complex signal.')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],...
'Mask Entries','Ph\/')
% Finished composite block ['A-map QASK',13,'mod baseband/QAM',13,'baseband2'].
set_param([sys,'/',['A-map QASK',13,'mod baseband/QAM',13,'baseband2']],...
'ForeGround',4,...
'hide name',0,...
'position',[165,58,245,102])
% Subsystem ['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map'].
new_system([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],'Location',[58,103,403,268])
add_block('built-in/Zero-Order Hold',[sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/Zero-Order',13,'Hold1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/Zero-Order',13,'Hold1']],...
'Sample time','td',...
'position',[80,14,115,46])
add_block('built-in/Inport',[sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/in_1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/in_1']],...
'position',[25,20,45,40])
add_block('built-in/Look Up Table',[sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/real part']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/real part']],...
'Input_Values','x',...
'Output_Values','y1',...
'position',[180,17,215,43])
add_block('built-in/Look Up Table',[sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/imag part1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/imag part1']],...
'Input_Values','x',...
'Output_Values','y2',...
'position',[175,97,210,123])
add_block('built-in/Outport',[sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/Real']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/Real']],...
'position',[275,20,295,40])
add_block('built-in/Outport',[sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/Imag']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map/Imag']],...
'Port','2',...
'position',[275,100,295,120])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],[50,30;75,30])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],[120,30;175,30])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],[145,30;145,110;170,110])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],[220,30;270,30])
add_line([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],[215,110;270,110])
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],...
'Mask Display','QASK\nA-map',...
'Mask Type','QASK A-map')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],...
'Mask Dialogue','QASK mapping for arbitrary defined\nmap. Assume input digit is K. 1st\noutport outputs in-phase(K+1). 2nd\noutport outputs quadrature(K+1).|Constellation for in-phase component:|Constellation for quadrature component:|Symbol interval and offset (sec):')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],...
'Mask Translate','y1=@1;y2=@2;td=@3;ly=length(y1);x=[-10 1:ly-1;1:ly-1 10*ly]-.5;x=x(:);y1=y1(:)'';y1=[y1;y1];y1=y1(:);y2=y2(:)'';y2=[y2;y2];y2=y2(:);')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],...
'Mask Help','This block maps a digital signal onto in-phase and quadratic components, which are outputs in the first and second output port respectively. The in-phase and quadrature constellation vectors must have the same length. The input signal is in the range of [0, M-1]. The symbol interval can be a two elements vector with the first element being offset. The default offset is zero.')
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],...
'Mask Entries','y1\/y2\/td\/')
% Finished composite block ['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map'].
set_param([sys,'/',['A-map QASK',13,'mod baseband/QASK',13,'arbitrary-map']],...
'hide name',0,...
'position',[50,58,130,102])
add_block('built-in/Inport',[sys,'/',['A-map QASK',13,'mod baseband/in_1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/in_1']],...
'position',[5,70,20,90])
add_block('built-in/Outport',[sys,'/',['A-map QASK',13,'mod baseband/out_1']])
set_param([sys,'/',['A-map QASK',13,'mod baseband/out_1']],...
'hide name',0,...
'position',[270,70,290,90])
add_line([sys,'/',['A-map QASK',13,'mod baseband']],[135,90;160,90])
add_line([sys,'/',['A-map QASK',13,'mod baseband']],[135,70;160,70])
add_line([sys,'/',['A-map QASK',13,'mod baseband']],[25,80;45,80])
add_line([sys,'/',['A-map QASK',13,'mod baseband']],[250,80;265,80])
set_param([sys,'/',['A-map QASK',13,'mod baseband']],...
'Mask Display','plot(0,0,100,100,x,y,u,v);A-QASK',...
'Mask Type','Baseband A-QASK modulation')
set_param([sys,'/',['A-map QASK',13,'mod baseband']],...
'Mask Dialogue','Output the complex envelope of QASK\nmodulation. The arbitrary constellation\nis defined by in-phase and quadrature\nvectors.|Constellation in-phase component:|Constellation quadrature component:|Input symbol interval and offset (sec):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['A-map QASK',13,'mod baseband']],...
'Mask Translate','y1=@1;y2=@2;td=@3;Ph=@4;ts=@5;[x,y]=moduicon(5);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['A-map QASK',13,'mod baseband']],...
'Mask Help','This block outputs the complex envelope of a QASK modulated signal with user-defined arbitrary constellation. The vector length of the in-phase and quadrature components vectors should be the same length. The inputs are integers in the range [0, M-1], where M is the vector length of in-phase or quadrature. When the symbol interval is a two-element vector, the second element is the offset (default 0).')
set_param([sys,'/',['A-map QASK',13,'mod baseband']],...
'Mask Entries','real(exp(j*[0:M-1]/M*pi*2))\/imag(exp(j*[0:M-1]/M*pi*2))\/td\/0\/ts\/')
% Finished composite block ['A-map QASK',13,'mod baseband'].
set_param([sys,'/',['A-map QASK',13,'mod baseband']],...
'hide name',0,...
'position',[135,43,215,87])
add_block('built-in/Demux',[sys,'/','Demux'])
set_param([sys,'/','Demux'],...
'hide name',0,...
'outputs','2',...
'position',[170,110,210,145])
% Subsystem ['Uniform noise',13,'generator'].
new_system([sys,'/',['Uniform noise',13,'generator']])
set_param([sys,'/',['Uniform noise',13,'generator']],'Location',[420,594,637,734])
add_block('built-in/Outport',[sys,'/',['Uniform noise',13,'generator/out_1']])
set_param([sys,'/',['Uniform noise',13,'generator/out_1']],...
'position',[165,65,185,85])
add_block('built-in/S-Function',[sys,'/',['Uniform noise',13,'generator/Uniform',13,'noise']])
set_param([sys,'/',['Uniform noise',13,'generator/Uniform',13,'noise']],...
'function name','surandom',...
'parameters','seed,up,low',...
'position',[65,55,135,95])
add_line([sys,'/',['Uniform noise',13,'generator']],[140,75;160,75])
set_param([sys,'/',['Uniform noise',13,'generator']],...
'Mask Display','plot(0,0,100,100,x,y);Uniform',...
'Mask Type','Uniform noise generator')
set_param([sys,'/',['Uniform noise',13,'generator']],...
'Mask Dialogue','Generate uniformly distributed noise\nbetween the upper and lower bounds.|Noise lower bound:|Noise upper bound:|Seed:')
set_param([sys,'/',['Uniform noise',13,'generator']],...
'Mask Translate','seed=@3;up=@2;low=@1;[x,y]=srcsicon(3);')
set_param([sys,'/',['Uniform noise',13,'generator']],...
'Mask Help','This block generates a uniformly distributed noise between the given lower and upper bounds. The output size is the same as the vector length of the seed. The upper bound and lower bound can be scalar or vectors with their lengths the same as the length for the seed. The vector length of upper bound must be the same as length of lower bound.')
set_param([sys,'/',['Uniform noise',13,'generator']],...
'Mask Entries','[0.7 -.2]\/[1.3 .2]\/[12345 54321]\/')
% Finished composite block ['Uniform noise',13,'generator'].
set_param([sys,'/',['Uniform noise',13,'generator']],...
'hide name',0,...
'position',[55,108,135,152])
add_line(sys,[105,65;130,65])
add_line(sys,[120,65;120,35;435,35;445,60])
add_line(sys,[435,80;445,80])
add_line(sys,[330,80;345,80])
add_line(sys,[220,65;240,65])
add_line(sys,[215,120;220,120;220,80;240,80])
add_line(sys,[215,135;225,135;225,95;240,95])
add_line(sys,[140,130;165,130])
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 + -