Does there exist a simple regression method to fit a single sinusoid period to a data set? I'm currently working on a project where I want to fit a single sinusoid period to a data set. Essentially I have very good control/knowledge of the signal's dominant frequency, so I'm only sampling for a single period. What this leaves me with is the problem of determining the amplitude and phase offset in the presence of the sensor's noise.

I'm curious if anyone is aware of a easy to implement method for estimating these two parameters that is optimal in some sense. Most of my research results have been complex algorithms implemented in MATLAB which is not suitable for my application (I'm trying to measure this in real-time and don't have a license).
A simple solution is to calculate the first coefficient of a DFT of appropriate length, using the summation formula instead of FFT. To get amplitude and phase, transform the result to polar coordinates.