main content

802.11ac transmitter measurements -凯发k8网页登录

this example shows how to perform these transmitter measurements on an ieee® 802.11ac™ waveform:

  • modulation accuracy

  • spectrum emission mask

  • spectrum flatness

  • in-phase and quadrature (iq) gain and phase imbalance

introduction

the transmitter modulation accuracy, required spectrum mask, and required spectral flatness for a given configuration is specified in section 21.3.17 of [ 1 ]. this example shows how to perform these measurements on a waveform. this example also models, measures, and corrects the iq gain and phase imbalance. generate the waveform with wlan toolbox™ or use a captured waveform with a spectrum analyzer.

the example generates 20 upsampled vht packets with an 80 mhz channel bandwidth and a 10 microsecond gap between packets. each packet contains random data and uses 256-qam modulation. add the iq gain and phase imbalance to the filtered waveform. use a high-power amplifier (hpa) model to introduce inband distortion and spectral regrowth. perform the spectral emission mask measurement on the upsampled waveform after the high-power amplifier modeling. downsample and correct the waveform with the estimated iq gain and phase imbalance. measure the error vector magnitude (evm) of the vht data field to determine the modulation accuracy. additionally, measure the spectral flatness. this diagram shows the workflow contained in the example.

vhttransmittermeasurementsdiagram.png

802.11ac vht packet configuration

this example generates an ieee 802.11ac waveform consisting of multiple vht format packets. use the vht format configuration object, , to configure transmission properties of a vht packet. this example configures the vht waveform for a 80 mhz bandwidth. because this example does not use space-time block coding, it can measure the modulation accuracy per spatial stream.

cfgvht = wlanvhtconfig;            % create packet configuration
cfgvht.channelbandwidth = 'cbw80'; % 80 mhz
cfgvht.numtransmitantennas = 1;    % one transmit antenna
cfgvht.numspacetimestreams = 1;    % one space-time stream
cfgvht.stbc = false;               % no stbc so one spatial stream
cfgvht.mcs = 8;                    % modulation: 256-qam
cfgvht.apeplength = 3000;          % a-mpdu length pre-eof padding in bytes

waveform generation

generate the vht waveform for the specified bits and configuration by using the function, specifying the desired oversampling factor, number of packets, and idle time between each packet.

osf = 3;          % 3x oversampling factor
numpackets = 20;  % generate 20 packets
idletime = 10e-6; % 10 microseconds idle time between packets

create random bits for all packets, data, and pass as an argument to along with the vht packet configuration object cfgvht. this configures the waveform generator to synthesize an 802.11ac vht waveform. additionally, configure the waveform generator by using name-value pairs to generate multiple oversampled packets with a specified idle time between each packet.

% create random data; psdulength is in bytes
savedstate = rng(0); % set random state
data = randi([0 1],cfgvht.psdulength*8*numpackets,1);
% generate a multi-packet waveform
txwaveform = wlanwaveformgenerator(data,cfgvht, ...
    'oversamplingfactor',osf,'numpackets',numpackets,'idletime',idletime);
fs = wlansamplerate(cfgvht); % baseband sampling rate of the waveform

add impariments

iq imbalance modeling

iq imbalance arises when a front-end component does not respect the power balance or the orthogonality between the i and q branches. this example adds iq gain and phase imbalance to the transmitted waveform based on the flag modeliqimbalance. at the receiver, estimate the iq gain and phase imbalance and correct the waveform as per the compensation scheme specified in [ 5 ].

modeliqimbalance = true; % set to true to add iq gain and phase imbalance
if modeliqimbalance
    iqgaindb = 1; % iq gain imbalance in db, specify from the range [-1 1]
    iqphasedeg = 1; % iq phase imbalance in degrees, specify from the range [-2 2]
    iqgainlin = db2mag(iqgaindb); % convert gain from db to linear value
    txwaveform = real(txwaveform)   1i*imag(txwaveform)*iqgainlin*exp(1j*iqphasedeg*pi/180); % as specified in equation-1 of [5]
end

high-power amplifier modeling

