%% Constellation Demapping with Hard Demodulation
% Perform a 256-QAM demapping by using hard demodulation.
% Create the sequence of data bits.

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

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

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

% Perform the hard 256-QAM constellation demapping.

noiseVarEst = 0;
demapType = 'hard';
y = wlanConstellationDemap(sym,noiseVarEst,numBPSCS,demapType);

% Verify that the demapped data matches the original data.

isequal(bits,y)

% Copyright 2012 The MathWorks, Inc.