The spectrum of certain pseudo-Riemannian locally symmetric spaces