Beam-Wave Interaction in Periodic and Quasi-Periodic