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: Sine fitting
Replies: 4   Last Post: Jun 16, 2012 12:18 AM

Advanced Search

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

Posts: 214
Registered: 12/13/04
Re: Sine fitting
Posted: Jun 16, 2012 12:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Jun 15, 12:00 pm, "Star Strider" <>
> > but the amplitude is still off.  I don't know if I'm still doing something wrong, or if the signal I'm looking for is weaker than I'm expecting.  I also still don't know how to get to the phase shift from here.
> ------------------------------------------------------
> I suggest you consider the (sin, cos) pairs for each your two frequencies (pi/3, pi/6) as phasors.  Generically:
> A*cos(w*t + phi)  =  X*cos(w*t) - Y*sin(w*t)
> A  =  sqrt(X^2 + Y^2)
> phi  =  atan(Y/X)
> If you haven't already (and if I understand your notation), plot Y*Q and HT to see how they compare.  It looks as though you did everything correctly, so Y*Q should be a reasonably good fit to HT.

you may want to use

phi = atan2(Y,X)

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.