I point out the mathematical correspondence between an incoherent imaging model proposed by my group in the study of quantum-inspired superresolution [Tsang, Nair, and Lu, Physical Review X 6, 031033 (2016)] and a noise spectroscopy model also proposed by us [Tsang and Nair, Physical Review A 86, 042115 (2012); Ng et al., Physical Review A 93, 042121 (2016)]. Both can be regarded as random displacement models, where the probability measure for the random displacement depends on unknown parameters. The spatial-mode demultiplexing (SPADE) method proposed for imaging is analogous to the spectral photon counting method proposed in Ng et al. (2016) for optical phase noise spectroscopy -- Both methods are discrete-variable measurements that are superior to direct displacement measurements (direct imaging or homodyne detection) and can achieve the respective quantum limits. Inspired by SPADE, I propose a modification of spectral photon counting when the input field is squeezed -- simply unsqueeze the output field before spectral photon counting. I show that this method is quantum-optimal and far superior to homodyne detection for both parameter estimation and detection, thus solving the open problems in Tsang and Nair (2012) and Ng et al. (2016).