
The effect of undulator field harmonics on spontaneous and stimulated undulator radiation, both on and off the undulator axis, is studied. Bessel factors for the undulators with field harmonics have been analytically calculated and numerically verified. The influence of the third undulator field harmonic on single-pass free-electron laser radiation is explored. Harmonic generation at the LCLS and SPring-8 free-electron lasers is modeled and analyzed.