I've got a source signal $s_1(t)$ and a system affecting that, yielding a phase-shifted version $s_2(t)$;

\begin{align} \color{blue}{s_1(t)} &= A\sin(t+\phi_1)\\ \color{red}{s_2(t)} &= A\sin(t+\phi_2)\\ \end{align}

The amplitude $A$ is unknown. How many samples (sampling happens periodically) would I need to verify that $\phi_1-\phi_2 = \frac32\pi$?

2 points on the signal and the filtered signal

As a practical example, given these 2 points on each curve: on the purple curve, the original signal:

  • point A (231,3.533151)
  • point B: (230,3.614015)

and on the the filtered signal: the red curve:

  • point C (231,1.398873)
  • point D (230,1.174265)

How would you confirm the phase shift of $\frac32\pi$, given an equal -unknown- amplitude and equal -unknown- frequency of the 2 signals? Is a numerical solution possible for online, causal analysis? Or do you need 3 points on each curve? Thank you.

  • 1
    $\begingroup$ could you cut out the fantasyland cruft? You've got a mathematical question, please don't blow it up through acting backstory makes it better. $\endgroup$ Feb 15, 2020 at 0:45
  • $\begingroup$ also, I think you mean the output of the filter, not the filter itself. $\endgroup$ Feb 15, 2020 at 0:46
  • $\begingroup$ (I don't mean to be harsh, but what we do in math is abstract all day. There's no difference between the harsh realm of reality and fantasyland to us: The rules of math apply to both.) $\endgroup$ Feb 15, 2020 at 0:56
  • 1
    $\begingroup$ Would it be possible to clarify the question a bit? My perception at least is that it provides a setup that undermines the question. What is so special about $\frac{3 \pi}{2}$ ? Do you mean that the filter should have unity gain? $\endgroup$
    – A_A
    Feb 15, 2020 at 8:57
  • $\begingroup$ @A_A I tried to keep the original question intact but to boil it down. $\endgroup$ Feb 15, 2020 at 10:44

2 Answers 2


Two samples is sufficient and we can determine if the phase difference is indeed $\frac{3\pi}{2}$ as follows:

Start with the hypothesis that the phase difference $\phi_1-\phi_2$ is $\frac{3\pi}{2}$, which is equivalent to $-\frac{\pi}{2}$

If and only if the phase is in such quadrature, then $s_1(t)$ and $s_2(t)$ will be the real and imaginary components of a single vector on the unit circle with radius A which can be given as $-jAe^{j(t+\phi_1)} = As_1(t) + jAs_2(t)$. This starts at the angle $\phi_1-\pi/2$ when t = 0 and rotates counter-clock-wise with increasing t, which matches the plot shown with the purple line representing the real axis and the red line representing the imaginary.

Starting from a position on the unit circle at time = $t_1$ with position given by the real and imaginary components $s_1(t_1)$ and $s_2(t_1)$, we can move forward in time to $t_2$ over a determined angle which should predict $s_1(t_2)$ and $s_2(t_2)$. If this prediction matches the given result, then this will confirm the hypothesis:

The starting angle using the first sample as given by B and D is given by $tan^{-1}(s_1(t_1)/s_2(t_1))$ $= tan^{-1}(3.614015/1.174265) = 1.256637 $ radians.

The change is angle to the second sample is simply the difference in time since the frequency unit is 1 radian/sec given by $sin(t)$:

$\Delta\phi = t_2-t_1 = 231-230 = 1$ radian (NOTE! This alone clearly does not match the plot visually, so the numbers given cannot be actually derived from the plot! There must be a frequency factor multiplied by t in the actual formulas for this to match the plot).

Therefore if the phase difference was $-\frac{\pi}{2}$ then the second angle would be at $1.256637 + 1$ radian or $2.256637$ radians and the ratio of $(s_1(t_2)/s_2(t_2))$ would be $\tan(2.256637)= -1.22195$

This does not match the ratio for the second sample given by A and C and therefore the phase difference cannot be $\frac{3\pi}{2}$ for the formulas as given.


You've got a system of equations with 2 unknowns ($A$ and the phase offsets). You hence need two equations. That means two samples.

  • $\begingroup$ No equations are known in this hypothetical scenario. $\endgroup$
    – MisterH
    Feb 15, 2020 at 0:58
  • 1
    $\begingroup$ sampling gives you an equation every time you sample. $\endgroup$ Feb 15, 2020 at 0:59
  • $\begingroup$ If the given is that the input and output are pure sinusoids then you have your equations as knowns. $\endgroup$
    – hotpaw2
    Feb 15, 2020 at 2:14
  • $\begingroup$ @MarcusMüller Two equations with two unknowns can (often, but not always!) be solved when the equations are linear. It might be worth it to show that two equations still suffice when they are not linear? $\endgroup$
    – MBaz
    Feb 16, 2020 at 17:38
  • $\begingroup$ @MarcusMüller Sorry about the semantics. Given these 2 points on each curve: on the purple curve: (230,3.614015), (231,3.533151), and on the red curve: (230,1.174265), (231,1.398873). How would you confirm the given phase shift, given equal -unknown- amplitude and equal -unknown- frequency of the 2 signals? Is a numerical solution possible? $\endgroup$
    – MisterH
    Feb 19, 2020 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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