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

📄 source.m

📁 MIMO and VBLAST( please see the documentation)
💻 M
字号:
function data = source(fr_length,frames,md,zf,mode,varargin)%SOURCE Generate source data.%   DATA = SOURCE(FR_LENGTH,FRAMES,MD,ZF,MODE) creates data%   source of desired number of FRAMES each consists of %   FR_LENGTH symbols. MD determines the range of integers (data)%   the frame will be filled with. For instance of MD = 4 and random%   MODE the DATA will contain numbers within a set {0,1,2,3}.%   ZF corresponds to the length of zeros that will be appended%   at the end of each frame. This ensures the encoder will be%   forced into the zero state at the beginning and end of each frame.%   An optional source pattern may be specified via MODE variable.%   Possible values for MODE are 'Random'|'Ramp'|'Const'. When the%   option 'Const' is chosen than MODE must be followed with desired%   value. This corresponds to the frame with constant codeword.%%   DATA = SOURCE(...,'EchoOn') toggles internal function echo on.%%   See also SPACE.%   Copyright 2001-2002 Kamil Anis, anisk@feld.cvut.cz%   Dept. of Radioelectronics, %   Faculty of Electrical Engineering%   Czech Technical University in Pragu%   $Revision: 2.0 $  $Date: 2002/10/23 17:33:28 $%   --%   <additional stuff should go here>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BODY BEGIN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%switch modecase 'Random'	data = round((md - 1) * rand(fr_length,1,frames));case 'Ramp'	ramp = mod([1:fr_length] - 1,md)';	data = repmat(ramp,[1 1 frames]);case 'Const'	data = varargin{1} * ones(fr_length,1,frames);end% zero forcing appendix[m,n,o] = size(data);n = m + 1:m + zf;data(n,:,1:o) = 0;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BODY END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if (isempty(varargin) == 0) & (varargin{end} == 'EchoOn')	[indent,gap,name] = iprompt('SOURCE:');	str1 = num2str(frames);	str2 = num2str(fr_length);	str3 = num2str(zf);		disp(' ');	disp([name,gap,mode,' data -> ',str1,' frame(s) by ',str2,...    ' symbols; ',str3,' zeros appended.']);	disp(' ');end

⌨️ 快捷键说明

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