2
$\begingroup$

I'm working on extracting the phase information in a given signal in MATLAB. I've the following vector;

signal = [exp(1i*10) exp(1i*100) exp(1i*1000) exp(1i*10000)];

When I use angle function in MATLAB to calculate the phase value, it returns the following result.

angle(signal) = -2.5664   -0.5310    0.9735   -2.8310

I want to calculate the original phase values, as follows,

  [10 100 1000 10000];
  1. How to find the original phase values above interval [-π,π] in MATLAB?
$\endgroup$
4
  • 1
    $\begingroup$ Your map is many-to-one, it cannot be inverted. $\endgroup$
    – Jazzmaniac
    Sep 29, 2020 at 12:34
  • 1
    $\begingroup$ What do you mean? I want to find actual phase information, without scaling by 2*pi. $\endgroup$
    – spectre
    Sep 29, 2020 at 12:36
  • 1
    $\begingroup$ Measuring the angle of a wheel does not tell you how many full rotations is has done to get there. I'm not sure what you're not understanding. $\endgroup$
    – Jazzmaniac
    Sep 29, 2020 at 12:39
  • $\begingroup$ I'm not interested in measuring the angle. I only want to find out the phase value. For ex: Phase value may contain frequency offset value. In that case, I'm not interested in just angle, but the entire phase value, so that I could extract the frequency offset value. $\endgroup$
    – spectre
    Sep 29, 2020 at 12:41

2 Answers 2

3
$\begingroup$

You can, if you increase phase between samples slowly enough, using unwrap(angle(signal)). "Slowly enough" means the phase doesn't jump by more than $2 \pi$; unwrap works by tracking "total phase". Python equivalent implementation here (note you can configure discont there for jumps greater than $\pi$ (or TOL) but it's pointless with angle since it outputs within $[-\pi, \pi]$).

Otherwise, can't, as described by others. For an infinite number of inputs, you get the same output, like asking "what's $N$ in $N\ \%\ 2 = 0$" (division by 2 remainder).

$\endgroup$
1
$\begingroup$

You can't.

$y = e^{ix}, x \in \mathbb{R} $ is a many to one relationship , that means it's not uniquely invertible. Angles are periodic in $2\pi$ so there is no reason to. $10000$ and $10000+2*pi$ are the SAME anle.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks. It's disappointing. I could see the values but it's unfortunate that I can't calculate it. $\endgroup$
    – spectre
    Sep 29, 2020 at 13:12

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.