⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tstps3cd.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 3 页
字号:
		'Mask Help','This block reads the data from a workspace variable. The output is refreshed at the raising edge of the input pulse.',...
		'Mask Entries','var\/.1\/cyc\/ini\/')
set_param([sys,'/',['Sampled read',13,'from wksp/Message source']],...
		'position',[180,53,255,97])

add_block('built-in/Outport',[sys,'/',['Sampled read',13,'from wksp/out_1']])
set_param([sys,'/',['Sampled read',13,'from wksp/out_1']],...
		'position',[295,65,315,85])


%     Subsystem  ['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1'].

new_system([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],'Location',[55,192,283,286])

add_block('built-in/Outport',[sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/Outport']])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/Outport']],...
		'position',[160,35,180,55])

add_block('built-in/S-Function',[sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/S-function1']])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1/S-function1']],...
		'function name','homopuls',...
		'parameters','samp_time, out_divid, offset',...
		'position',[40,31,105,59])
add_line([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],[110,45;155,45])
set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
		'Mask Display','Vector\nPulse',...
		'Mask Type','Pulse generator')
set_param([sys,'/',['Sampled read',13,'from wksp/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',13,'from wksp/Pulses deivide',13,'same sample time1']],...
		'Mask Translate','samp_time=@1;out_divid=@2;offset=@3;')
set_param([sys,'/',['Sampled read',13,'from wksp/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',13,'from wksp/Pulses deivide',13,'same sample time1']],...
		'Mask Entries','ts\/1\/off\/')


%     Finished composite block ['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1'].

set_param([sys,'/',['Sampled read',13,'from wksp/Pulses deivide',13,'same sample time1']],...
		'position',[50,56,110,94])
add_line([sys,'/',['Sampled read',13,'from wksp']],[115,75;175,75])
add_line([sys,'/',['Sampled read',13,'from wksp']],[260,75;290,75])
set_param([sys,'/',['Sampled read',13,'from wksp']],...
		'Mask Display','plot(0,0,100,100,x,y);Rd wksp',...
		'Mask Type','Read from workspace')
set_param([sys,'/',['Sampled read',13,'from wksp']],...
		'Mask Dialogue','Read from a workspace variable at\nsampling time point.|Variable (column_number=block_output_length):|Data output sample time (sec):|Cyclic control (1: cyclic read, 0: output zeros after eof).|Initial output:')
set_param([sys,'/',['Sampled read',13,'from wksp']],...
		'Mask Translate','var=@1;td=@2;ts=td(1);if (length(td)>=2),off=td(2);else off=0;end;cyc=@3;ini=@4;[x,y]=srcsicon(7);')
set_param([sys,'/',['Sampled read',13,'from wksp']],...
		'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 (eof) row, the block will cyclically output from the first row of the variable or output zeros based on the cyclic control entree.')
set_param([sys,'/',['Sampled read',13,'from wksp']],...
		'Mask Entries','randint(1000,1,M)\/td\/1\/0\/')


%     Finished composite block ['Sampled read',13,'from wksp'].

set_param([sys,'/',['Sampled read',13,'from wksp']],...
		'hide name',0,...
		'position',[25,53,100,97])


%     Subsystem  ['QASK',13,'arbitrary-map'].

new_system([sys,'/',['QASK',13,'arbitrary-map']])
set_param([sys,'/',['QASK',13,'arbitrary-map']],'Location',[58,103,403,268])

add_block('built-in/Zero-Order Hold',[sys,'/',['QASK',13,'arbitrary-map/Zero-Order',13,'Hold1']])
set_param([sys,'/',['QASK',13,'arbitrary-map/Zero-Order',13,'Hold1']],...
		'Sample time','td',...
		'position',[80,14,115,46])

add_block('built-in/Inport',[sys,'/',['QASK',13,'arbitrary-map/in_1']])
set_param([sys,'/',['QASK',13,'arbitrary-map/in_1']],...
		'position',[25,20,45,40])

add_block('built-in/Look Up Table',[sys,'/',['QASK',13,'arbitrary-map/real part']])
set_param([sys,'/',['QASK',13,'arbitrary-map/real part']],...
		'Input_Values','x',...
		'Output_Values','y1',...
		'position',[180,17,215,43])

add_block('built-in/Look Up Table',[sys,'/',['QASK',13,'arbitrary-map/imag part1']])
set_param([sys,'/',['QASK',13,'arbitrary-map/imag part1']],...
		'Input_Values','x',...
		'Output_Values','y2',...
		'position',[175,97,210,123])

add_block('built-in/Outport',[sys,'/',['QASK',13,'arbitrary-map/Real']])
set_param([sys,'/',['QASK',13,'arbitrary-map/Real']],...
		'position',[275,20,295,40])

add_block('built-in/Outport',[sys,'/',['QASK',13,'arbitrary-map/Imag']])
set_param([sys,'/',['QASK',13,'arbitrary-map/Imag']],...
		'Port','2',...
		'position',[275,100,295,120])
add_line([sys,'/',['QASK',13,'arbitrary-map']],[50,30;75,30])
add_line([sys,'/',['QASK',13,'arbitrary-map']],[120,30;175,30])
add_line([sys,'/',['QASK',13,'arbitrary-map']],[145,30;145,110;170,110])
add_line([sys,'/',['QASK',13,'arbitrary-map']],[220,30;270,30])
add_line([sys,'/',['QASK',13,'arbitrary-map']],[215,110;270,110])
set_param([sys,'/',['QASK',13,'arbitrary-map']],...
		'Mask Display','QASK\nA-map',...
		'Mask Type','QASK A-map')
set_param([sys,'/',['QASK',13,'arbitrary-map']],...
		'Mask Dialogue','QASK mapping for arbitrary defined\nmap. Assume input digit is K. 1st\noutport outputs in-phase(K+1). 2nd\noutport outputs quadrature(K+1).|Constellation for in-phase component:|Constellation for quadrature component:|Symbol interval and offset (sec):')
set_param([sys,'/',['QASK',13,'arbitrary-map']],...
		'Mask Translate','y1=@1;y2=@2;td=@3;ly=length(y1);x=[-10 1:ly-1;1:ly-1 10*ly]-.5;x=x(:);y1=y1(:)'';y1=[y1;y1];y1=y1(:);y2=y2(:)'';y2=[y2;y2];y2=y2(:);')
set_param([sys,'/',['QASK',13,'arbitrary-map']],...
		'Mask Help','This block maps a digital signal onto in-phase and quadratic components, which are outputs in the first and second output port respectively. The in-phase and quadrature constellation vectors must have the same length, which equals to M, the M-ary number of the QASK. The input signal is in the range of [0, M-1]. The symbol interval can be a two elements vector with the first element being offset. The default offset is zero.')
set_param([sys,'/',['QASK',13,'arbitrary-map']],...
		'Mask Entries','[real(exp(j*[1:floor(M/3)]/floor(M/3)*pi*2)) 2*real(exp(j*[1:M-floor(M/3)]/(M-floor(M/3))*pi*2))]\/[imag(exp(j*[1:floor(M/3)]/floor(M/3)*pi*2)) 2*imag(exp(j*[1:M-floor(M/3)]/(M-floor(M/3))*pi*2))]\/td\/')


%     Finished composite block ['QASK',13,'arbitrary-map'].

set_param([sys,'/',['QASK',13,'arbitrary-map']],...
		'hide name',0,...
		'position',[150,53,230,97])


%     Subsystem  ['QAM',13,'passband2'].

new_system([sys,'/',['QAM',13,'passband2']])
set_param([sys,'/',['QAM',13,'passband2']],'Location',[302,478,834,743])

add_block('built-in/Clock',[sys,'/',['QAM',13,'passband2/Clock']])
set_param([sys,'/',['QAM',13,'passband2/Clock']],...
		'position',[80,85,100,105])

add_block('built-in/Gain',[sys,'/',['QAM',13,'passband2/Gain']])
set_param([sys,'/',['QAM',13,'passband2/Gain']],...
		'Gain','Fc',...
		'position',[130,76,180,114])

add_block('built-in/Inport',[sys,'/',['QAM',13,'passband2/in_2']])
set_param([sys,'/',['QAM',13,'passband2/in_2']],...
		'Port','2',...
		'position',[160,145,180,165])

add_block('built-in/Inport',[sys,'/',['QAM',13,'passband2/in_1']])
set_param([sys,'/',['QAM',13,'passband2/in_1']],...
		'position',[160,30,180,50])

