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

📄 tstam2ce.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 4 页
字号:
		'ForeGround',4,...
		'position',[90,23,170,67])


%     Subsystem  ['MASK demod',13,'baseband/MASK demap'].

new_system([sys,'/',['MASK demod',13,'baseband/MASK demap']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],'Location',[187,342,628,482])

add_block('built-in/Zero-Order Hold',[sys,'/',['MASK demod',13,'baseband/MASK demap/Zero-Order',13,'Hold']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/Zero-Order',13,'Hold']],...
		'Sample time','td',...
		'position',[85,29,120,61])

add_block('built-in/Constant',[sys,'/',['MASK demod',13,'baseband/MASK demap/Shift key']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/Shift key']],...
		'Value','sft',...
		'position',[115,93,135,117])

add_block('built-in/Sum',[sys,'/',['MASK demod',13,'baseband/MASK demap/Sum2']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/Sum2']],...
		'inputs','+-',...
		'position',[180,38,200,67])

add_block('built-in/Abs',[sys,'/',['MASK demod',13,'baseband/MASK demap/Abs']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/Abs']],...
		'position',[235,42,270,68])

add_block('built-in/Outport',[sys,'/',['MASK demod',13,'baseband/MASK demap/out_1']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/out_1']],...
		'position',[400,45,420,65])

add_block('built-in/S-Function',[sys,'/',['MASK demod',13,'baseband/MASK demap/Minimum']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/Minimum']],...
		'function name','arymimai',...
		'parameters','''min''',...
		'position',[315,45,370,65])

add_block('built-in/Inport',[sys,'/',['MASK demod',13,'baseband/MASK demap/in_1']])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap/in_1']],...
		'position',[30,35,50,55])
add_line([sys,'/',['MASK demod',13,'baseband/MASK demap']],[55,45;80,45])
add_line([sys,'/',['MASK demod',13,'baseband/MASK demap']],[275,55;310,55])
add_line([sys,'/',['MASK demod',13,'baseband/MASK demap']],[125,45;175,45])
add_line([sys,'/',['MASK demod',13,'baseband/MASK demap']],[375,55;395,55])
add_line([sys,'/',['MASK demod',13,'baseband/MASK demap']],[140,105;155,105;155,60;175,60])
add_line([sys,'/',['MASK demod',13,'baseband/MASK demap']],[205,55;230,55])
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],...
		'Mask Display','MASK\ndemap',...
		'Mask Type','MASK demap')
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],...
		'Mask Dialogue','Reverse the MASK mapping process\nConvert [-1 1] analog signal to [0, M-1] symbols.|M-ary number (digit integers in ranger [0, M-1]):|Output symbol interval and offset (sec):')
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],...
		'Mask Translate','N=@1;Ac=1;sft=[0:N-1]*Ac*2/(N-1)-Ac;td=@2;')
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],...
		'Mask Help','This block demaps a MASK mapped signal back to digit symbols. You can place this block after a amplitude demodulation block. The input of this block is an analog signal in the range [-1, 1]. The demodulation decides the closest integer fitting in [0,M-1] range. When the input symbol interval is a two-elements vector, the second element is offset. The default offset value is 0.')
set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],...
		'Mask Entries','N\/td\/')


%     Finished composite block ['MASK demod',13,'baseband/MASK demap'].

set_param([sys,'/',['MASK demod',13,'baseband/MASK demap']],...
		'position',[215,23,295,67])

add_block('built-in/Outport',[sys,'/',['MASK demod',13,'baseband/out_1']])
set_param([sys,'/',['MASK demod',13,'baseband/out_1']],...
		'position',[330,35,350,55])

add_block('built-in/Inport',[sys,'/',['MASK demod',13,'baseband/in_1']])
set_param([sys,'/',['MASK demod',13,'baseband/in_1']],...
		'position',[15,35,35,55])
add_line([sys,'/',['MASK demod',13,'baseband']],[175,45;210,45])
add_line([sys,'/',['MASK demod',13,'baseband']],[300,45;325,45])
add_line([sys,'/',['MASK demod',13,'baseband']],[40,45;85,45])
set_param([sys,'/',['MASK demod',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);MASK',...
		'Mask Type','Baseband MASK demodulation')
set_param([sys,'/',['MASK demod',13,'baseband']],...
		'Mask Dialogue','Demodulate the complex envelope of a\nMASK modulated signal.|M-ary number (output integer in range [0, M-1]):|Output symbol interval and offset (sec):|Initial phase (rad):|Lowpass filter numerator:|Lowpass filter denominator:|Filter sample time (sec):')
set_param([sys,'/',['MASK demod',13,'baseband']],...
		'Mask Translate','N=@1;td=@2;Ph=@3;num=@4;den=@5;ts=@6;[x,y]=moduicon(6);[u,v]=cmplxicn(0,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['MASK demod',13,'baseband']],...
		'Mask Help','This block demodulates the complex envelope of a MASK modulated signal. The output signal are digits in the range [0, M-1]. When the output symbol interval is a two-element vector, the second element is the offset (default 0). A lowpass filter is required in the demodulation. You can set both numerator and denominator to one for not using the lowpass filter.')
set_param([sys,'/',['MASK demod',13,'baseband']],...
		'Mask Entries','M\/[td, td-ts]\/0\/num\/den\/ts\/')


%     Finished composite block ['MASK demod',13,'baseband'].

set_param([sys,'/',['MASK demod',13,'baseband']],...
		'hide name',0,...
		'position',[350,63,430,107])


%     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']],...
		'position',[45,10,65,30])


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

