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

    function y = vhtSIGBModulate(data,pilots,cfgOFDM,csh,numTx,spatialMapping,Q)
%vhtSIGBModulate Tone rotation, CSD, spatial mapping and OFDM modulation
%
%   Note: This is an internal undocumented function and its API and/or
%   functionality may change in subsequent releases.
%
%   Y = vhtSIGBModulate(DATA,PILOTS,CFGOFDM,CSH,NUMTX,SPATIALMAPPING,Q)
%   performs tone rotation, CSD, spatial mapping and OFDM modulation.
%
%   Y is an Ns-by-Nt matrix containing the modulated VHT-SIG-B field. Ns is
%   the number of samples and Nt is the number of transmit antennas.
%
%   DATA is an Nsd-by-Nsym matrix containing data symbols, where Nsd is the
%   number of data carring subcarriers and Nsym is the number of OFDM
%   symbols.
%
%   PILOTS is a Nsp-by-Nsym matrix containing pilot symbols, where Nsp is
%   the number of pilot carrying subcarriers.
%
%   CFGOFDM is the OFDM configuration structure.
%
%   CSH is the cyclic shift to apply per space-time stream.
%
%   NUMTX is the number of transmit antennas.
%
%   MAPPINGTYPE is a string specifying the type of spatial mapping.
%
%   Q is a custom spatial mapping matrix.

%   Copyright 2016 The MathWorks, Inc.

%#codegen

numSTSTotal = numel(csh); % shift per space-time stream

% Tone packing for different CBW for a single stream, single symbol
symbol = complex(zeros(cfgOFDM.FFTLength,numSTSTotal));
symbol(cfgOFDM.DataIndices,:) = data;
symbol(cfgOFDM.PilotIndices,:) = pilots(:,1,:);

% Tone rotation (gamma) - based on legacy Nfft
symbol = bsxfun(@times,symbol,cfgOFDM.CarrierRotations);

% Cyclic shift addition
vhtsigCycShift = wlan.internal.wlanCyclicShift(symbol,csh,cfgOFDM.FFTLength,'Tx');

% Spatial mapping
vhtsigSpatialMapped = wlan.internal.wlanSpatialMapping(vhtsigCycShift,spatialMapping,numTx,Q);

% OFDM modulation
y = wlan.internal.wlanOFDMModulate(reshape(vhtsigSpatialMapped, ...
    cfgOFDM.FFTLength,1,numTx),cfgOFDM.CyclicPrefixLength)* cfgOFDM.NormalizationFactor;

end