the high-power amplifier introduces nonlinear behavior in the form of inband distortion and spectral regrowth. this example simulates the power amplifiers by using the rapp model in 802.11ac [ 2 ], which introduces am/am distortion.

model the amplifier by using the object, and configure reduced distortion by specifying a backoff, hpabackoff, such that the amplifier operates below its saturation point. you can increase the backoff to reduce evm for higher mcs values.

psaturation = 25; % saturation power of a power amplifier in dbm
hpabackoff = 13; % power amplifier backoff in db
% create and configure a memoryless nonlinearity to model the amplifier
nonlinearity = comm.memorylessnonlinearity;
nonlinearity.method = 'rapp model';
nonlinearity.smoothness = 3; % p parameter
nonlinearity.lineargain = -hpabackoff;
nonlinearity.outputsaturationlevel = db2mag(psaturation-30);
% apply the model to each transmit antenna
txwaveform = nonlinearity(txwaveform);

thermal noise

add thermal noise to each transmit antenna by using the object with a noise figure of 6 db [ 3 ].

thnoise = comm.thermalnoise('noisemethod','noise figure','samplerate',fs*osf,'noisefigure',6);
for i = 1:cfgvht.numtransmitantennas
    txwaveform(:,i) = thnoise(txwaveform(:,i));
end

modulation accuracy (evm), spectral flatness and iq imbalance measurements

downsampling and filtering

resample the oversampled waveform down to baseband for physical layer processing and evm and spectral flatness measurements, applying a low-pass anti-aliasing filter before downsampling. the impact of the low-pass filter is visible in the spectral flatness measurement. the anti-aliasing filter is designed so that all active subcarriers are within the filter passband.

design resampling filter.

astop = 40; % stopband attenuation
ofdminfo = wlanvhtofdminfo('vht-data',cfgvht); % ofdm parameters
scs = fs/ofdminfo.fftlength; % subcarrier spacing
txbw = max(abs(ofdminfo.activefrequencyindices))*2*scs; % occupied bandwidth
[l,m] = rat(1/osf);
maxlm = max([l m]);
r = (fs-txbw)/fs;
tw = 2*r/maxlm; % transition width
firdec = designmultiratefir(l,m,tw,astop,'systemobject',true);

resample the waveform to baseband.

rxwaveform = firdec(txwaveform);

receiver processing

this section detects, synchronizes, and extracts each packet in rxwaveform, then measures the evm, spectral flatness, and iq imbalance. for each packet, the example performs these steps:

  • detect the start of the packet

  • extract the non-ht fields

  • estimate and correct coarse carrier frequency offset (cfo)

  • perform fine symbol timing estimate by using the frequency-corrected non-ht fields

  • extract the packet from the waveform by using the fine symbol timing offset

  • correct the extracted packet with the coarse cfo estimate

  • extract the l-ltf, then estimate the fine cfo and correct for the whole packet

  • extract the vht-ltf and perform channel estimation for each of the transmit streams

  • measure the iq imbalance from the channel estimate and perform correction on the channel estimate

  • measure the spectral flatness by using the channel estimate

  • extract and ofdm demodulate the vht data field

  • perform noise estimation by using the demodulated data field pilots and single-stream channel estimate at pilot subcarriers

  • phase-correct and equalize the vht data field by using the channel and noise estimates

  • correct the equalized data subcarriers with the iq imbalance estimate

  • for each data-carrying subcarrier in each spatial stream, find the closest constellation point and measure the evm

the diagram shows the processing chain:

the vht-ltf symbols include pilot symbols to allow for phase tracking, but this example does not perform phase tracking.

test the spectral flatness for each packet by measuring the deviation in the magnitude of individual subcarriers in the channel estimate against the average [ 1 ]. plot these deviations for each packet using the helper function . plot the average evm per data-carrying subcarrier and the equalized symbols for each packet.

demodulate, equalize, and decode the vht data symbols by using the function. parameterize this function to perform pilot phase tracking and zero-forcing equalization as required by the standard. this example measures the modulation accuracy from the equalized symbols.

