Spectral analysis of a q-difference operator