We devise an efficient scheme to determine vibrational properties from Path Integral Molecular Dynamics (PIMD) simulations. The method is based on zero-time Kubo-transformed correlation functions and captures the anharmonicity of the potential due to both temperature and quantum effects. Using analytical derivations and numerical calculations on toy-model potentials, we show that two different estimators built upon PIMD correlation functions fully characterize the phonon spectra and the anharmonicity strength. The first estimator is associated with the force-force quantum correlators and, in the weak anharmonic regime, yields reliable zero-point motion frequencies and thermodynamic properties of the quantum system. The second one is instead connected to displacement-displacement correlators and accurately probes the lowest-energy phonon excitations, regardless of the anharmonicity strength of the system. We also prove that the use of generalized eigenvalue equations, in place of the standard normal mode equations, leads to a significant speed-up in the PIMD phonon calculations, both in terms of faster convergence rate and smaller time step bias. Within this framework, using ab initio PIMD simulations, we compute phonon dispersions of diamond and of the high-pressure I41/amd phase of atomic hydrogen. We find that in the latter case, the anharmonicity is stronger than previously estimated and yields a sizeable red-shift in the vibrational spectrum of atomic hydrogen.