We consider families of generalized Dirac operators D(t) with constant
principal symbol and constant essential spectrum such that the endpoi
nts are gauge equivalent, i.e., D1 = WD0W. The spectral flow un any g
ap in the essential spectrum we express as the Fredholm index of 1 + (
W - 1) P where P is the spectral projection on the interval [d, infini
ty) with respect to D0 and d is in the gap. We reduce the computation
of this index to the Atiyah-Singer index theorem for elliptic pseudodi
fferential operators. We find an invariant of the Riemannian geometry
for odd dimensional spin manifolds estimating the length of gaps in th
e spectrum of the Dirac operator.