📄 tstam2ce.m
字号:
add_block('built-in/Constant',[sys,'/',['MASK mod',13,'baseband/MASK map/Gain diff']])
set_param([sys,'/',['MASK mod',13,'baseband/MASK map/Gain diff']],...
'Value','Ac',...
'position',[180,96,215,124])
add_line([sys,'/',['MASK mod',13,'baseband/MASK map']],[225,40;230,40;230,70;245,70])
add_line([sys,'/',['MASK mod',13,'baseband/MASK map']],[220,110;230,110;230,80;245,80])
add_line([sys,'/',['MASK mod',13,'baseband/MASK map']],[275,75;310,75])
add_line([sys,'/',['MASK mod',13,'baseband/MASK map']],[65,40;95,40])
add_line([sys,'/',['MASK mod',13,'baseband/MASK map']],[140,40;175,40])
set_param([sys,'/',['MASK mod',13,'baseband/MASK map']],...
'Mask Display','MASK\nmap',...
'Mask Type','MASK map')
set_param([sys,'/',['MASK mod',13,'baseband/MASK map']],...
'Mask Dialogue','Map a digital symbol onto an analog\nsignal in the range [-1, 1] using M-ary\namplitude shift keying modulation mapping.|M-ary number (input integers in range [0, M-1]):|Input symbol interval and offset (sec):')
set_param([sys,'/',['MASK mod',13,'baseband/MASK map']],...
'Mask Translate','N=@1;Ac=1;Kc=Ac*2/(N-1);td=@2;')
set_param([sys,'/',['MASK mod',13,'baseband/MASK map']],...
'Mask Help','This block maps an input digit signal onto a signal in the range [-1, 1]. The coded signal can be modulated using analog\nmodulation blocks. Input digits are in the range [0, M-1], where M is the M-ary number. The input symbol interval can be a two-element vector with the second element being offset. The default value offset is 0. Use the MODMAP function to see the constellation.')
set_param([sys,'/',['MASK mod',13,'baseband/MASK map']],...
'Mask Entries','n\/td\/')
% Finished composite block ['MASK mod',13,'baseband/MASK map'].
set_param([sys,'/',['MASK mod',13,'baseband/MASK map']],...
'position',[75,33,155,77])
add_block('built-in/Outport',[sys,'/',['MASK mod',13,'baseband/out_1']])
set_param([sys,'/',['MASK mod',13,'baseband/out_1']],...
'position',[300,45,320,65])
add_block('built-in/Inport',[sys,'/',['MASK mod',13,'baseband/in_1']])
set_param([sys,'/',['MASK mod',13,'baseband/in_1']],...
'position',[25,45,45,65])
add_line([sys,'/',['MASK mod',13,'baseband']],[265,55;295,55])
add_line([sys,'/',['MASK mod',13,'baseband']],[160,55;175,55])
add_line([sys,'/',['MASK mod',13,'baseband']],[50,55;70,55])
set_param([sys,'/',['MASK mod',13,'baseband']],...
'Mask Display','plot(0,0,100,100,x,y,u,v);MASK',...
'Mask Type','Baseband MASK modulation')
set_param([sys,'/',['MASK mod',13,'baseband']],...
'Mask Dialogue','Output the complex envelope of the\namplitude shift keying modulated signal.|M-ary number (input integers in the range [0, M-1]):|Input symbol interval and offset (sec):|Initial phase (rad):')
set_param([sys,'/',['MASK mod',13,'baseband']],...
'Mask Translate','n=@1;td=@2;Ph=@3;[x,y]=moduicon(5);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['MASK mod',13,'baseband']],...
'Mask Help','This block outputs the complex envelope of MASK modulated signal. The inputs are integers in the range [0, M-1], where M is the M-ary number. The maximum amplitude of the output is 1. When the symbol interval is a two-element vector, the second element is the offset (default 0). The block takes the input value at the sampling time point.')
set_param([sys,'/',['MASK mod',13,'baseband']],...
'Mask Entries','M\/td\/0\/')
% Finished composite block ['MASK mod',13,'baseband'].
set_param([sys,'/',['MASK mod',13,'baseband']],...
'hide name',0,...
'position',[145,63,225,107])
% Subsystem 'Error rate1'.
new_system([sys,'/','Error rate1'])
set_param([sys,'/','Error rate1'],'Location',[255,368,509,510])
add_block('built-in/S-Function',[sys,'/','Error rate1/S-function'])
set_param([sys,'/','Error rate1/S-function'],...
'function name','sbiterr',...
'parameters','num_lin, K, TDelay, Sample',...
'position',[130,52,195,78])
add_block('built-in/Mux',[sys,'/','Error rate1/Mux'])
set_param([sys,'/','Error rate1/Mux'],...
'inputs','2',...
'position',[65,46,100,79])
add_block('built-in/Inport',[sys,'/','Error rate1/in_1'])
set_param([sys,'/','Error rate1/in_1'],...
'position',[15,45,35,65])
add_block('built-in/Inport',[sys,'/','Error rate1/in_2'])
set_param([sys,'/','Error rate1/in_2'],...
'Port','2',...
'position',[15,60,35,80])
add_line([sys,'/','Error rate1'],[105,65;125,65])
add_line([sys,'/','Error rate1'],[40,55;60,55])
add_line([sys,'/','Error rate1'],[40,70;60,70])
set_param([sys,'/','Error rate1'],...
'Mask Display','Error\nmeter',...
'Mask Type','Symbol/bit error counter')
set_param([sys,'/','Error rate1'],...
'Mask Dialogue','Use the input data from the 1st port as the reference signal to detect the number of errors and error rate of the 2nd port inputted signal.|Bit per symbol:|Number of digits on display:|Delay between input (1st port) and output (2nd port):|Sampling time (sec):')
set_param([sys,'/','Error rate1'],...
'Mask Translate','K=@1;num_lin=@2;TDelay=@3;Sample=@4;')
set_param([sys,'/','Error rate1'],...
'Mask Help','The signal from the first port must be a scalar. The second input port can be a vector with a same-time delay to the input signal. The comparison happens only at the sampling point.')
set_param([sys,'/','Error rate1'],...
'Mask Entries','ceil(log10(M)/log10(2))\/20\/td\/td\/')
% Finished composite block 'Error rate1'.
set_param([sys,'/','Error rate1'],...
'hide name',0,...
'position',[485,53,565,97])
% Subsystem ['MASK demod',13,'baseband'].
new_system([sys,'/',['MASK demod',13,'baseband']])
set_param([sys,'/',['MASK demod',13,'baseband']],'Location',[82,326,492,462])
% Subsystem ['MASK demod',13,'baseband/DSB-ADM',13,'baseband'].
new_system([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband']],'Location',[172,360,722,581])
add_block('built-in/Outport',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/out_1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/out_1']],...
'position',[485,35,505,55])
add_block('built-in/Product',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Product1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Product1']],...
'orientation',2,...
'position',[390,110,425,130])
add_block('built-in/Filter',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Filter']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Filter']],...
'Numerator','num',...
'Denominator','den',...
'Sample time','ts',...
'position',[260,26,315,64])
% Subsystem ['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply'].
new_system([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply']],'Location',[297,318,980,694])
add_block('built-in/Inport',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Complex',13,'input 2']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Complex',13,'input 2']],...
'Port','2',...
'position',[25,205,45,225])
add_block('built-in/Demux',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split1']],...
'outputs','2',...
'Mask Display','Complex to\nReal/Imag',...
'Mask Type','Complex to Real/Imag')
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split1']],...
'Mask Dialogue','Real and imaginary components of complex vector.')
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split1']],...
'Mask Help','The Complex to Real/Imag block decomposes a complex vector into its real and imaginary components using a Demux block. The real part is directed to output 1, and the imaginary to output 2.')
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split1']],...
'position',[80,194,155,236])
add_block('built-in/Inport',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Complex',13,'input 1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Complex',13,'input 1']],...
'position',[35,90,55,110])
add_block('built-in/Demux',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split']],...
'outputs','2',...
'Mask Display','Complex to\nReal/Imag',...
'Mask Type','Complex to Real/Imag')
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split']],...
'Mask Dialogue','Real and imaginary components of complex vector.')
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split']],...
'Mask Help','The Complex to Real/Imag block decomposes a complex vector into its real and imaginary components using a Demux block. The real part is directed to output 1, and the imaginary to output 2.')
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Split']],...
'position',[85,79,160,121])
add_block('built-in/Note',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R = Real',13,'I = Imaginary']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R = Real',13,'I = Imaginary']],...
'position',[55,0,60,5])
add_block('built-in/Note',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/I_out']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/I_out']],...
'position',[450,286,455,291])
add_block('built-in/Note',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R_out']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R_out']],...
'position',[450,95,455,100])
add_block('built-in/Sum',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Sum1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Sum1']],...
'position',[380,280,400,300])
add_block('built-in/Product',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product2']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product2']],...
'position',[305,298,335,322])
add_block('built-in/Product',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product3']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product3']],...
'position',[305,253,335,277])
add_block('built-in/Sum',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Sum']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Sum']],...
'inputs','+-',...
'position',[380,110,400,130])
add_block('built-in/Product',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product1']],...
'position',[305,143,335,167])
add_block('built-in/Product',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Product']],...
'position',[305,83,335,107])
add_block('built-in/Note',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R2']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R2']],...
'position',[190,185,195,190])
add_block('built-in/Note',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/R1']],...
'position',[195,65,200,70])
add_block('built-in/Note',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/I1']])
set_param([sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/I1']],...
'position',[198,108,203,113])
add_block('built-in/Outport',[sys,'/',['MASK demod',13,'baseband/DSB-ADM',13,'baseband/Cmplx-in',13,'Re//Im-out',13,'Multiply/Imag']])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -