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

📄 tstrcos.m

📁 通信系统的matlab仿真程序
💻 M
📖 第 1 页 / 共 5 页
字号:
add_block('built-in/Filter',[sys,'/',['QADM',13,'baseband/Filter1']])
set_param([sys,'/',['QADM',13,'baseband/Filter1']],...
		'Numerator','num',...
		'Denominator','den',...
		'Sample time','ts',...
		'position',[395,211,450,249])

add_block('built-in/Outport',[sys,'/',['QADM',13,'baseband/out_2']])
set_param([sys,'/',['QADM',13,'baseband/out_2']],...
		'Port','2',...
		'position',[485,220,505,240])

add_block('built-in/Sum',[sys,'/',['QADM',13,'baseband/Sum1']])
set_param([sys,'/',['QADM',13,'baseband/Sum1']],...
		'position',[340,220,360,240])

add_block('built-in/Constant',[sys,'/',['QADM',13,'baseband/Constant1']])
set_param([sys,'/',['QADM',13,'baseband/Constant1']],...
		'Value','x2',...
		'position',[160,245,180,265])

add_block('built-in/Inport',[sys,'/',['QADM',13,'baseband/in_1']])
set_param([sys,'/',['QADM',13,'baseband/in_1']],...
		'position',[55,115,75,135])
add_line([sys,'/',['QADM',13,'baseband']],[455,230;480,230])
add_line([sys,'/',['QADM',13,'baseband']],[365,230;390,230])
add_line([sys,'/',['QADM',13,'baseband']],[450,80;475,80])
add_line([sys,'/',['QADM',13,'baseband']],[360,80;385,80])
add_line([sys,'/',['QADM',13,'baseband']],[80,125;115,125])
add_line([sys,'/',['QADM',13,'baseband']],[305,250;315,250;315,235;335,235])
add_line([sys,'/',['QADM',13,'baseband']],[305,205;315,205;315,225;335,225])
add_line([sys,'/',['QADM',13,'baseband']],[295,135;305,135;305,85;330,85])
add_line([sys,'/',['QADM',13,'baseband']],[295,55;305,55;305,75;330,75])
add_line([sys,'/',['QADM',13,'baseband']],[180,50;255,50])
add_line([sys,'/',['QADM',13,'baseband']],[215,50;215,200;265,200])
add_line([sys,'/',['QADM',13,'baseband']],[165,130;255,130])
add_line([sys,'/',['QADM',13,'baseband']],[180,130;180,210;265,210])
add_line([sys,'/',['QADM',13,'baseband']],[185,255;200,255;200,140;255,140])
add_line([sys,'/',['QADM',13,'baseband']],[200,255;265,255])
add_line([sys,'/',['QADM',13,'baseband']],[165,115;230,115;230,60;255,60])
add_line([sys,'/',['QADM',13,'baseband']],[230,115;230,245;265,245])
set_param([sys,'/',['QADM',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);QADM',...
		'Mask Type','QM DSB-SC ADM CE')
set_param([sys,'/',['QADM',13,'baseband']],...
		'Mask Dialogue','Demodulate the complex envelope of a\nQAM modulated signal into in-phase and\nquadrature components into 1st and 2nd\nout ports.|Lowpass filter numerator:|Lowpass filter denominator:|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['QADM',13,'baseband']],...
		'Mask Translate','num=@1;den=@2;Ph=@3;ts=@4;x1=cos(-Ph);x2=sin(-Ph);[x,y]=moduicon(2);[u,v]=cmplxicn(0,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['QADM',13,'baseband']],...
		'Mask Help','This block demodulates the quadratic multiplexed double-sideband suppressed-carrier amplitude modulation modulated signal using the QAM method. The filter to be specified is a lowpass filter that passes the signal message and eliminates the carrier signal.')
set_param([sys,'/',['QADM',13,'baseband']],...
		'Mask Entries','num\/den\/0\/ts\/')


%     Finished composite block ['QADM',13,'baseband'].

set_param([sys,'/',['QADM',13,'baseband']],...
		'hide name',0,...
		'position',[520,58,600,102])


%     Subsystem  ['Eye-diagram',13,'scatter plot'].

new_system([sys,'/',['Eye-diagram',13,'scatter plot']])
set_param([sys,'/',['Eye-diagram',13,'scatter plot']],'Location',[165,242,460,428])

add_block('built-in/S-Function',[sys,'/',['Eye-diagram',13,'scatter plot/Plot1']])
set_param([sys,'/',['Eye-diagram',13,'scatter plot/Plot1']],...
		'function name','eyediasi',...
		'parameters','time_range, boundary, kept_length, eye_line, scatter_line, two_d_line',...
		'position',[130,70,200,110])

add_block('built-in/Mux',[sys,'/',['Eye-diagram',13,'scatter plot/Mux']])
set_param([sys,'/',['Eye-diagram',13,'scatter plot/Mux']],...
		'inputs','2',...
		'position',[65,70,100,105])

add_block('built-in/Inport',[sys,'/',['Eye-diagram',13,'scatter plot/in_2']])
set_param([sys,'/',['Eye-diagram',13,'scatter plot/in_2']],...
		'Port','2',...
		'position',[20,115,40,135])

add_block('built-in/Inport',[sys,'/',['Eye-diagram',13,'scatter plot/in_1']])
set_param([sys,'/',['Eye-diagram',13,'scatter plot/in_1']],...
		'position',[15,55,35,75])
add_line([sys,'/',['Eye-diagram',13,'scatter plot']],[105,90;125,90])
add_line([sys,'/',['Eye-diagram',13,'scatter plot']],[45,125;50,125;60,95])
add_line([sys,'/',['Eye-diagram',13,'scatter plot']],[40,65;45,65;45,80;60,80])
set_param([sys,'/',['Eye-diagram',13,'scatter plot']],...
		'Mask Display','plot(0,0,100,100,x,y,v,w);',...
		'Mask Type','Eye-diagram/scatter plot')
set_param([sys,'/',['Eye-diagram',13,'scatter plot']],...
		'Mask Dialogue','Produce eye-pattern diagram/scatter\nplot/x-y plot with the rising edge of the second input as the decision line.|Eye-pattern plot time frame:|Lower and upper bound of in-coming signal (1x2 vector):|Number of saved traces:|Line-type for eye-pattern diagram (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,'/',['Eye-diagram',13,'scatter plot']],...
		'Mask Translate','time_range=@1;boundary=@2;kept_length=@3;eye_line=@4;scatter_line=@5;two_d_line=@6;[x,y]=srcsicon(10);[v,w]=trigicon(0,25,get_param(gcb,''orientation''),2);')
set_param([sys,'/',['Eye-diagram',13,'scatter plot']],...
		'Mask Help','This plot opens one, two, or three plots by assigning the line type parameters. The scatter plot point is selected by the rising edge of a trigger signal. A decision line is drawn at the rising edge of the trigger signal.')
set_param([sys,'/',['Eye-diagram',13,'scatter plot']],...
		'Mask Entries','2*td\/[-1.5 1.5]\/10\/''r-/g--/b-.''\/''r+/gx/b*''\/0\/')


%     Finished composite block ['Eye-diagram',13,'scatter plot'].

set_param([sys,'/',['Eye-diagram',13,'scatter plot']],...
		'hide name',0,...
		'position',[740,143,820,187])


%     Subsystem  'Error rate'.

new_system([sys,'/','Error rate'])
set_param([sys,'/','Error rate'],'Location',[255,368,509,510])

add_block('built-in/S-Function',[sys,'/','Error rate/S-function'])
set_param([sys,'/','Error rate/S-function'],...
		'function name','sbiterr',...
		'parameters','num_lin, K, TDelay, Sample',...
		'position',[130,52,195,78])

add_block('built-in/Mux',[sys,'/','Error rate/Mux'])
set_param([sys,'/','Error rate/Mux'],...
		'inputs','2',...
		'position',[65,46,100,79])

add_block('built-in/Inport',[sys,'/','Error rate/in_1'])
set_param([sys,'/','Error rate/in_1'],...
		'position',[15,45,35,65])

add_block('built-in/Inport',[sys,'/','Error rate/in_2'])
set_param([sys,'/','Error rate/in_2'],...
		'Port','2',...
		'position',[15,60,35,80])
add_line([sys,'/','Error rate'],[105,65;125,65])
add_line([sys,'/','Error rate'],[40,55;60,55])
add_line([sys,'/','Error rate'],[40,70;60,70])
set_param([sys,'/','Error rate'],...
		'Mask Display','Error\nmeter',...
		'Mask Type','Symbol/bit error counter')
set_param([sys,'/','Error rate'],...
		'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 rate'],...
		'Mask Translate','K=@1;num_lin=@2;TDelay=@3;Sample=@4;')
set_param([sys,'/','Error rate'],...
		'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 rate'],...
		'Mask Entries','ceil(log10(M)/log10(2))\/0\/td*4\/td\/')


