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

📄 tcemqas2.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 4 页
字号:
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],[45,90;65,90;65,70;85,70])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],[195,65;210,65])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],[45,35;65,35;65,55;85,55])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],[125,65;135,65])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],...
		'Mask Display','plot(-10,-10,110,110,[90,50,10],[90,40,30],[90,50,10],[50,26,20],[90,50,10],[22,13,10])',...
		'Mask Type','2-D Table Lookup')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],...
		'Mask Dialogue','Two Dimensional Table Lookup\nThe first input corresponds to X Index and the second input corresponds to the Y Index|X Index|Y Index|Table')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],...
		'Mask Translate','xindex=@1; yindex=@2; table=@3; sftab2chk(xindex,yindex,table);')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],...
		'Mask Help','This block returns a linearly interpolated intersection from the table using the X index (which corresponds to the rows of the table) and the Y index (which corresponds to the columns of the table).  Extrapolation is used.')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],...
		'Mask Entries','x\/y\/tab\/')


%     Finished composite block ['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table'].

set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table']],...
		'position',[515,68,545,92])

add_block('built-in/Sum',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum3']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum3']],...
		'ForeGround',2,...
		'inputs','+-',...
		'position',[580,73,600,102])

add_block('built-in/Saturation',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Saturation']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Saturation']],...
		'Lower Limit','0',...
		'Upper Limit','N-1',...
		'position',[630,78,660,102])

add_block('built-in/Outport',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/out_1']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/out_1']],...
		'position',[685,80,705,100])

add_block('built-in/Sum',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum4']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum4']],...
		'ForeGround',2,...
		'position',[470,58,490,87])

add_block('built-in/Sum',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum1']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum1']],...
		'ForeGround',2,...
		'inputs','+-',...
		'position',[280,33,300,62])

add_block('built-in/Sum',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum2']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Sum2']],...
		'ForeGround',2,...
		'inputs','+-',...
		'position',[290,158,310,187])

add_block('built-in/S-Function',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Minimum']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Minimum']],...
		'function name','arymimai',...
		'parameters','''min''',...
		'position',[385,165,450,185])

add_block('built-in/Constant',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Shift key']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Shift key']],...
		'Value','sfty',...
		'position',[225,214,250,236])

add_block('built-in/S-Function',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Minimum1']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Minimum1']],...
		'function name','arymimai',...
		'parameters','''min''',...
		'position',[385,40,445,60])

add_block('built-in/Constant',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Shift key1']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Shift key1']],...
		'Value','sftx',...
		'position',[220,89,245,111])

add_block('built-in/Constant',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Shift key2']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Shift key2']],...
		'BackGround',5,...
		'position',[325,114,350,136])

add_block('built-in/Abs',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Abs1']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Abs1']],...
		'position',[325,38,355,62])

add_block('built-in/Abs',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Abs']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/Abs']],...
		'position',[325,163,355,187])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[85,40;130,40])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[360,175;380,175])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[315,175;320,175])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[255,225;260,225;260,180;285,180])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[250,100;255,100;255,55;275,55])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[305,50;320,50])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[360,50;380,50])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[665,90;680,90])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[550,80;575,80])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[605,90;625,90])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[450,50;450,65;465,65])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[455,175;465,175])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[495,170;500,170;510,85])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[355,125;560,125;560,95;575,95])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[450,125;450,160;465,160])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[450,125;450,80;465,80])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[495,75;510,75])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[85,165;130,165])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[175,165;285,165])
add_line([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],[175,40;275,40])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],...
		'Mask Display','QASK\nS-demap',...
		'Mask Type','QASK S-demap')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],...
		'Mask Dialogue','Reverse the QASK map. Input in-phase\nand quadrature components from the\ntwo inputs. Output demapped signal.|QASK M-ary number (outputs are in range [0, M-1]):|Output symbol interval and offset (sec):')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],...
		'Mask Translate','N=@1;td=@2;Ac=1;sftx=[1 -1 3 -3 5 -5 7 -7 9 -9 11 -11 13 -13 15 -15];sftx=sftx(1:2*ceil(sqrt(N)/2));sfty=sftx;if N==8,sfty=sfty(1:2);end;sftx=sftx/max(sftx)*Ac;sfty=sfty/max(sfty)*Ac;tab=qaskdeco(length(sftx),length(sfty),''fetch'')+1;x=[1:length(sftx)];y=[1:length(sfty)];')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],...
		'Mask Help','This block demaps a QASK mapped signal using square constellation. You can place this block after a QAM demodulation block. This block assumes the maximum amplitude of the input signals is 1. The output symbols are integers in the range [0, M-1]. The input symbol interval can be a two-element vector with the second element being offset. The default value offset is 0.')
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],...
		'Mask Entries','M\/td\/')


%     Finished composite block ['S-map QASK',13,'demod baseband/QASK',13,'square-demap'].

set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],...
		'hide name',0,...
		'position',[205,28,285,72])
