I understand how to get the Amplitude and frequency but not sure the phase shift? How does the it derive to π/4?
Please advise.
You can see that the graph of the sine wave does not go through (0.0, 0.0). This fact alone tells you that there is a phase shift.
After telling that there is a phase shift, you want to know how much it is. To do this, you have to look where the point of the sine wave is which would normally go through (0.0, 0.0). Here, you can imagine that the wave would extend beyond the left border of the diagram until it reaches 0.0 on the y axis. That's called a zero-crossing. You now have to measure the distance on x between this zero-crossing and 0.0 on x. That's the phase shift.
Initially, from this diagram, your result is a phase shift measured in seconds, although this is valid, it is not the usual unit used for phase shifts. To get the phase shift in the usual unit, which is radian, use phi = timeDelta * f * 2pi
.
Generally, the phase shift is the x-distance between (0.0, 0.0) and the next zero-crossing to the left, given in an angle, usually in radian, sometimes also given in degree.