Theory of optical heterodyne detection using the pyroelectric effect.