Noise in homodyne and heterodyne detection