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

📄 tcemqask.m

📁 数字通信第四版原书的例程
💻 M
📖 第 1 页 / 共 4 页
字号:

add_block('built-in/Product',[sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband/Product']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband/Product']],...
		'position',[300,33,330,57])

add_block('built-in/Note',[sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband/R1']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband/R1']],...
		'position',[190,15,195,20])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[410,220;425,220;425,150;465,150])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[400,70;425,70;425,130;465,130])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[335,45;345,45;345,65;370,65])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[335,105;345,105;345,75;370,75])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[120,40;295,40])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[238,40;238,190;305,190])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[105,155;270,155;270,50;295,50])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[270,155;270,235;305,235])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[155,175;280,175;280,110;295,110])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[280,175;280,200;305,200])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[160,65;245,65;245,100;295,100])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[250,100;250,245;305,245])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[345,195;355,195;355,215;380,215])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[345,240;355,240;355,225;380,225])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],[550,140;580,140])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);QAM',...
		'Mask Type','QM DSB-SC AM CE')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],...
		'Mask Dialogue','Modulate the in-phase and quadrature\ncomponent signal from the 1st and 2nd\ninput ports, baseband simulation.|Initial phase (rad):')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],...
		'Mask Translate','Ph=@1;x1=cos(Ph);x2=sin(Ph);[x,y]=moduicon(1);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],...
		'Mask Help','This block outputs the complex envelope of the quadratic multiplexed double-sideband suppressed-carrier amplitude modulated signal. The 1st and 2nd input ports input the in-phase and quadrature components. The output is a complex signal.')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],...
		'Mask Entries','Ph\/')


%     Finished composite block ['S-map QASK',13,'mod baseband/QAM',13,'baseband'].

set_param([sys,'/',['S-map QASK',13,'mod baseband/QAM',13,'baseband']],...
		'ForeGround',4,...
		'hide name',0,...
		'position',[165,53,245,97])


%     Subsystem  ['S-map QASK',13,'mod baseband/QASK',13,'square-map'].

new_system([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],'Location',[214,372,642,541])

add_block('built-in/Inport',[sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/in_1']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/in_1']],...
		'position',[45,30,65,50])

add_block('built-in/Zero-Order Hold',[sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/Zero-Order',13,'Hold']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/Zero-Order',13,'Hold']],...
		'Sample time','td',...
		'position',[110,24,145,56])

add_block('built-in/Outport',[sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/out_1']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/out_1']],...
		'position',[325,30,345,50])

add_block('built-in/Look Up Table',[sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/s-x axis']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/s-x axis']],...
		'Input_Values','z',...
		'Output_Values','x',...
		'position',[245,25,280,55])

add_block('built-in/Outport',[sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/out_2']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/out_2']],...
		'Port','2',...
		'position',[325,95,345,115])

add_block('built-in/Look Up Table',[sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/c-y axis']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map/c-y axis']],...
		'Input_Values','z',...
		'Output_Values','y',...
		'position',[245,90,280,120])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],[285,40;320,40])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],[285,105;320,105])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],[150,40;240,40])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],[185,40;185,105;240,105])
add_line([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],[70,40;105,40])
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],...
		'Mask Display','QASK\nS-map',...
		'Mask Type','QASK S-map')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],...
		'Mask Dialogue','Use square constellation to map the\ninput digital signal into in-phase and\nquadrature components. M must be\nM=2^K with integer K.|M-ary number (input integers in range [0, M-1]):|Input symbol interval and offset (sec):')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],...
		'Mask Translate','N=@1;Ac=1;td=@2;z=[[1:N];[1:N]];z=z(:);[x,y]=qaskenco(z-1,N);z=z-1.5;z=[z(2:2*N);N-.5];x=x/max(x);y=y/max(y);')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-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 M-ary number must be M=2^K with integer K. The input symbol interval can be a two-element vector with the second element being offset. The default value offset is 0. The maximum amplitudes for the outputs are 1.')
set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],...
		'Mask Entries','M\/td\/')


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

set_param([sys,'/',['S-map QASK',13,'mod baseband/QASK',13,'square-map']],...
		'hide name',0,...
		'position',[50,53,130,97])

add_block('built-in/Outport',[sys,'/',['S-map QASK',13,'mod baseband/out_1']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/out_1']],...
		'position',[275,65,295,85])

add_block('built-in/Inport',[sys,'/',['S-map QASK',13,'mod baseband/in_1']])
set_param([sys,'/',['S-map QASK',13,'mod baseband/in_1']],...
		'position',[5,65,20,85])
add_line([sys,'/',['S-map QASK',13,'mod baseband']],[135,65;160,65])
add_line([sys,'/',['S-map QASK',13,'mod baseband']],[135,85;160,85])
add_line([sys,'/',['S-map QASK',13,'mod baseband']],[250,75;270,75])
add_line([sys,'/',['S-map QASK',13,'mod baseband']],[25,75;45,75])
set_param([sys,'/',['S-map QASK',13,'mod baseband']],...
		'Mask Display','plot(0,0,100,100,x,y,u,v);S-QASK',...
		'Mask Type','Baseband S-QASK modulation')
set_param([sys,'/',['S-map QASK',13,'mod baseband']],...
		'Mask Dialogue','Output the complex envelope of the QASK\nmodulated signal. This block uses a square\nconstellation with M-ary number M=2^K,\nK is an integer.|M-ary number (input digits in range [0, M-1]):|Symbol interval and offset (sec):|Initial phase (rad):|Sample time (sec):')
set_param([sys,'/',['S-map QASK',13,'mod baseband']],...
		'Mask Translate','M=@1;td=@2;Ph=@3;ts=@4;[x,y]=moduicon(5);[u,v]=cmplxicn(1,50,get_param(gcb,''orientation''));')
set_param([sys,'/',['S-map QASK',13,'mod baseband']],...
		'Mask Help','This block outputs the complex envelope of a QASK modulated signal. This block uses square constellation. The inputs are integers in the range [0, M-1], where M is the M-ary number, M=2^K, and 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,'mod baseband']],...
		'Mask Entries','M\/td\/0\/ts\/')


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

set_param([sys,'/',['S-map QASK',13,'mod baseband']],...
		'hide name',0,...
		'position',[140,38,220,82])


%     Subsystem  ['S-map QASK',13,'demod baseband'].

new_system([sys,'/',['S-map QASK',13,'demod baseband']])
set_param([sys,'/',['S-map QASK',13,'demod baseband']],'Location',[33,553,383,660])


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

new_system([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap']],'Location',[57,374,831,674])

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_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/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/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/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 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/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/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/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/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/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/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/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])


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

new_system([sys,'/',['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']],'Location',[436,148,718,302])

add_block('built-in/Mux',[sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table/Mux']])
set_param([sys,'/',['S-map QASK',13,'demod baseband/QASK',13,'square-demap/2-D Table/Mux']],...

⌨️ 快捷键说明

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