add_block('built-in/Outport',[sys,'/',['QAM',13,'passband2/out_1']])
set_param([sys,'/',['QAM',13,'passband2/out_1']],...
		'position',[490,90,510,110])

add_block('built-in/Sum',[sys,'/',['QAM',13,'passband2/Sum2']])
set_param([sys,'/',['QAM',13,'passband2/Sum2']],...
		'position',[430,90,450,110])

add_block('built-in/Product',[sys,'/',['QAM',13,'passband2/Product1']])
set_param([sys,'/',['QAM',13,'passband2/Product1']],...
		'position',[355,112,380,143])

add_block('built-in/Product',[sys,'/',['QAM',13,'passband2/Product']])
set_param([sys,'/',['QAM',13,'passband2/Product']],...
		'position',[355,47,380,78])

add_block('built-in/Note',[sys,'/',['QAM',13,'passband2/Ref: Hambley: An Intro to Comm. Systems. pp72']])
set_param([sys,'/',['QAM',13,'passband2/Ref: Hambley: An Intro to Comm. Systems. pp72']],...
		'position',[250,305,255,310])

add_block('built-in/Fcn',[sys,'/',['QAM',13,'passband2/Fcn1']])
set_param([sys,'/',['QAM',13,'passband2/Fcn1']],...
		'Expr','sin(u[1]+Ph)',...
		'position',[230,105,325,135])

add_block('built-in/Fcn',[sys,'/',['QAM',13,'passband2/Fcn']])
set_param([sys,'/',['QAM',13,'passband2/Fcn']],...
		'Expr','cos(u[1]+Ph)',...
		'position',[230,55,325,85])
add_line([sys,'/',['QAM',13,'passband2']],[185,95;200,95;200,70;225,70])
add_line([sys,'/',['QAM',13,'passband2']],[200,95;200,120;225,120])
add_line([sys,'/',['QAM',13,'passband2']],[105,95;125,95])
add_line([sys,'/',['QAM',13,'passband2']],[385,130;400,130;400,105;425,105])
add_line([sys,'/',['QAM',13,'passband2']],[385,65;400,65;400,95;425,95])
add_line([sys,'/',['QAM',13,'passband2']],[185,155;330,155;330,135;350,135])
add_line([sys,'/',['QAM',13,'passband2']],[330,120;350,120])
add_line([sys,'/',['QAM',13,'passband2']],[185,40;335,40;335,55;350,55])
add_line([sys,'/',['QAM',13,'passband2']],[330,70;350,70])
add_line([sys,'/',['QAM',13,'passband2']],[455,100;485,100])
set_param([sys,'/',['QAM',13,'passband2']],...
		'Mask Display','plot(0,0,100,100,x,y);QAM',...
		'Mask Type','Passband DSB-SC QAM')
set_param([sys,'/',['QAM',13,'passband2']],...
		'Mask Dialogue','Modulate the in-phase signal from first input port and quadrature signal from\nthe second port using QAM.|Carrier frequency (Hz):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['QAM',13,'passband2']],...
		'Mask Translate','Fc=@1*2*pi;Ph=@2;ts=@3;[x,y]=moduicon(1);')
set_param([sys,'/',['QAM',13,'passband2']],...
		'Mask Help','This block modulates the in-phase component inputted from the first port and the quadrature component inputted from the second port by using two orthogonal sinusoidal carriers.')
set_param([sys,'/',['QAM',13,'passband2']],...
		'Mask Entries','100/2/pi\/0\/ts\/')


%     Finished composite block ['QAM',13,'passband2'].

set_param([sys,'/',['QAM',13,'passband2']],...
		'hide name',0,...
		'position',[265,53,345,97])


%     Subsystem  ['QADM',13,'passband2'].

new_system([sys,'/',['QADM',13,'passband2']])
set_param([sys,'/',['QADM',13,'passband2']],'Location',[194,478,738,741])

add_block('built-in/Outport',[sys,'/',['QADM',13,'passband2/out_1']])
set_param([sys,'/',['QADM',13,'passband2/out_1']],...
		'position',[480,70,500,90])

add_block('built-in/Outport',[sys,'/',['QADM',13,'passband2/out_2']])
set_param([sys,'/',['QADM',13,'passband2/out_2']],...
		'Port','2',...
		'position',[480,175,500,195])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -