gusucode.com > wlan工具箱matlab源码程序 > wlan/wlan/+wlan/+internal/vhtSTF.m

    function y = vhtSTF(cfgOFDM,csh,numTx,spatialMapping,Q)
%vhtSTF generate a time domain VHT STF field
%
%   Note: This is an internal undocumented function and its API and/or
%   functionality may change in subsequent releases.
%
%   Y = vhtSTF(CFGOFDM,CSH,NUMTX,SPATIALMAPPING,Q) generates the time
%   domain VHT-STF field.
%
%   Y is an Ns-by-Nt matrix containing the modulated VHT-STF field. Ns is
%   the number of samples and Nt is the number of transmit antennas.
%
%   CFGOFDM is the OFDM configuration structure.
%
%   CSH is the cyclic shift to apply per space-time stream.
%
%   NUMTX is the number of transmit antennas.
%
%   SPATIALMAPPING is a string specifying the type of spatial mapping.
%
%   Q is a custom spatial mapping matrix.
%
%   Copyright 2016 The MathWorks, Inc.

%#codegen

numSegments  = cfgOFDM.FFTLength/64;
numSTSTotal = size(csh,1); % CSD is per space-time stream

% Non-HT L-STF (IEEE Std:802.11-2012, pg 1695)
VHTSTF = wlan.internal.lstfSequence();

numVHTFtones = 12*numSegments;  % Defined as per Table 22-8 (page 252)
vhtf = [zeros(6,1);  VHTSTF; zeros(5,1)];

% Replicate over CBW and apply phase rotation
vhtfToneRotated = repmat(vhtf, numSegments, 1) .* cfgOFDM.CarrierRotations;

% Replicate over multiple antennas
vhtfMIMO = repmat(vhtfToneRotated, 1, numSTSTotal);

% Cyclic shift addition per space-time stream
vhtfCycShift = wlan.internal.wlanCyclicShift(vhtfMIMO, csh, cfgOFDM.FFTLength, 'Tx');

% Spatial mapping
vhtfSpatialMapped = wlan.internal.wlanSpatialMapping(vhtfCycShift, ...
    spatialMapping, numTx, Q);

% OFDM modulation
modOut = ifft(ifftshift(vhtfSpatialMapped, 1), [], 1);
out = [modOut; modOut(1:cfgOFDM.CyclicPrefixLength,:)];  % Extend to a long symbol duration
y = out.*(cfgOFDM.FFTLength/sqrt(numVHTFtones*numSTSTotal));

end