Infrared and NMR spectroscopic studies of the thermal degradation of polyacrylonitrile