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).

  • $\begingroup$ Hi: you can use a regression model with no intercept so. $y_t = A (sin (\omega t) + \phi)$ where A is amplitude and $\phi$ is phase. There'a trig identity that wlll allow you to rewrite as a sine term + a cosine term. I forget what it is but it's in bloomfeld's text if you have that. $\endgroup$ – mark leeds Jun 7 '19 at 20:42
  • $\begingroup$ @markleeds I'm struggling to even get started with this. Do you have any resources on implementation? $\endgroup$ – Izzo Jun 9 '19 at 19:14
  • 1
    $\begingroup$ I'm sorry. I had the equation wrong. it should be $y_t=A \times sin(ω t+ϕ)$ where A is the amplitude and ϕ is the phase. Can you get your hands on Peter Bloomfield's "Fourier Analysis of Time Series" because the gory details are nicely explained in there. I honestly wouldn't do it justice trying to explain it here. It's essentially a regression where the LHS contains the value of the sinusoid at different values of $t$. $\endgroup$ – mark leeds Jun 10 '19 at 0:39

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.

| improve this answer | |
  • $\begingroup$ I don't fully follow: The Summation Formula calculates exactly the same thing as the FFT; it's just slower, that's why nobody uses it. $\endgroup$ – Marcus Müller Jun 8 '19 at 11:22
  • $\begingroup$ ah, upon re-reading: You just recommend correlating with the appropriate $e^{j2\pi \frac f{f_s} n}$. That's the right way to go! $\endgroup$ – Marcus Müller Jun 8 '19 at 12:06
  • $\begingroup$ I really like this idea. $\endgroup$ – Izzo Jun 9 '19 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.