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

📄 mslotextraction.m

📁 OFDMA 物理层开发的matlab 源码.飞思卡尔提供.对物理层开发的工程师有帮助!
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Property of Freescale
%  Freescale Confidential Proprietary
%  Freescale Copyright (C) 2005 All rights reserved
%  ----------------------------------------------------------------------------
%  $RCSfile: mSlotExtraction.m.rca $
%  $Revision: 1.4 $
%  $Date: Fri Dec  8 15:15:32 2006 $
%  Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Maximum Ratio Combination of IEEE 802.16-2005 (WiMAX, OFDMA only)
%
%           [Data,Pilot]= mSlotExtraction(NFFTUsed,SlotVecIndex,...
%                         Symbol,SubChTileLocationLUT,PNCodeLUT)
%
% Input:
%       NFFTUsed             -- Number of FFT carriersused
%       SlotVecIndex         -- Slot Vector Index
%       Symbol               -- Data : Real0,Imag0,Real1,Imag1,..
%       SubChTileLocationLUT -- Sub Channel Tile Location
%       PNCodeLUT            -- PN Code
% Output:
%       Data       -- Output Data
%       Pilot      -- Output Pilot
% Remark:
%
% Matlab 7 Release 14 SP2

%-- Matlab files used by this file
%-- End of list

% Some adjustements have been done for speed consideration.

function [Data,Pilot]= mSlotExtraction(NFFTUsed,SlotVecIndex,Symbol,SubChTileLocationLUT,PNCodeLUT)

FPULNTILE = 6;
FPULNSYMBOLPERSLOT = 3;

UNITVAL = 1/2^15;

Pilot1Index = 1;
Pilot2Index = 1;
DataIndex = 1;
%preallocation Data for speed increase
Data = zeros(1,48);


% Extract data and pilots from OFDMA symbol of slot vector
% Loop over FPULNTILE tiles
for SymbolNum=1:FPULNSYMBOLPERSLOT
    PnCodeOffset = bitand(((SlotVecIndex*3) + SymbolNum - 1),31);
    for Tile=1:FPULNTILE
        TileLocation =  SubChTileLocationLUT(Tile)/2;
        SymbolIndex = TileLocation + 1;
        % Skip DC PN for Tiles at the upper carrier
        if (Tile <= (FPULNTILE/2))
            PNIndex = PnCodeOffset + TileLocation + 1;
        else
            PNIndex = PnCodeOffset + TileLocation + 1 + 1;
        end
        if (SymbolNum == 1)
            Pilot(1,Pilot1Index) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
            Pilot1Index = Pilot1Index + 1;
        elseif (SymbolNum == 3)
            Pilot(2,Pilot2Index) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
            Pilot2Index = Pilot2Index + 1;
        else
            Data(DataIndex) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
            DataIndex = DataIndex + 1;
        end
        PNIndex = PNIndex + 1;
        SymbolIndex = SymbolIndex + 1;

        Data(DataIndex) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
        PNIndex = PNIndex + 1;
        DataIndex = DataIndex + 1;
        SymbolIndex = SymbolIndex + 1;
        Data(DataIndex) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
        PNIndex = PNIndex + 1;
        DataIndex = DataIndex + 1;
        SymbolIndex = SymbolIndex + 1;

        if (SymbolNum == 1)
            Pilot(1,Pilot1Index) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
            Pilot1Index = Pilot1Index + 1;
        elseif (SymbolNum == 3)
            Pilot(2,Pilot2Index) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
            Pilot2Index = Pilot2Index + 1;
        else
            Data(DataIndex) = Symbol(SymbolNum,SymbolIndex) * PNCodeLUT(PNIndex);
            DataIndex = DataIndex + 1;
        end
    end
end

if DataIndex<49
Data(:,DataIndex:end)=[];
end

dr=find(real(Data)== 1);
di=find(imag(Data)== 1);
Data(dr) = imag(Data(dr)) + (1-UNITVAL);
Data(di) = real(Data(di)) + (1-UNITVAL)*i;

p1r=find(real(Pilot)== 1);
p1i=find(imag(Pilot)== 1);

Pilot(p1r) = imag(Pilot(p1r)) + (1-UNITVAL);
Pilot(p1i) = real(Pilot(p1i)) + (1-UNITVAL)*i;


⌨️ 快捷键说明

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