%% π/2-BPSK Mapping
% Perform a \frac{\pi }{2}-BPSK mapping on a sequence of data bits as defined in IEEE® 802.11ad™-2012 Section 21.6.3.2.4.
%
% Create the sequence of data bits.

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

%
% Perform the BPSK mapping on the data bits with a rotation of \frac{\pi }{2} radians. Note that the size of the constellation rotation phase is equal to the size of input sequence.

numBPSCS = 1;
phase = pi*(0:size(bits,1)/numBPSCS-1).'/2;
mappedData = wlanConstellationMap(bits,numBPSCS,phase);

%
% As we performed a BPSK mapping, the number of symbols per bit is one, therefore the size of the output is equal to the size of the original sequence.

size(mappedData)

%
% Display the modulated signal constellation using the scatterplot function.

scatterplot(mappedData);

% Copyright 2012 The MathWorks, Inc.