We present here a new method to calculate, quite instantaneously, the
amplitude and phase transverse distribution of the spontaneous emission (SE)
produced in a waveguide. The SE is the radiation produced by an electron
beam passing through an undulator. It is involved in the operation of Free
Electron Lasers (FEL). Some FELs, working in infrared, use a waveguide in
place of the vacuum chamber of the undulator. The numerical process which is
described here is quasi analytical. It is based on a standard method for wave
propagation using the Fast Fourier Transform, and it is compatible with
numerical codes for wave propagation. It is limited to planar undulators. Some
numerical codes exist to calculate the SE transverse profile, but they are not
suitable for waveguide configuration. In addition, a simplified version of the
calculation gives the SE radiation without waveguide, i.e. when propagating in
free space. In practice, the process can be included in a general code to
calculate the cavity losses at the start-up of the FEL operation. These losses
are always larger than those for the steady state regime, and they may be large
enough to forbid laser operation.