Phased Array With Pattern Shaping and Scan Loss Reduction for Millimeter Waves