2

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?
spectre
  • 565
  • 1
  • 8
  • 15
  • 1
    Your map is many-to-one, it cannot be inverted. – Jazzmaniac Sep 29 '20 at 12:34
  • 1
    What do you mean? I want to find actual phase information, without scaling by 2*pi. – spectre Sep 29 '20 at 12:36
  • 1
    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. – Jazzmaniac Sep 29 '20 at 12:39
  • 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. – spectre Sep 29 '20 at 12:41

2 Answers2

3

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).

OverLordGoldDragon
  • 8,912
  • 5
  • 23
  • 74
1

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.

Hilmar
  • 44,604
  • 1
  • 32
  • 63
  • 1
    Thanks. It's disappointing. I could see the values but it's unfortunate that I can't calculate it. – spectre Sep 29 '20 at 13:12