📄 tstfskcd.m
字号:
add_block('built-in/Fcn',[sys,'/','QADM discr-filt/Fcn'])
set_param([sys,'/','QADM discr-filt/Fcn'],...
'Expr','cos(u[1]+Ph)',...
'position',[205,55,300,85])
add_block('built-in/Fcn',[sys,'/','QADM discr-filt/Fcn1'])
set_param([sys,'/','QADM discr-filt/Fcn1'],...
'Expr','sin(u[1]+Ph)',...
'position',[200,175,300,205])
add_block('built-in/Product',[sys,'/','QADM discr-filt/Product'])
set_param([sys,'/','QADM discr-filt/Product'],...
'position',[330,62,355,93])
add_block('built-in/Product',[sys,'/','QADM discr-filt/Product1'])
set_param([sys,'/','QADM discr-filt/Product1'],...
'position',[330,167,355,198])
add_block('built-in/Outport',[sys,'/','QADM discr-filt/out_2'])
set_param([sys,'/','QADM discr-filt/out_2'],...
'Port','2',...
'position',[480,175,500,195])
add_block('built-in/Outport',[sys,'/','QADM discr-filt/out_1'])
set_param([sys,'/','QADM discr-filt/out_1'],...
'position',[480,70,500,90])
add_block('built-in/Gain',[sys,'/','QADM discr-filt/Gain'])
set_param([sys,'/','QADM discr-filt/Gain'],...
'Gain','Fc',...
'position',[110,111,160,149])
add_block('built-in/Clock',[sys,'/','QADM discr-filt/Clock'])
set_param([sys,'/','QADM discr-filt/Clock'],...
'position',[60,120,80,140])
add_line([sys,'/','QADM discr-filt'],[300,130;305,130;305,175;325,175])
add_line([sys,'/','QADM discr-filt'],[300,130;305,130;305,85;325,85])
add_line([sys,'/','QADM discr-filt'],[255,130;265,130])
add_line([sys,'/','QADM discr-filt'],[165,130;185,130;185,70;200,70])
add_line([sys,'/','QADM discr-filt'],[185,125;195,190])
add_line([sys,'/','QADM discr-filt'],[305,70;325,70])
add_line([sys,'/','QADM discr-filt'],[305,190;325,190])
add_line([sys,'/','QADM discr-filt'],[360,80;385,80])
add_line([sys,'/','QADM discr-filt'],[450,80;475,80])
add_line([sys,'/','QADM discr-filt'],[360,185;385,185])
add_line([sys,'/','QADM discr-filt'],[450,185;475,185])
add_line([sys,'/','QADM discr-filt'],[85,130;105,130])
set_param([sys,'/','QADM discr-filt'],...
'Mask Display','QM\nDSB-SC\nADM',...
'Mask Type','Quadrature Demultiplexed DSB-SC AM')
set_param([sys,'/','QADM discr-filt'],...
'Mask Dialogue','Quadrature Demultiplexed Double-Sideband Suppressed-Carrier Amplitude Demodulation:|Carrier frequency (Hz):|Low-pass filter numerator:|Low-pass filter denominator:|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/','QADM discr-filt'],...
'Mask Translate','Fc=@1*2*pi;num=@2;den=@3;Ph=@4;ts=@5;')
set_param([sys,'/','QADM discr-filt'],...
'Mask Help','The Quadratic Demultiplexed Double-Sideband Supressed-Carrier Amplitude Demodulation block demodulates the QM-DSB-SC-AM signal using quadratic duplex method. The filter to be speficed by the users is a lowpass filter which should pass the signal message and eliminate the carrier signal.')
set_param([sys,'/','QADM discr-filt'],...
'Mask Entries','100/2/pi\/num\/den\/0\/ts\/')
% Finished composite block 'QADM discr-filt'.
set_param([sys,'/','QADM discr-filt'],...
'position',[315,84,395,126])
% Subsystem 'plot'.
new_system([sys,'/','plot'])
set_param([sys,'/','plot'],'Location',[165,242,460,428])
add_block('built-in/Inport',[sys,'/','plot/in_1'])
set_param([sys,'/','plot/in_1'],...
'position',[15,55,35,75])
add_block('built-in/Inport',[sys,'/','plot/in_2'])
set_param([sys,'/','plot/in_2'],...
'Port','2',...
'position',[20,115,40,135])
add_block('built-in/Mux',[sys,'/','plot/Mux'])
set_param([sys,'/','plot/Mux'],...
'inputs','2',...
'position',[65,70,100,105])
add_block('built-in/S-Function',[sys,'/','plot/Plot1'])
set_param([sys,'/','plot/Plot1'],...
'function name','eyediasi',...
'parameters','time_range, boundary, kept_length, eye_line, scatter_line, two_d_line',...
'position',[130,70,200,110])
add_line([sys,'/','plot'],[40,65;45,65;45,80;60,80])
add_line([sys,'/','plot'],[45,125;50,125;60,95])
add_line([sys,'/','plot'],[105,90;125,90])
set_param([sys,'/','plot'],...
'Mask Display','Eye/Scatter\nPlot',...
'Mask Type','Eye-Pattern/Scatter Plot')
set_param([sys,'/','plot'],...
'Mask Dialogue','Eye-Pattern/Scatter/X-Y Plot.|Eye-pattern plot time frame:|Lower and upper bound of in-coming signal:|Length of kept traces:|Line-type for eye-pattern plot (0 for no such plot):|Line-type for scatter plot (0 for no such plot):|Line-type for X-Y plot (0 for no such plot):')
set_param([sys,'/','plot'],...
'Mask Translate','time_range=@1;boundary=@2;kept_length=@3;eye_line=@4;scatter_line=@5;two_d_line=@6;')
set_param([sys,'/','plot'],...
'Mask Help','This plot may open one-two-three plots at the same time by giving parameters. The scatter plot point is selected by the raising edge of a trigger signal.')
set_param([sys,'/','plot'],...
'Mask Entries','2*td\/[-1.2 1.2]\/10\/''r-/g--/b-.''\/''rx/y+''\/''y-/r-''\/')
% Finished composite block 'plot'.
set_param([sys,'/','plot'],...
'position',[530,185,605,240])
% Subsystem ['Pulses deivide',13,'same sample time1'].
new_system([sys,'/',['Pulses deivide',13,'same sample time1']])
set_param([sys,'/',['Pulses deivide',13,'same sample time1']],'Location',[55,192,283,286])
add_block('built-in/S-Function',[sys,'/',['Pulses deivide',13,'same sample time1/S-function1']])
set_param([sys,'/',['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,'/',['Pulses deivide',13,'same sample time1/Outport']])
set_param([sys,'/',['Pulses deivide',13,'same sample time1/Outport']],...
'position',[160,35,180,55])
add_line([sys,'/',['Pulses deivide',13,'same sample time1']],[110,45;155,45])
set_param([sys,'/',['Pulses deivide',13,'same sample time1']],...
'Mask Display','Vector\nPulse',...
'Mask Type','Pulse generator')
set_param([sys,'/',['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,'/',['Pulses deivide',13,'same sample time1']],...
'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['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,'/',['Pulses deivide',13,'same sample time1']],...
'Mask Entries','td\/1\/-ts\/')
% Finished composite block ['Pulses deivide',13,'same sample time1'].
set_param([sys,'/',['Pulses deivide',13,'same sample time1']],...
'position',[350,221,410,259])
% 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\/10\/')
% Finished composite block 'Sampled read'.
set_param([sys,'/','Sampled read'],...
'BackGround',5,...
'position',[10,83,80,127])
add_line(sys,[600,95;610,95])
add_line(sys,[85,105;110,105])
add_line(sys,[90,105;90,35;280,35])
add_line(sys,[345,35;525,35;525,80;555,80])
add_line(sys,[520,105;555,105])
add_line(sys,[295,105;310,105])
add_line(sys,[400,95;435,95])
add_line(sys,[400,115;435,115])
add_line(sys,[190,95;205,95])
add_line(sys,[190,115;205,115])
add_line(sys,[415,95;415,180;455,180])
add_line(sys,[400,115;400,205;455,205])
add_line(sys,[500,195;500,200;525,200])
add_line(sys,[415,240;465,240;465,225;525,225])
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 + -