add_line([sys,'/',['S-map QASK',13,'demod baseband']],[65,50;85,50])
add_line([sys,'/',['S-map QASK',13,'demod baseband']],[290,50;315,50])
add_line([sys,'/',['S-map QASK',13,'demod baseband']],[175,60;200,60])
add_line([sys,'/',['S-map QASK',13,'demod baseband']],[175,40;200,40])
set_param([sys,'/',['S-map QASK',13,'demod baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);S-QASK',...
		'Mask Type','Baseband S-QASK demodulation')
set_param([sys,'/',['S-map QASK',13,'demod baseband']],...
		'Mask Dialogue','Demodulate the complex envelope of a QASK modulated signal.  This block uses a fixed square constellation with M-ary number M=2^K, where K is an integer.|M-ary number (integer in range [0 M-1]):|Symbol interval and offset (sec):|Lowpass filter numerator:|Lowpass filter denominator:|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['S-map QASK',13,'demod baseband']],...
		'Mask Translate','M=@1;td=@2;num=@3;den=@4;Ph=@5;ts=@6;[x,y]=moduicon(6);[u,v]=cmplxicn(0,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['S-map QASK',13,'demod baseband']],...
		'Mask Help','This block demodulates a QASK modulated signal using square constellation. The output signals are digits in the range [0, M-1], where M is the M-ary number, M=2^K, K is an integer. When the symbol interval is a two-element vector, the second element is the offset (default 0). ')
set_param([sys,'/',['S-map QASK',13,'demod baseband']],...
		'Mask Entries','M\/[td, td-ts]\/num\/den\/0\/ts\/')


%     Finished composite block ['S-map QASK',13,'demod baseband'].

set_param([sys,'/',['S-map QASK',13,'demod baseband']],...
		'hide name',0,...
		'position',[370,53,450,97])


%     Subsystem  ['ASK Mo//Dem',13,'demo1'].

new_system([sys,'/',['ASK Mo//Dem',13,'demo1']])
set_param([sys,'/',['ASK Mo//Dem',13,'demo1']],'Location',[175,552,335,697])
set_param([sys,'/',['ASK Mo//Dem',13,'demo1']],...
		'Mask Display','View\nconstellation',...
		'Mask Dialogue','eval(''modmap(''''qask'''',M)'')')


%     Finished composite block ['ASK Mo//Dem',13,'demo1'].

set_param([sys,'/',['ASK Mo//Dem',13,'demo1']],...
		'BackGround',7,...
		'hide name',0,...
		'position',[490,108,570,152])


%     Subsystem  ['Uniform noise',13,'generator'].

new_system([sys,'/',['Uniform noise',13,'generator']])
set_param([sys,'/',['Uniform noise',13,'generator']],'Location',[420,594,637,734])

add_block('built-in/Outport',[sys,'/',['Uniform noise',13,'generator/out_1']])
set_param([sys,'/',['Uniform noise',13,'generator/out_1']],...
		'position',[165,65,185,85])

add_block('built-in/S-Function',[sys,'/',['Uniform noise',13,'generator/Uniform',13,'noise']])
set_param([sys,'/',['Uniform noise',13,'generator/Uniform',13,'noise']],...
		'function name','surandom',...
		'parameters','seed,up,low',...
		'position',[65,55,135,95])
add_line([sys,'/',['Uniform noise',13,'generator']],[140,75;160,75])
set_param([sys,'/',['Uniform noise',13,'generator']],...
		'Mask Display','plot(0,0,100,100,x,y);Uniform',...
		'Mask Type','Uniform noise generator')
set_param([sys,'/',['Uniform noise',13,'generator']],...
		'Mask Dialogue','Generate uniformly distributed noise\nbetween the upper and lower bounds.|Noise lower bound:|Noise upper bound:|Seed:')
set_param([sys,'/',['Uniform noise',13,'generator']],...
		'Mask Translate','seed=@3;up=@2;low=@1;[x,y]=srcsicon(3);')
set_param([sys,'/',['Uniform noise',13,'generator']],...
		'Mask Help','This block generates a uniformly distributed noise between the given lower and upper bounds. The output size is the same as the vector length of the seed. The upper bound and lower bound can be scalar or vectors with their lengths the same as the length for the seed. The vector length of upper bound must be the same as length of lower bound.')
set_param([sys,'/',['Uniform noise',13,'generator']],...
		'Mask Entries','0\/.6\/21354\/')


%     Finished composite block ['Uniform noise',13,'generator'].

set_param([sys,'/',['Uniform noise',13,'generator']],...
		'hide name',0,...
		'position',[130,103,210,147])
add_line(sys,[345,75;365,75])
add_line(sys,[230,65;255,65])
add_line(sys,[455,75;485,75])
add_line(sys,[105,65;140,65])
add_line(sys,[115,65;115,20;465,20;465,55;485,55])
add_line(sys,[215,125;230,125;230,85;255,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 + -