Generalized Moment Problems for Estimation of Spectral Densities and Quantum Channels