Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 Greg Heath Posts: 214 Registered: 12/13/04
Re: Sine fitting
Posted: Jun 16, 2012 12:18 AM

On Jun 15, 12:00 pm, "Star Strider" <skystriderDELETET...@ieee.net>
wrote:
> > 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.

Greg

Date Subject Author
6/13/12 Daniel
6/13/12 Greg Heath
6/15/12 Daniel
6/15/12 Frank
6/16/12 Greg Heath