%% Constellation Demapping with Hard Demodulation
% Perform a 256QAM demapping by using hard demodulation. The demapping is defined in IEEE® 802.11™-2012 Section 18.3.5.8
%
% Create the sequence of data bits.

 bits = randi([0 1],416,1);

%
% Perform the constellation mapping on the data bits by using a 256QAM constellation.

numBPSCS = 8;
mappedData = wlanConstellationMap(bits,numBPSCS);

%
% Perform the hard 256QAM constellation demapping. Because it is a hard demapping, the estimated noise variance is ignored.

noiseVar = 0;
demapType = 'hard';
demappedData = wlanConstellationDemap(mappedData,noiseVar,numBPSCS,demapType);

%
% Verify that the demapped data matches the original data.

isequal(bits,demappedData)

% Copyright 2012 The MathWorks, Inc.