Quantum Statistics of Homodyne and Heterodyne Detection