Generalized Talbot Effect Theory and Application to Advanced Optical Wave Processing