  In this paper, a two-step codeword design approach for millimeter wave
(mmWave) massive MIMO systems is presented. Ideal codewords are first designed,
which ignores the hardware constraints in terms of phase shifter resolution and
the number of RF chains. Based on the ideal codewords, practical codewords are
then obtained taking the hardware constraints into consideration. For the ideal
codeword design in the first step, additional phase is introduced to the beam
gain to provide extra degree of freedom. We develop a phase-shifted ideal
codeword design (PS-ICD) method, which is based on alternative minimization
with each iteration having a closed-form solution and can be extended to design
more general beamforming vectors with different beam patterns. Once the ideal
codewords are obtained in the first step, the practical codeword design problem
in the second step is to approach the ideal codewords by considering the
hardware constraints of the hybrid precoding structure in terms of phase
shifter resolution and the number of RF chains. We propose a fast search based
alternative minimization (FS-AltMin) algorithm that alternatively designs the
analog precoder and digital precoder. Simulation results verify the
effectiveness of the proposed methods and show that the codewords designed
based on the two-step approach outperform those designed by the existing
approaches.