new_system([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],'Location',[73,221,421,374])

add_block('built-in/White Noise',[sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Random',13,'Number']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Random',13,'Number']],...
		'Seed','s',...
		'position',[35,72,80,108])

add_block('built-in/State-Space',[sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Matrix',13,'Gain']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Matrix',13,'Gain']],...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','K',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Matrix',13,'Gain']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;')
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Matrix',13,'Gain']],...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','d\/')
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Matrix',13,'Gain']],...
		'position',[130,76,155,104])

add_block('built-in/Constant',[sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Constant']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Constant']],...
		'Value','m',...
		'position',[155,35,175,55])

add_block('built-in/Sum',[sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Sum']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/Sum']],...
		'position',[240,75,260,95])

add_block('built-in/Outport',[sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/out_1']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise/out_1']],...
		'position',[295,75,315,95])
add_line([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],[180,45;210,45;210,80;235,80])
add_line([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],[85,90;125,90])
add_line([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],[160,90;235,90])
add_line([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],[265,85;290,85])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],...
		'Mask Display','Gaussian\nnoise',...
		'Mask Type','Gaussian noise.')
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],...
		'Mask Dialogue','Gaussian distribution noise.|Mean value:|Standard deviation:|Initial Seed(s):',...
		'Mask Translate','m=@1;d=@2;s=@3;[m,d,s]=gwnoise(m,d,s);')
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],...
		'Mask Help','When the mean value, seed are vectors, the output of this block is a vector with the length of the vector same as the length of mean value vector or that of the seed.')
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],...
		'Mask Entries','m\/d\/s\/')


%     Finished composite block ['Rayleigh noise',13,'channel CE/Gaussian',13,'noise'].

set_param([sys,'/',['Rayleigh noise',13,'channel CE/Gaussian',13,'noise']],...
		'position',[10,50,85,90])

add_block('built-in/Outport',[sys,'/',['Rayleigh noise',13,'channel CE/out_1']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/out_1']],...
		'position',[200,55,220,75])

add_block('built-in/Sum',[sys,'/',['Rayleigh noise',13,'channel CE/Sum']])
set_param([sys,'/',['Rayleigh noise',13,'channel CE/Sum']],...
		'position',[150,55,170,75])
add_line([sys,'/',['Rayleigh noise',13,'channel CE']],[175,65;195,65])
add_line([sys,'/',['Rayleigh noise',13,'channel CE']],[70,20;115,20;115,60;145,60])
add_line([sys,'/',['Rayleigh noise',13,'channel CE']],[90,70;145,70])
set_param([sys,'/',['Rayleigh noise',13,'channel CE']],...
		'Mask Display','plot(0,0,100,100,x,y,v,w,u,z);Rayl N',...
		'Mask Type','Rayleigh noise channel, fixed parameter')
set_param([sys,'/',['Rayleigh noise',13,'channel CE']],...
		'Mask Dialogue','Additive Rayleigh noise channel for\nbaseband signal simulation. Input\nand output signals are complex.|sigma:|Seeds (1x2 vector):')
set_param([sys,'/',['Rayleigh noise',13,'channel CE']],...
		'Mask Translate','m=0;d=@1;d=d^2;s=@2;if length(s)<2,s=[s s+s];end;[x,y]=chanicon;[v,w]=cmplxicn(0,50,get_param(gcb,''orientation''));[u,z]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['Rayleigh noise',13,'channel CE']],...
		'Mask Help','This block adds Rayleigh noise to the transmitting signal. The input and output of this block are complex data. The Rayleigh noise is composed by two independant zero mean Gaussian noise. These two Gaussian components have the same standard deviation sigma.')
set_param([sys,'/',['Rayleigh noise',13,'channel CE']],...
		'Mask Entries','.1\/[12345 54321]\/')


%     Finished composite block ['Rayleigh noise',13,'channel CE'].

set_param([sys,'/',['Rayleigh noise',13,'channel CE']],...
		'hide name',0,...
		'position',[250,63,330,107])
add_line(sys,[105,85;140,85])
add_line(sys,[435,85;480,85])
add_line(sys,[120,85;120,40;440,40;440,65;480,65])
add_line(sys,[230,85;245,85])
add_line(sys,[335,85;345,85])

drawnow

% Return any arguments.
if (nargin | nargout)
	% Must use feval here to access system in memory
	if (nargin > 3)
		if (flag == 0)
			eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
		else
			eval(['ret =', sys,'(t,x,u,flag);'])
		end
	else
		[ret,x0,str,ts,xts] = feval(sys);
	end
else
	drawnow % Flash up the model and execute load callback
end

⌨️ 快捷键说明

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