%     Finished composite block 'Error rate'.

set_param([sys,'/','Error rate'],...
		'hide name',0,...
		'position',[745,23,825,67])

add_block('built-in/Mux',[sys,'/','Mux'])
set_param([sys,'/','Mux'],...
		'hide name',0,...
		'inputs','2',...
		'position',[635,136,670,169])


%     Subsystem  ['K-step',13,'delay1'].

new_system([sys,'/',['K-step',13,'delay1']])
set_param([sys,'/',['K-step',13,'delay1']],'Location',[12,432,357,702])

add_block('built-in/Digital Clock',[sys,'/',['K-step',13,'delay1/Digital Clock']])
set_param([sys,'/',['K-step',13,'delay1/Digital Clock']],...
		'Sample time','ts',...
		'position',[60,140,95,170])

add_block('built-in/Inport',[sys,'/',['K-step',13,'delay1/in_1']])
set_param([sys,'/',['K-step',13,'delay1/in_1']],...
		'position',[20,80,40,100])

add_block('built-in/Outport',[sys,'/',['K-step',13,'delay1/out_1']])
set_param([sys,'/',['K-step',13,'delay1/out_1']],...
		'position',[325,120,345,140])

add_block('built-in/Filter',[sys,'/',['K-step',13,'delay1/K-step',13,'delay']])
set_param([sys,'/',['K-step',13,'delay1/K-step',13,'delay']],...
		'Numerator','[zeros(1,n), 1]',...
		'Denominator','1',...
		'Sample time','ts',...
		'position',[60,70,185,110])

add_block('built-in/Switch',[sys,'/',['K-step',13,'delay1/Switch']])
set_param([sys,'/',['K-step',13,'delay1/Switch']],...
		'Threshold','.1',...
		'position',[270,114,295,146])

add_block('built-in/Constant',[sys,'/',['K-step',13,'delay1/Constant']])
set_param([sys,'/',['K-step',13,'delay1/Constant']],...
		'Value','ini',...
		'position',[120,230,140,250])

add_block('built-in/Constant',[sys,'/',['K-step',13,'delay1/Constant1']])
set_param([sys,'/',['K-step',13,'delay1/Constant1']],...
		'Value','n*ts(1)+ts(2)',...
		'position',[15,194,100,216])

add_block('built-in/Relational Operator',[sys,'/',['K-step',13,'delay1/Relational',13,'Operator']])
set_param([sys,'/',['K-step',13,'delay1/Relational',13,'Operator']],...
		'position',[150,168,180,192])
add_line([sys,'/',['K-step',13,'delay1']],[300,130;320,130])
add_line([sys,'/',['K-step',13,'delay1']],[45,90;55,90])
add_line([sys,'/',['K-step',13,'delay1']],[190,90;195,90;195,120;265,120])
add_line([sys,'/',['K-step',13,'delay1']],[145,240;240,240;240,140;265,140])
add_line([sys,'/',['K-step',13,'delay1']],[100,155;115,155;115,175;145,175])
add_line([sys,'/',['K-step',13,'delay1']],[105,205;115,205;115,185;145,185])
add_line([sys,'/',['K-step',13,'delay1']],[185,180;220,180;220,130;265,130])
set_param([sys,'/',['K-step',13,'delay1']],...
		'Mask Display','    -k\nz   ',...
		'Mask Type','Multi-step delay',...
		'Mask Dialogue','Output is K-step delay of the input signal.|Delay steps (integer):|Sample time (sec):|Initial output:')
set_param([sys,'/',['K-step',13,'delay1']],...
		'Mask Translate','n=@1;ts=@2;if length(ts)<2, ts=[ts 0];end;ini=@3;')
set_param([sys,'/',['K-step',13,'delay1']],...
		'Mask Help','This block holds the input signal for K steps and then outputs the signal. The delay step cannot be changed during the simulation.',...
		'Mask Entries','ceil(td/ts/4)\/ts\/NaN\/')


%     Finished composite block ['K-step',13,'delay1'].

set_param([sys,'/',['K-step',13,'delay1']],...
		'hide name',0,...
		'position',[360,153,440,197])


%     Subsystem  ['Rayleigh noise',13,'channel CE'].

new_system([sys,'/',['Rayleigh noise',13,'channel CE']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE']],'Location',[496,318,758,464])

add_block('built-in/Inport',[sys,'/',['Rayleigh noise',13,'channel CE/in_1']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/in_1']],...
		'pos

⌨️ 快捷键说明

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