📄 tstapk.m
字号:
set_param([sys,'/',['APK amp+phase',13,'demodulation/Mux']],...
'inputs','3',...
'position',[490,58,525,92])
add_block('built-in/S-Function',[sys,'/',['APK amp+phase',13,'demodulation/S-function']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/S-function']],...
'ForeGround',2,...
'function name','apskdemo',...
'parameters','L, Fc, N, P, A',...
'position',[550,65,625,85])
add_block('built-in/Outport',[sys,'/',['APK amp+phase',13,'demodulation/out_1']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/out_1']],...
'position',[655,65,675,85])
% Subsystem ['APK amp+phase',13,'demodulation/Rising edge',13,'detector'].
new_system([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],'Location',[303,485,692,659])
add_block('built-in/Outport',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/out_1']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/out_1']],...
'position',[340,25,360,45])
add_block('built-in/Relational Operator',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Relational',13,'Operator1']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Relational',13,'Operator1']],...
'position',[200,88,230,112])
add_block('built-in/Relational Operator',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Relational',13,'Operator2']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Relational',13,'Operator2']],...
'Operator','>',...
'position',[265,23,295,47])
add_block('built-in/Constant',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/one1']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/one1']],...
'Value','thld',...
'position',[30,135,60,155])
add_block('built-in/Memory',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Memory1']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Memory1']],...
'position',[125,80,165,110])
add_block('built-in/Inport',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/in_1']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/in_1']],...
'position',[10,15,30,35])
add_block('built-in/Relational Operator',[sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Relational',13,'Operator']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector/Relational',13,'Operator']],...
'position',[135,18,165,42])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[35,25;130,25])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[45,25;45,95;120,95])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[170,95;195,95])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[65,145;100,145;100,35;130,35])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[100,145;180,145;180,105;195,105])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[170,30;260,30])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[235,100;240,100;240,40;260,40])
add_line([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],[300,35;335,35])
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],...
'Mask Display','Edge\ndetector',...
'Mask Type','Edge Detection',...
'Mask Dialogue','Rising edge detection:|Threshold:',...
'Mask Translate','thld=@1;')
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],...
'Mask Help','When the input signal rising edge passed the given shreshold, this block outputs one, otherwise outputs zero.',...
'Mask Entries','thld\/')
% Finished composite block ['APK amp+phase',13,'demodulation/Rising edge',13,'detector'].
set_param([sys,'/',['APK amp+phase',13,'demodulation/Rising edge',13,'detector']],...
'ForeGround',4,...
'position',[320,108,380,152])
add_block('built-in/Inport',[sys,'/',['APK amp+phase',13,'demodulation/in_2']])
set_param([sys,'/',['APK amp+phase',13,'demodulation/in_2']],...
'Port','2',...
'position',[220,120,240,140])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[245,130;315,130])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[530,75;545,75])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[60,75;120,75])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[385,130;460,130;460,85;485,85])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[630,75;650,75])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[365,75;380,75])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[85,75;85,25;470,25;470,65;485,65])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[455,75;485,75])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[205,60;215,60;215,50;245,50])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[205,60;245,60])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[280,55;300,55;300,70;335,70])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[205,85;245,85])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[205,85;215,85;215,95;245,95])
add_line([sys,'/',['APK amp+phase',13,'demodulation']],[280,90;300,90;300,80;335,80])
set_param([sys,'/',['APK amp+phase',13,'demodulation']],...
'Mask Display','APK\na-p demo',...
'Mask Type','APK demodulation')
set_param([sys,'/',['APK amp+phase',13,'demodulation']],...
'Mask Dialogue','ASK/PSK with concentric circles:|Vector of number of symboles on each circle:|Distance to the originall point for each circle:|Phase shift on each circle:|Carrier frequency:|Trigger signal threshold:')
set_param([sys,'/',['APK amp+phase',13,'demodulation']],...
'Mask Translate','N=@1;A=@2;P=@3;Fc=@4;thld=@5;L=length(N); [num,den]=cheby1(2,.1,Fc*pi/5,''s'');Am=max(A);')
set_param([sys,'/',['APK amp+phase',13,'demodulation']],...
'Mask Help','This block demodulates an ASK/PSK modulated signal in the 1st in-port. The demodulated message are 0,1,..,M-1. The second input port inputs the clock pulse. The clock rising edge triggers the block to process next input. The parameter entry should exactly match the ASK/PSK modulation block.')
set_param([sys,'/',['APK amp+phase',13,'demodulation']],...
'Mask Entries','NIL\/AIL\/PIL\/Fc\/.2\/')
% Finished composite block ['APK amp+phase',13,'demodulation'].
set_param([sys,'/',['APK amp+phase',13,'demodulation']],...
'ForeGround',2,...
'position',[375,123,435,167])
% Subsystem 'Hold and delay'.
new_system([sys,'/','Hold and delay'])
set_param([sys,'/','Hold and delay'],'Location',[380,124,840,274])
add_block('built-in/Memory',[sys,'/','Hold and delay/Memory1'])
set_param([sys,'/','Hold and delay/Memory1'],...
'position',[220,30,260,60])
add_block('built-in/Outport',[sys,'/','Hold and delay/out_1'])
set_param([sys,'/','Hold and delay/out_1'],...
'position',[390,45,410,65])
% Subsystem ['Hold and delay/Clock triggered',13,'hold buffer1'].
new_system([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']],'Location',[229,493,559,628])
add_block('built-in/Inport',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/in_1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/in_1']],...
'position',[40,25,60,45])
add_block('built-in/Inport',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/in_2']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/in_2']],...
'Port','2',...
'position',[15,60,35,80])
add_block('built-in/Outport',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/out_1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/out_1']],...
'position',[290,35,310,55])
% Subsystem ['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector'].
new_system([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],'Location',[303,485,692,659])
add_block('built-in/Relational Operator',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Relational',13,'Operator']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Relational',13,'Operator']],...
'position',[135,18,165,42])
add_block('built-in/Inport',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/in_1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/in_1']],...
'position',[10,15,30,35])
add_block('built-in/Memory',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Memory1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Memory1']],...
'position',[125,80,165,110])
add_block('built-in/Constant',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/one1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/one1']],...
'Value','thld',...
'position',[30,135,60,155])
add_block('built-in/Relational Operator',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Relational',13,'Operator2']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Relational',13,'Operator2']],...
'Operator','>',...
'position',[265,23,295,47])
add_block('built-in/Relational Operator',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Relational',13,'Operator1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/Relational',13,'Operator1']],...
'position',[200,88,230,112])
add_block('built-in/Outport',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/out_1']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector/out_1']],...
'position',[340,25,360,45])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[300,35;335,35])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[235,100;240,100;240,40;260,40])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[170,30;260,30])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[65,145;100,145;100,35;130,35])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[100,145;180,145;180,105;195,105])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[170,95;195,95])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[35,25;130,25])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],[45,25;45,95;120,95])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],...
'Mask Display','Edge\ndetector',...
'Mask Type','Edge Detection',...
'Mask Dialogue','Rising edge detection:|Threshold:')
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],...
'Mask Translate','thld=@1;')
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],...
'Mask Help','When the input signal rising edge passed the given shreshold, this block outputs one, otherwise outputs zero.')
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],...
'Mask Entries','thld\/')
% Finished composite block ['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector'].
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Rising edge',13,'detector']],...
'position',[80,48,140,92])
add_block('built-in/Memory',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Memory']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Memory']],...
'orientation',2,...
'position',[200,80,240,110])
add_block('built-in/Switch',[sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Switch']])
set_param([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1/Switch']],...
'ForeGround',5,...
'Threshold','eps',...
'position',[210,29,240,61])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']],[245,45;260,45;260,95;245,95])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']],[145,70;155,70;155,45;205,45])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']],[195,95;185,95;185,55;205,55])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']],[65,35;205,35])
add_line([sys,'/',['Hold and delay/Clock triggered',13,'hold buffer1']],[245,45;285,45])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -