In this paper, analytical solutions for shear horizontal (SH) waves propagating in a piezoelectric (PE) substrate with periodic gradient mass oscillators are obtained. Both wave-mode method and spectral method are used to obtain the dispersion equation of SH waves. The influences of mass-spring oscillators on dispersion curves and the wave mode shapes are discussed via numerical examples. It reveals that the numerical results obtained by wave-mode method and spectral method are well matched. In addition, the mass-spring oscillators have evident effects on the propagation characteristic of SH waves, and the effects are closely related with the frequency. Moreover, the widths of the local resonant and Bragg resonant bandgaps become evident wider when oscillator's natural resonance frequency is close to the Bragg scattering frequency. In particular, based on our proposed structure, we can design a sensor with advantages such as filtering and only sensitive to specific frequencies, amplify lossless signals and multi frequency sensitivity.