modul.m

来自「《空时码及MIMO通信的信号处理过程》书中的源程序代码」· M 代码 · 共 39 行

M
39
字号
function sig_modul = modul(data,md,sim_options)

%**************************************************************************
%MODUL Multidimensional digital modulator
%   S = MODUL(Q,MD,'PropertyName',PropertyValue,...) performs linear
%   memoryless digital modulation of channel symbols.MD corresponds to the
%   number of constellation signals. Possible values for MD are 4|8|16 
%   which corresponds to 4PSK, 8PASK and 16QAM constellations
%   respectively.
%**************************************************************************


% 16QAM definition
load qam16.txt;
[frame_length,space_dim,frames]=size(data);

for k = 1:frames
	switch md
	case 16         % 16QAM
		for l = 1:space_dim
		k1(:,l) = qam16(data(:,l,k) + 1,1);
		k2(:,l) = qam16(data(:,l,k) + 1,2);
		end
		if sim_options.Channel_Est==1
		    q(:,:,k) =( (2 * k1 - md - 1) - i * (2 * k2 - md - 1));
        else
  		    q(:,:,k) = ((2 * k1 - md - 1) - i * (2 * k2 - md - 1));
        end      
		
	otherwise
		    expr = 2 * pi * i / md;
		    q(:,:,k) = exp(expr * data(:,:,k));
	end
	
    sig_modul=q;
	
end

⌨️ 快捷键说明

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