DFT calculation of the generalized and Drazin inverse of a polynomial matrix