Pseudospectral time domain (PSTD) methods are widely used in many branches of acoustics for the numerical solution of the wave equation, including biomedical ultrasound and seismology. The use of the Fourier collocation spectral method in particular has many computational advantages, including a reduced number of grid points required for accurate simulations. However, the use of a discrete Fourier basis is also inherently restricted to solving problems with periodic boundary conditions. This means that waves exiting one side of the domain reappear on the opposite side. Practically, this is usually overcome by implementing a perfectly matched layer to simulate freefield conditions. However, in some cases, other boundary conditions are required, and these are not straightforward to implement. Here, a family of spectral collocation methods based on the use of a sine or cosine basis is described. These retain the computational advantages of the Fourier collocation method but instead allow homogeneous Dirichlet (sound-soft) and Neumann (sound-hard) boundary conditions to be imposed. The basis function weights are computed numerically using the discrete sine and cosine transforms, which can be implemented using O(N log N ) operations analogous to the fast Fourier transform. The different combinations of discrete symmetry give rise to sixteen possible discrete trigonometric transforms. The properties of these transforms are described, and practical details of how to implement spectral methods using discrete sine and cosine transforms are provided. The technique is then illustrated through the solution of the wave equation in a rectangular domain subject to different combinations of boundary conditions. The extension to boundaries with arbitrary real reflection coefficients or boundaries that are non-reflecting is also demonstrated using the weighted summation of the solutions with Dirichlet and Neumann boundary conditions.