  We provide an explicit spectral representation for several weighted Hankel
matrices by means of the so called commutator method. These weighted Hankel
matrices are found in the commutant of Jacobi matrices associated with
orthogonal polynomials from the Askey scheme whose Jacobi parameters are
polynomial functions of the index. We also present two more results of general
interest. First, we give a complete description of the commutant of a Jacobi
matrix. Second, we deduce a necessary and sufficient condition for a weighted
Hankel matrix commuting with a Jacobi matrix to determine a unique self-adjoint
operator on $\ell^{2}(\mathbb{N}_{0})$.
