The characterization of nanostructures with spectroscopic methods is a fundamental tool in nanoscience. For novel nanostructures, the interpretation of spectral features is a challenging task. To address this issue, we present the “Symmetry-Filtered Molecular Dynamics (SFMD)” method to calculate Raman and infrared wavenumbers from molecular dynamics (MD) simulations, employing only the symmetry of the atomic structure. Explicit and expensive calculations of the electric polarizability or the dipole moment are not required. Therefore, our method can be easily used with any standard MD software. On the basis of the density functional tight-binding method for the MD simulations, we apply our method to bulk silicon and small-diameter hydrogen-passivated silicon nanowires. For bulk silicon, we study the wavenumber shift of the Raman peak with temperature and obtain results that are in good agreement with experiments. We further show that thermal lattice expansion is a minor effect (22%) and that temperature-driven anharmonic effects (78%) are the main contributions to that wavenumber shift. By analyzing the bond lengths of different silicon nanowires, we found that surface stress manifests as a 0.37% shortening of bonds only in the outermost silicon layer. We further analyzed the diameter-dependent wavenumber shift of a Raman peak in silicon nanowires. We found that the main contribution to the wavenumber shift comes from the phonon confinement effect and surface stress leads to an additional shift of 9–22%. Our results indicate that our method is able to produce quantitative results that can be compared with experiments. We propose our method to be used for the understanding of Raman and infrared spectra of novel bulk and nanostructures. Copyright © 2012 John Wiley & Sons, Ltd.