📄 testtv_demodmapper.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: testTV_DemodMapper.m.rca $
% Tag $Name: $
% $Revision: 1.1 $
% $Date: Mon Oct 30 17:52:02 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%-- This function test the generation of random TV from DemodMapper
%
% function test_DemodMapper(seed)
%
% input:
% seed : (double), random seed
%
% Note: for a good use of mGenBin, make sure your files are not "read only"
%-- Matlab files used by this file
% mDemodMapper
%-- End of list
function testTV_DemodMapper(seed)
if (exist('seed','var') == 0)
seed = sum(100*clock);
end
rand('state',seed);
warning off
testTV_DemodMapperModeType(2,seed);
testTV_DemodMapperModeType(4,seed);
testTV_DemodMapperModeType(6,seed);
warning n
function testTV_DemodMapperModeType(ModeType,seed)
clear global
clear functions
close all
profile off
addpath('../');
addpath('../../../../../../../SP/CM/matlab');
if (ModeType == 2)
modename = 'QPSK';
end
if (ModeType == 4)
modename = '16QAM';
end
if (ModeType == 6)
modename = '64QAM';
end
dataSize = 48;
fname = 'DemodMapper';
Q = 15;
if (exist('seed','var') == 0)
seed = sum(100*clock);
end
rand('state',seed);
system(['del ..\..\vector\log\TCRND',modename,'\',fname,'.txt']);
diary(['../../vector/log/TCRND',modename,'/',fname,'.txt']);
disp('DemodMapper Simulation');
disp('=====================================');
disp(' ');
%%%%%%%%%%%%%%%%%%%%%% Initialize Paramters %%%%%%%%%%%%%%%%%%%%%%%%%%%
disp('*********Initializing Parameters*********')
disp(strcat('SEED = ',num2str(seed)));
disp(strcat('MODE = ',num2str(ModeType)));
% generates pilot random data , include the 4/3 Pilot boosting
InReal = round((2^(Q+1)-1).*rand(dataSize,1)-2^Q);
InImag = round((2^(Q+1)-1).*rand(dataSize,1)-2^Q);
In_fixed = int16(InReal + InImag*i);
[Out_fixed BlkSize]= mDemodMapper(In_fixed,length(In_fixed),ModeType,'y');
Out_fixed = int8(Out_fixed);
mGenBin(In_fixed,['../../vector/in/TCRND',modename,'/IF2aaRX.lod'],'int16','1R1I','b');
mGenBin(Out_fixed,['../../vector/ref/TCRND',modename,'/IF2RX.lod'],'int8','R','b');
mGenHeader(In_fixed,['../../vector/in/TCRND',modename,'/IF2aaRX.h'],'int16','short int gasiIn');
mGenHeader(Out_fixed,['../../vector/ref/TCRND',modename,'/IF2RX.h'],'int8','signed char gacRefOut','R');
diary off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -