In order to maintain the power quality, parameters of harmonic and sub-inter-harmonic components in the signal must be estimated accurately with less computational complexity. In power systems, the value of fundamental frequency changes between 49.5Hz and 50.5Hz and this situation causes the frequency of other harmonic components to change. In order to make efficient amplitude and phase estimation, initially, frequencies must be estimated properly. In this study, the Sine Cosine Algorithm is applied for the estimation of harmonics and sub-inter-harmonics parameters in the power systems. Unlike other optimization-based methods in the literature, it is assumed that the frequencies of the harmonic and sub-inter-harmonics component in the signal are not known. The proposed algorithm has been tested on synthetic signals at different noisy environment. Given the results obtained, SCA can predict the frequencies, amplitudes, and phases of harmonics and sub-inter-harmonics with less than 5% error, which is the maximum error limit specified by the standard, and proposed algorithm estimates the actual parameters with a low error rate even in noisy environments. In addition, SCA has a better convergence performance index than optimization algorithms used in studies in the literature assuming that frequency is known. Performance of the proposed algorithm is also tested on the data obtained from electrical transmission system. SCA estimates the frequencies of harmonics with almost no error, and the amplitude and phase estimation values of each harmonic are in corroboration with the results obtained by the DFT method.