We describe a scheme for calculating the infrared and Raman spectra of large model structures from first principles. Our scheme is based on the application of a finite electric field in density functional calculations with periodic boundary conditions. Coupling tensors for infrared and Raman spectra are obtained by numerically calculating first and second derivatives of the atomic forces with respect to the electric field. The method is illustrated through a study of the vibrational properties of vitreous silica, including inelastic neutron scattering, infrared, and Raman spectroscopies. (c) 2004 Elsevier B.V. All rights reserved.