Synthesis of Shaped Beams using Active Element Patterns and Spectral Factorization