  Position and frequency switching techniques used for the removal of the
bandpass dependence of radio astronomical spectra are presented and discussed
in detail. Both methods are widely used, although the frequency dependence of
the system temperature and/or noise diode is often neglected. This leads to
systematic errors in the calibration that potentially have a significant impact
on scientific results, especially when using large-bandwidth receivers or
performing statistical analyses. We present methods to derive an unbiased
calibration using a noise diode, which is part of many heterodyne receivers. We
compare the proposed methods and describe the advantages and bottlenecks of the
various approaches. Monte Carlo simulations are used to qualitatively
investigate both systematics and the error distribution of the reconstructed
flux estimates about the correct flux values for the new methods but also the
'classical' case. Finally, the determination of the frequency-dependent noise
temperature of the calibration diode using hot-cold measurements or
observations of well-known continuum sources is also briefly discussed.
