Cycle slip detection and repair is an important issue in the GPS data processing. Different methods have been developed to detect and repair cycle slips on undifferenced , single- or double-differenced observations. The issue is still crucial for high-precision GPS positioning, especially for the undifferenced GPS observations. A method is proposed to fix cycle slips based on the generalized likelihood ratio (GLR) test. The method has a good performance on cycle slip fixing of undifferenced carrier phase observations on individual frequencies, either on L1 or on L2, without making a linear combination among the observables. The functional model is a piecewise cubic curve fitted to a number of consecutive data using the least squares cubic spline approximation (LS-CSA). For fixing the cycle slips, an integer estimation technique is employed to determine the integer values from the float solution. The performance of the proposed method is then compared with the existing two methods using simulated data. The results on a few GPS data sets with sampling rate of 1 Hz or higher confirm that this method can detect and correct all simulated cycle slips regardless of the size of the cycle slip or the satellite elevation angle. The efficacy of the method is then investigated on the GPS data sets with lower sampling rates of 5, 10, and 30 s. The results indicate that the proposed method always performs the best for the data sets considered. This is thus an appropriate method for cycle slip detection and repair of single-frequency GPS observations.