this example makes two different evm measurements using two instances of comm.evm.

  • rms evm per packet, which comprises averaging the evm over subcarriers, ofdm symbols, and spatial streams.

  • rms evm per subcarrier per spatial stream for a packet. because this configuration maps spatial streams directly to antennas, this measurement can help detect frequency-dependent impairments, which may affect individual rf chains differently. this measurement averages the evm over ofdm symbols only.

% setup evm measurements
[evmperpkt,evmpersc] = vhtevmsetup(cfgvht);

this code configures objects and variables for processing.

% get indices for accessing each field within the time-domain packet
ind = wlanfieldindices(cfgvht);
rxwaveformlength = size(rxwaveform,1);
pktlength = double(ind.vhtdata(2));
% define the minimum length of data we can detect; length of the l-stf in
% samples
minpktlen = double(ind.lstf(2)-ind.lstf(1)) 1;
% setup the measurement plots
[hsf,hcon,hevm] = vhttxsetupplots(cfgvht);
rmsevm = zeros(numpackets,1);
pktoffsetstore = zeros(numpackets,1);
rng(savedstate); % restore random state

detect and process packets within the received waveform, rxwaveform by using a while loop, which performs these steps.

  • detect a packet by indexing into rxwaveform with the sample offset, searchoffset

  • detect and process the first packet within rxwaveform

  • detect and process the next packet by incrementing the sample index offset, searchoffset

  • repeat until no further packets are detected

