It is shown that the spectral points (bound states and resonances) generated by a central potential of a single-channel problem, can be found using rational parametrization of the S-matrix. To achieve this, one only needs values of the S-matrix along the real positive energy axis. No calculations of the S-matrix at complex energies or a complex rotation are necessary. The proposed method is therefore universal in that it is applicable to any potential (local, non-local, discontinuous, etc) provided that there is a way of obtaining the S-matrix (or scattering phase shifts) at real collision energies. Besides this, combined with any method that extracts the phase shifts from the scattering data, the proposed rational parametrization technique would be able to do the spectral analysis using the experimental data.