Resonating piezoelectric devices, such as aluminum nitride (AlN) piezoelectric micromachined ultrasonic transducers (PMUTs), display superior performance to previous generations of resonating microelectromechanical systems (MEMS). However, the quality of the piezoelectric thin film can greatly impact operating characteristics, such as the resonant frequency. Several AlN PMUT devices fabricated on the same silicon wafer exhibited a range of resonance frequencies (400-600 kHz), indicating that there is nonuniformity across the processed wafer. AlN film nonuniformity is likely introduced during the reactive sputtering process. Two key parameters identified as influencing the resonance frequency include: (i) the membrane diameter and (ii) residual stress. This work focuses on the residual stress, and uses X-ray diffraction technique (XRD) to determine the in-plane biaxial residual stress values, as a function of die position on the wafer. Results show that there is a compressive stress gradient along the wafer, ranging from -357 MPa to -56 MPa. A plot of in-plane biaxial residual stress as a function of resonance frequency shows a relation between the measured stress and frequency. As resonating piezoelectric devices require well defined operating frequencies and bandwidths, this work demonstrates the importance of studying not only global stresses, but also local residual stresses.