A highly accurate and efficient numerical method is presented for computing the solution of a 1-D time-dependent partial differential equation in which the spatial differential operator features a piecewise constant coefficient defined on n pieces, in either self-adjoint and non-self-adjoint form, on a finite interval with periodic boundary conditions. The Uncertainty Principle is used to estimate the eigenvalues of the operator. Then, these estimates are used to construct a basis of eigenfunctions for use with a spectral method. The solution is presented as a truncated eigenfunction expansion, where each eigenfunction is a wave function that changes frequencies at the interfaces between different materials. Numerical experiments demonstrate the accuracy, efficiency and scalability of the method in comparison to other methods.