pktnum = 0;
searchoffset = 0; % start at first sample (no offset)
while (searchoffset minpktlen)<=rxwaveformlength
    % packet detect
    pktoffset = wlanpacketdetect(rxwaveform,cfgvht.channelbandwidth);
    % packet offset from start of waveform
    pktoffset = searchoffset pktoffset;
    % if no packet detected or offset outwith bounds of waveform then stop
    if isempty(pktoffset) || (pktoffset<0) || ...
            ((pktoffset ind.lsig(2))>rxwaveformlength)
        break;
    end
    % extract non-ht fields and perform coarse frequency offset correction
    % to allow for reliable symbol timing
    nonht = rxwaveform(pktoffset (ind.lstf(1):ind.lsig(2)),:);
    coarsefreqoff = wlancoarsecfoestimate(nonht,cfgvht.channelbandwidth);
    nonht = frequencyoffset(nonht,fs,-coarsefreqoff);
    % determine offset between the expected start of l-ltf and actual start
    % of l-ltf
    lltfoffset = wlansymboltimingestimate(nonht,cfgvht.channelbandwidth);
    % determine packet offset
    pktoffset = pktoffset lltfoffset;
    % if offset is without bounds of waveform skip samples and continue
    % searching within remainder of the waveform
    if (pktoffset<0) || ((pktoffset pktlength)>rxwaveformlength)
        searchoffset = pktoffset double(ind.lstf(2)) 1;
        continue;
    end
    % timing synchronization complete; extract the detected packet
    rxpacket = rxwaveform(pktoffset (1:pktlength),:);
    pktnum = pktnum 1;
    disp(['  packet ' num2str(pktnum) ' at index: ' num2str(pktoffset 1)]);
    % apply coarse frequency correction to the extracted packet
    rxpacket = frequencyoffset(rxpacket,fs,-coarsefreqoff);
    % perform fine frequency offset correction on the extracted packet
    lltf = rxpacket(ind.lltf(1):ind.lltf(2),:); % extract l-ltf
    finefreqoff = wlanfinecfoestimate(lltf,cfgvht.channelbandwidth);
    rxpacket = frequencyoffset(rxpacket,fs,-finefreqoff);
    % extract vht-ltf samples, demodulate and perform channel estimation
    vhtltf = rxpacket(ind.vhtltf(1):ind.vhtltf(2),:);
    vhtltfdemod = wlanvhtltfdemodulate(vhtltf,cfgvht);
    % channel estimate and single stream channel estimate
    [chanest,chanestsspilots] = wlanvhtltfchannelestimate(vhtltfdemod,cfgvht);
    % perform iq gain and phase imbalance estimation
    [gainest,phaseest,alphaest,betaest,gamma,datarot] = ...
        helperiqimbalanceestimate(chanest,cfgvht);
    fprintf('    measured iq gain & phase imbalance: %2.2f db, %2.2f deg\n',gainest,phaseest);
    % perform iq gain and phase imbalance correction on channel
    % estimates
    chanest = chanest./(alphaest   betaest.*gamma); % as specified in equation-29 of [5]
    % spectral flatness test
    [pass,deviation,testsc] = wlanspectralflatness(chanest,'vht',cfgvht.channelbandwidth);
    if pass
        disp('    spectral flatness passed');
    else
        disp('    spectral flatness failed');
    end
    % plot deviation against limits
    vhttxplotspectralflatness(deviation,testsc,pktnum,hsf);
    % extract vht data samples from the waveform
    vhtdata = rxpacket(ind.vhtdata(1):ind.vhtdata(2),:);
    % estimate the noise power in vht data field
    noisevarvht = vhtnoiseestimate(vhtdata,chanestsspilots,cfgvht);
    % extract vht data samples and perform ofdm demodulation, equalization
    % and phase tracking
    [~,~,eqsym] = wlanvhtdatarecover(vhtdata,chanest,noisevarvht,cfgvht,...
        'equalizationmethod','zf','pilotphasetracking','preeq','ldpcdecodingmethod','norm-min-sum'); % use zero forcing algorithm for equalization
    % perform iq gain and phase imbalance correction on vht data
    eqsym = eqsym.*datarot; % carrier rotation on data subcarriers
    eqsym = ((conj(alphaest)*eqsym)-(betaest*conj(eqsym(end:-1:1,:,:))))/((abs(alphaest)^2)-(abs(betaest)^2));  % as specified in equation-30 of [5]
    % compute rms evm over all spatial streams for packet
    rmsevm(pktnum) = evmperpkt(eqsym);
    fprintf('    rms evm: %2.2f%%, %2.2fdb\n',rmsevm(pktnum),20*log10(rmsevm(pktnum)/100));
    % compute rms evm per subcarrier and spatial stream for the packet
    evmpersc = evmpersc(eqsym); % nst-by-1-by-nss
    % plot rms evm per subcarrier and equalized constellation
    vhttxevmconstellationplots(eqsym,evmpersc,cfgvht,pktnum,hcon,hevm);
    % store the offset of each packet within the waveform
    pktoffsetstore(pktnum) = pktoffset;
    % increment waveform offset and search remaining waveform for a packet
    searchoffset = pktoffset pktlength minpktlen;
end
  packet 1 at index: 25
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 3.30%, -29.63db

figure contains an axes object. the axes object with title rms evm, packet:1, spatial stream:1, xlabel subcarrier index, ylabel evm (%) contains a line object which displays its values using only markers.

  packet 2 at index: 9785
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed

figure contains an axes object. the axes object with title spectral flatness, packet:1, xlabel subcarrier index, ylabel deviation (db) contains 3 objects of type line. one or more of the lines displays its values using only markers these objects represent antenna 1, deviation limit.

    rms evm: 3.07%, -30.24db
  packet 3 at index: 19545
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.91%, -30.71db
  packet 4 at index: 29305
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 3.04%, -30.33db
  packet 5 at index: 39065
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.99%, -30.50db
  packet 6 at index: 48825
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.67%, -31.49db
  packet 7 at index: 58585
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.93%, -30.65db
  packet 8 at index: 68345
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.81%, -31.03db
  packet 9 at index: 78105
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.93%, -30.65db
  packet 10 at index: 87865
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.73%, -31.28db
  packet 11 at index: 97625
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.90%, -30.76db
  packet 12 at index: 107385
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.94%, -30.63db
  packet 13 at index: 117145
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.84%, -30.94db
  packet 14 at index: 126905
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.91%, -30.73db
  packet 15 at index: 136665
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 3.09%, -30.20db
  packet 16 at index: 146425
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.60%, -31.69db
  packet 17 at index: 156185
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 2.99%, -30.49db
  packet 18 at index: 165945
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 3.20%, -29.90db
  packet 19 at index: 175705
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed
    rms evm: 3.24%, -29.79db
  packet 20 at index: 185465
    measured iq gain & phase imbalance: 0.98 db, 0.98 deg
    spectral flatness passed

