A Pseudospectral Scheme for the Numerical Calculation of Shocks