📄 tceps3c3.m
字号:
'Mask Type','Real/Imag to Complex')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/RI2C']],...
'Mask Dialogue','Construct complex vector from real and imaginary vectors.')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/RI2C']],...
'Mask Help','The Real/Imag to Complex block creates a complex output from the two inputs. It uses a Mux block to append the complex part (input 2) to the real part (input 1).')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/RI2C']],...
'position',[470,119,545,161])
add_block('built-in/Inport',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/in_1']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/in_1']],...
'position',[95,30,115,50])
add_block('built-in/Outport',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/out_1']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/out_1']],...
'position',[585,130,605,150])
add_block('built-in/Constant',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Constant']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Constant']],...
'Value','x1',...
'position',[80,145,100,165])
add_block('built-in/Constant',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Constant1']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Constant1']],...
'Value','x2',...
'position',[130,165,150,185])
add_block('built-in/Note',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/I1']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/I1']],...
'position',[193,43,198,48])
add_block('built-in/Inport',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/in_2']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/in_2']],...
'Port','2',...
'position',[135,55,155,75])
add_block('built-in/Note',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/R2']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/R2']],...
'position',[125,135,130,140])
add_block('built-in/Note',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/I2']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/I2']],...
'position',[190,155,195,160])
add_block('built-in/Product',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Product3']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Product3']],...
'position',[310,183,340,207])
add_block('built-in/Product',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Product2']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Product2']],...
'position',[310,228,340,252])
add_block('built-in/Sum',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Sum1']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Sum1']],...
'position',[385,210,405,230])
add_block('built-in/Note',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/I_out']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/I_out']],...
'position',[445,206,450,211])
add_block('built-in/Note',[sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Ref: Hambley: An Intro to Comm. Systems. pp72']])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2/Ref: Hambley: An Intro to Comm. Systems. pp72']],...
'position',[260,370,265,375])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[550,140;580,140])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[345,240;355,240;355,225;380,225])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[345,195;355,195;355,215;380,215])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[160,65;245,65;245,100;295,100])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[250,100;250,245;305,245])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[155,175;280,175;280,110;295,110])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[280,175;280,200;305,200])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[105,155;270,155;270,50;295,50])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[270,155;270,235;305,235])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[120,40;295,40])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[238,40;238,190;305,190])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[335,105;345,105;345,75;370,75])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[335,45;345,45;345,65;370,65])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[400,70;425,70;425,130;465,130])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],[410,220;425,220;425,150;465,150])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],...
'Mask Display','QM DSB\nAM',...
'Mask Type','Quadrature Multiplexed DSB-SC AM')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],...
'Mask Dialogue','Quadrature multiplexed double-sideband suppressed-carrier amplitude modulation:|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],...
'Mask Translate','Ph=@1;ts=@2;x1=cos(Ph);x2=sin(Ph);')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],...
'Mask Help','The Quadratic Multiplexed Double-Sideband-Supressed-Carrier AM block causes the amplitude of the sinusoidal carrier to depend on the input message signal, resulting in amplitude modulation. There are two input signal being modulated at the same time by using two orthogonal sinusoidal carriers.')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],...
'Mask Entries','Ph\/ts\/')
% Finished composite block ['Arbitrary-map',13,'QASK mod/QAM CE2'].
set_param([sys,'/',['Arbitrary-map',13,'QASK mod/QAM CE2']],...
'BackGround',3,...
'position',[160,60,240,100])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod']],[25,80;45,80])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod']],[245,80;265,80])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod']],[125,70;155,70])
add_line([sys,'/',['Arbitrary-map',13,'QASK mod']],[125,90;155,90])
set_param([sys,'/',['Arbitrary-map',13,'QASK mod']],...
'Mask Display','a-map\nQASK ce',...
'Mask Type','QASK arbitrary-map modulation')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod']],...
'Mask Dialogue','Complex envelop of QASK modulation for arbitrary defined\nmap. Assume input digit is K. 1st out_port outputs in-phase(K+1). 2nd out_port\noutputs quadreture(K+1).|Vector of in-phase component:|Vector of quadreture component:|Symbol interval (second):|Initial phase (rad):|Sample time (second):')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod']],...
'Mask Translate','y1=@1;y2=@2;td=@3;Ph=@4;ts=@5;')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod']],...
'Mask Help','This block output the complex envelop of the modulation of input digit signal. The vector length of the first two entries sould have the same length.')
set_param([sys,'/',['Arbitrary-map',13,'QASK mod']],...
'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 ['Arbitrary-map',13,'QASK mod'].
set_param([sys,'/',['Arbitrary-map',13,'QASK mod']],...
'position',[120,74,185,116])
% Subsystem 'Sampled read'.
new_system([sys,'/','Sampled read'])
set_param([sys,'/','Sampled read'],'Location',[355,528,737,675])
% Subsystem ['Sampled read/Pulses deivide',13,'same sample time1'].
new_system([sys,'/',['Sampled read/Pulses deivide',13,'same sample time1']])
set_param([sys,'/',['Sampled read/Pulses deivide',13,'same sample time1']],'Location',[55,192,283,286])
add_block('built-in/S-Function',[sys,'/',['Sampled read/Pulses deivide',13,'same sample time1/S-function1']])
set_param([sys,'/',['Sampled read/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/Pulses deivide',13,'same sample time1/Outport']])
set_param([sys,'/',['Sampled read/Pulses deivide',13,'same sample time1/Outport']],...
'position',[160,35,180,55])
add_line([sys,'/',['Sampled read/Pulses deivide',13,'same sample time1']],[110,45;155,45])
set_param([sys,'/',['Sampled read/Pulses deivide',13,'same sample time1']],...
'Mask Display','Vector\nPulse',...
'Mask Type','Pulse generator')
set_param([sys,'/',['Sampled read/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/Pulses deivide',13,'same sample time1']],...
'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['Sampled read/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/Pulses deivide',13,'same sample time1']],...
'Mask Entries','ts\/1\/off\/')
% Finished composite block ['Sampled read/Pulses deivide',13,'same sample time1'].
set_param([sys,'/',['Sampled read/Pulses deivide',13,'same sample time1']],...
'position',[50,56,110,94])
add_block('built-in/Outport',[sys,'/','Sampled read/out_1'])
set_param([sys,'/','Sampled read/out_1'],...
'position',[295,65,315,85])
add_block('built-in/S-Function',[sys,'/','Sampled read/Message source'])
set_param([sys,'/','Sampled read/Message source'],...
'BackGround',5,...
'function name','trigwksp',...
'parameters','var,thd,cyclFlag,ini',...
'Mask Display','Triggered\nread',...
'Mask Type','Read from workspace')
set_param([sys,'/','Sampled read/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/Message source'],...
'Mask Translate','var=@1;thd=@2;cyclFlag=@3;ini=@4;',...
'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/Message source'],...
'Mask Entries','var\/.1\/cyc\/ini\/',...
'position',[180,53,255,97])
add_line([sys,'/','Sampled read'],[260,75;290,75])
add_line([sys,'/','Sampled read'],[115,75;175,75])
set_param([sys,'/','Sampled read'],...
'Mask Display','Sampled\nread\nvariable',...
'Mask Type','Read from a variable at given sample time.')
set_param([sys,'/','Sampled read'],...
'Mask Dialogue','Read from a workspace variable at a given interval:|Variable (column_number=block_output_length):|Output symbol interval:|Cyclic read (1) or amend zero (0):|Initial output:')
set_param([sys,'/','Sampled read'],...
'Mask Translate','var=@1;td=@2;ts=td(1);if (length(td)>=2),off=td(2);else off=0;end;cyc=@3;ini=@4;')
set_param([sys,'/','Sampled read'],...
'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 reached the end of the variable row, the block will cyclically output from the first row of the the variable or output zero based on the cyclic read entree.')
set_param([sys,'/','Sampled read'],...
'Mask Entries','randint(300,1,M)\/td\/1\/0\/')
% Finished composite block 'Sampled read'.
set_param([sys,'/','Sampled read'],...
'BackGround',5,...
'position',[10,73,85,117])
add_block('built-in/Demux',[sys,'/','Demux'])
set_param([sys,'/','Demux'],...
'outputs','2',...
'position',[145,155,185,190])
% Subsystem ['Uniform',13,'noise'].
new_system([sys,'/',['Uniform',13,'noise']])
set_param([sys,'/',['Uniform',13,'noise']],'Location',[420,594,637,734])
add_block('built-in/Outport',[sys,'/',['Uniform',13,'noise/out_1']])
set_param([sys,'/',['Uniform',13,'noise/out_1']],...
'position',[165,65,185,85])
add_block('built-in/S-Function',[sys,'/',['Uniform',13,'noise/Uniform',13,'noise']])
set_param([sys,'/',['Uniform',13,'noise/Uniform',13,'noise']],...
'function name','surandom',...
'parameters','seed,up,low',...
'position',[65,55,135,95])
add_line([sys,'/',['Uniform',13,'noise']],[140,75;160,75])
set_param([sys,'/',['Uniform',13,'noise']],...
'Mask Display','Uniform\nnoise',...
'Mask Type','Uniform distribution noise.',...
'Mask Dialogue','Uniform distribution noise.|Low bound of the output:|Upper bound of the output:|Seed:')
set_param([sys,'/',['Uniform',13,'noise']],...
'Mask Translate','seed=@3;up=@2;low=@1;')
set_param([sys,'/',['Uniform',13,'noise']],...
'Mask Help','The output of this block is uniformly distributed between the low and up boundaries. The output size is the same as the vector size for seed.')
set_param([sys,'/',['Uniform',13,'noise']],...
'Mask Entries','[.8 0]\/[1.2 .26]\/randint(1,2,10000)\/')
% Finished composite block ['Uniform',13,'noise'].
set_param([sys,'/',['Uniform',13,'noise']],...
'position',[50,154,125,196])
% Subsystem ['Click here to plot',13,'constelation of this exmp'].
new_system([sys,'/',['Click here to plot',13,'constelation of this exmp']])
set_param([sys,'/',['Click here to plot',13,'constelation of this exmp']],'Location',[657,455,963,648])
set_param([sys,'/',['Click here to plot',13,'constelation of this exmp']],...
'Mask Display','Constelation\nPlot',...
'Mask Dialogue','eval(''x=[real(exp(j*[1:M]/M*pi*2))];y=[imag(exp(j*[1:M]/M*pi*2))];plot(x,y,''''r*'''');axis(''''equal'''');'')')
% Finished composite block ['Click here to plot',13,'constelation of this exmp'].
set_param([sys,'/',['Click here to plot',13,'constelation of this exmp']],...
'position',[345,170,445,210])
add_line(sys,[90,95;115,95])
add_line(sys,[100,95;100,50;415,50;415,90;445,90])
add_line(sys,[430,110;445,110])
add_line(sys,[190,95;230,95])
add_line(sys,[310,110;345,110])
add_line(sys,[130,175;140,175])
add_line(sys,[190,165;200,165;200,110;230,110])
add_line(sys,[190,180;205,180;205,125;230,125])
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 + -