figure contains an axes object. the axes object with title spectral flatness, packet:20, xlabel subcarrier index, ylabel deviation (db) contains 3 objects of type line. one or more of the lines displays its values using only markers these objects represent antenna 1, deviation limit.

    rms evm: 3.20%, -29.91db

figure contains an axes object. the axes object with title rms evm, packet:20, spatial stream:1, xlabel subcarrier index, ylabel evm (%) contains a line object which displays its values using only markers.

if pktnum>0
    fprintf('average evm for %d packets: %2.2f%%, %2.2fdb\n', ...
        pktnum,mean(rmsevm(1:pktnum)),20*log10(mean(rmsevm(1:pktnum))/100));
else
    disp('no complete packet detected');
end
average evm for 20 packets: 2.96%, -30.56db

transmit spectrum emission mask measurement

this section measures the spectral mask of the filtered and impaired waveform after high-power amplifier modeling.

the transmitter spectral mask test [ 4 ] uses a time-gated spectral measurement of the vht data field. the example extracts the vht data field of each packet from the oversampled waveform, txwaveform, by using the start indices of each packet within the waveform. any delay introduced in the baseband processing chain used to determine the packet indices must be accounted for when gating the vht data field within txwaveform. concatenate the extracted vht data fields in preparation for measurement.

% indices for accessing each field within the time-domain packet
ind = wlanfieldindices(cfgvht,'oversamplingfactor', osf);
startidx = ind.vhtdata(1); % start of data
endidx = ind.vhtdata(2);   % end of data
idlensamps = idletime*fs*osf; % idle time samples
perpktlength = endidx idlensamps;
idx = zeros(endidx-startidx 1,numpackets);
for i = 1:numpackets
    % start of packet in txwaveform, accounting for the filter delay
    pktoffset = (i-1)*perpktlength;
    % indices of non-ht data in txwaveform
    idx(:,i) = pktoffset (startidx:endidx);
end
gatedvhtdata = txwaveform(idx(:),:);

the 802.11ac standard specifies the spectral mask relative to the peak power spectral density. the helper function generates a plot which overlays the required mask with the measured psd.

if pktnum>0
    helperspectralmasktest(gatedvhtdata,fs,osf);
end
   spectrum mask passed

conclusion and further exploration

this example plots four results: spectral flatness, rms evm per subcarrier, equalized constellation, and spectral mask.

the high-power amplifier model introduces significant inband distortion and spectral regrowth which is visible in the evm results, noisy constellation and out-of-band emissions in the spectral mask plot. try increasing the high-power amplifier backoff and note the improved evm, constellation and lower out-of-band emissions.

try using different values for iqgaindb and iqphasedeg and note the impact on evm and constellation.

related examples:

selected bibliography

  1. ieee std 802.11™-2020 ieee standard for information technology - telecommunications and information exchange between systems - local and metropolitan area networks - specific requirements - part 11: wireless lan medium access control (mac) and physical layer (phy) specifications.

  2. loc and cheong. ieee p802.11 wireless lans. tgac functional requirements and evaluation methodology rev. 16. 2011-01-19.

  3. perahia, e., and r. stacey. next generation wireless lans: 802.11n and 802.11ac. 2nd edition. united kingdom: cambridge university press, 2013.

  4. archambault, jerry, and shravan surineni. "ieee 802.11 spectral measurements using vector signal analyzers." rf design 27.6 (2004): 38-49.

  5. m. janaswamy, n. k. chavali and s. batabyal, "measurement of transmitter iq parameters in ht and vht wireless lan systems," 2016 international conference on signal processing and communications (spcom), bangalore.

网站地图