📄 tstpll.m
字号:
add_block('built-in/Inport',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/in_1']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/in_1']],...
'position',[20,25,40,45])
add_block('built-in/Sum',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Sum']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Sum']],...
'position',[150,30,170,50])
% Subsystem ['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator'].
new_system([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],'Location',[529,321,954,458])
add_block('built-in/Outport',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/out_1']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/out_1']],...
'position',[370,30,390,50])
add_block('built-in/Sum',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/Sum']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/Sum']],...
'position',[195,30,215,50])
add_block('built-in/Constant',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/one']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/one']],...
'orientation',3,...
'move name',0,...
'position',[70,55,90,75])
add_block('built-in/Reset Integrator',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/Reset',13,'integrator']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/Reset',13,'integrator']],...
'position',[110,19,150,51])
add_block('built-in/Fcn',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/module']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/module']],...
'Expr','rem(u[1],modu)',...
'position',[235,29,325,51])
add_block('built-in/Memory',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/Memory']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/Memory']],...
'orientation',2,...
'x0','init',...
'position',[210,75,260,105])
add_block('built-in/Inport',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/in_1']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator/in_1']],...
'position',[35,15,55,35])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[330,40;365,40])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[340,40;340,90;265,90])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[80,50;80,35;105,35])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[60,25;105,25])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[220,40;230,40])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[155,35;190,35])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],[205,90;180,90;190,45])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],...
'Mask Display','Mod\nint',...
'Mask Type','Module Integrator')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],...
'Mask Dialogue','Module the given number when state exceed limit|Module bound:|Initial value:',...
'Mask Translate','init=@2; modu=@1;')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],...
'Mask Help','The absolute value of this integrator will not exceed the specified module bound. The state value is set to be zero when the module bound is reached. This block can only be used for scale value calculation.')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],...
'Mask Entries','1\/0\/')
% Finished composite block ['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator'].
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Module',13,'Integrator']],...
'position',[195,24,250,56])
add_block('built-in/Fcn',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/sin']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/sin']],...
'Expr','Ac*sin(u[1]*pi2+Ph)',...
'position',[270,25,395,55])
add_block('built-in/Constant',[sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Carrier',13,'frequency']])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator/Carrier',13,'frequency']],...
'Value','Fc',...
'position',[90,75,110,95])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],[255,40;265,40])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],[45,35;60,35])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],[110,35;145,35])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],[115,85;125,85;125,45;145,45])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],[175,40;190,40])
add_line([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],[400,40;405,40])
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],...
'Mask Display','VCO',...
'Mask Type','VCO')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],...
'Mask Dialogue','Voltage-Controlled Oscilator:|Amplitude constant:|Carier frequency (Hz):|Sensitivity constant:|Initial phase (rad):')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],...
'Mask Translate','Ac=@1;Fc=@2;Kc=@3;Ph=@4;pi2=2*pi;')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],...
'Mask Help','The VCO block cause the frequency of the sinusoidal carrier to depend on the input signal voltage, resulting in frequency of the output change depending on the amplitude of the input signal.')
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],...
'Mask Entries','Ac\/Fc\/1\/Ph\/')
% Finished composite block ['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator'].
set_param([sys,'/',['Phase-locked',13,'loop/Voltage-controlled',13,'oscilator']],...
'orientation',2,...
'position',[175,137,230,173])
add_block('built-in/Gain',[sys,'/',['Phase-locked',13,'loop/Gain']])
set_param([sys,'/',['Phase-locked',13,'loop/Gain']],...
'Gain','G',...
'position',[350,67,375,93])
add_block('built-in/Outport',[sys,'/',['Phase-locked',13,'loop/out_1']])
set_param([sys,'/',['Phase-locked',13,'loop/out_1']],...
'position',[405,70,425,90])
add_line([sys,'/',['Phase-locked',13,'loop']],[170,155;95,155;95,85;135,85])
add_line([sys,'/',['Phase-locked',13,'loop']],[95,155;95,205;310,205])
add_line([sys,'/',['Phase-locked',13,'loop']],[170,80;220,80])
add_line([sys,'/',['Phase-locked',13,'loop']],[190,80;190,35;300,35])
add_line([sys,'/',['Phase-locked',13,'loop']],[70,75;135,75])
add_line([sys,'/',['Phase-locked',13,'loop']],[280,80;320,80;320,155;235,155])
add_line([sys,'/',['Phase-locked',13,'loop']],[320,80;345,80])
add_line([sys,'/',['Phase-locked',13,'loop']],[380,80;400,80])
set_param([sys,'/',['Phase-locked',13,'loop']],...
'Mask Display','PLL',...
'Mask Type','Simple form PLL')
set_param([sys,'/',['Phase-locked',13,'loop']],...
'Mask Dialogue','Output the phase shifting signal at 1st\nport; the detected phase error at 2nd\nport; VOC output at 3rd port.|Lowpass filter numerator:|Lowpass filter denominator:|Oscillation frequency:|Oscillation Phase:|Oscillation Amplitude:|Gain at the output:')
set_param([sys,'/',['Phase-locked',13,'loop']],...
'Mask Translate','Fn=@1;Fd=@2;Fc=@3;Ph=@4;Ac=@5;G=@6;')
set_param([sys,'/',['Phase-locked',13,'loop']],...
'Mask Help','This block detects the phase shifting of the input signal. This block uses a multiplier phase detector. The first output is the detected phase shift. The second output is the detected phase error output from phase detector. The third output is the matching signal for the input. Note a 180 degree phase difference between the input signal and the matching signal.')
set_param([sys,'/',['Phase-locked',13,'loop']],...
'Mask Entries','[3.0002, 0, 40002]\/[1, 67.46, 2270.9, 40002]\/100/2/pi\/pi/2\/1\/2\/')
% Finished composite block ['Phase-locked',13,'loop'].
set_param([sys,'/',['Phase-locked',13,'loop']],...
'ForeGround',7,...
'hide name',0,...
'position',[260,158,340,202])
add_block('built-in/Signal Generator',[sys,'/',['Signal',13,'generator']])
set_param([sys,'/',['Signal',13,'generator']],...
'ForeGround',5,...
'hide name',0,...
'Peak','1.000000',...
'Peak Range','5.000000',...
'Freq','6.000000',...
'Freq Range','50.000000',...
'Wave','Sin',...
'Units','Rads')
set_param([sys,'/',['Signal',13,'generator']],...
'position',[15,118,60,152])
add_block('built-in/Transfer Fcn',[sys,'/','Lowpass filter'])
set_param([sys,'/','Lowpass filter'],...
'ForeGround',3,...
'hide name',0,...
'Numerator','[3.0002, 0, 40002]',...
'Denominator','[1, 67.46, 2270.9, 40002]',...
'position',[110,50,285,90])
add_block('built-in/Mux',[sys,'/','Mux'])
set_param([sys,'/','Mux'],...
'hide name',0,...
'inputs','6',...
'position',[485,20,520,70])
add_block('built-in/Mux',[sys,'/','Mux1'])
set_param([sys,'/','Mux1'],...
'hide name',0,...
'inputs','3',...
'position',[485,127,520,163])
% Subsystem ['Voltage-controlled',13,'oscillator'].
new_system([sys,'/',['Voltage-controlled',13,'oscillator']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator']],'Location',[290,299,749,446])
add_block('built-in/Outport',[sys,'/',['Voltage-controlled',13,'oscillator/out_1']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/out_1']],...
'position',[425,30,445,50])
add_block('built-in/Gain',[sys,'/',['Voltage-controlled',13,'oscillator/Sensitivity']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Sensitivity']],...
'Gain','Kc',...
'position',[80,21,120,49])
add_block('built-in/Inport',[sys,'/',['Voltage-controlled',13,'oscillator/in_1']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/in_1']],...
'position',[35,25,55,45])
add_block('built-in/Constant',[sys,'/',['Voltage-controlled',13,'oscillator/Carrier',13,'frequency']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Carrier',13,'frequency']],...
'Value','Fc',...
'position',[95,85,115,105])
add_block('built-in/Sum',[sys,'/',['Voltage-controlled',13,'oscillator/Sum']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Sum']],...
'position',[165,30,185,50])
% Subsystem ['Voltage-controlled',13,'oscillator/Module',13,'Integrator'].
new_system([sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator']],'Location',[329,75,754,212])
add_block('built-in/Inport',[sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/in_1']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/in_1']],...
'position',[35,15,55,35])
add_block('built-in/Memory',[sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/Memory']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/Memory']],...
'orientation',2,...
'x0','init',...
'position',[210,75,260,105])
add_block('built-in/Fcn',[sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/module']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/module']],...
'Expr','rem(u[1],modu)',...
'position',[235,29,325,51])
add_block('built-in/Reset Integrator',[sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/Reset',13,'integrator']])
set_param([sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/Reset',13,'integrator']],...
'position',[110,19,150,51])
add_block('built-in/Constant',[sys,'/',['Voltage-controlled',13,'oscillator/Module',13,'Integrator/one']])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -