The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to fit a sine wave to under-sampled data
Replies: 3   Last Post: Jan 7, 2013 9:38 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Greg Heath

Posts: 6,387
Registered: 12/7/04
Re: How to fit a sine wave to under-sampled data
Posted: Dec 27, 2012 7:56 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Scott Rauscher" wrote in message <kbg0a3$afm$>...
> I've poured through the forums several times and have almost found a good solution.
> I want to fit a sine wave to some under-sampled constant-frequency/phase/amplitude data. I have hundreds of data files so I need to automate it. I have used SineFit in the file exchange, and it works well most of the time, but has a tendency not to converge. I have also tried sinfapm, but the phase it gives never lines up.
> What I'm trying to do is best illustrated in this picture (red is the data, blue is the sine wave I want to find):
> Does anyone have suggestions on where to start for a full-proof way of doing this?

Not enough info.

Do you get a dominant frequency with the dft ? If so, you can estimate A and B
from the linear problem

xi = A*cos(w*ti) + B*sin(w*ti); % w and ti known

Hope this helps.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.