What is difference between unwrap(angle(X)) and phase(X)?

213 visualizaciones (últimos 30 días)
N/A
N/A el 4 de En. de 2017
Comentada: Idin Motedayen-Aval el 18 de Nov. de 2024 a las 16:30
I am manipulating a CSI (channel state information) a.k.a channel matrix containing complex numbers. And I want to extract phases from them. Hence,:
% X is a channel matrix of size 3 x 30
angle_ = angle(X);
angel_unwrapped_ = unwrap(angle_); % default tolerance is pi. Ref: help unwrap
for i = 1:3
phase_(i, :) = phase(X(i, :)); % always takes only one argument. phase_ is maed to keep it continuous over the pi-borders.. Ref: help phase
end
So, I understood that both functions unwrap() and phase() seem to have the same phase tolerance, pi.
But I've been confused becaseu of a figure below I've got:
I wonder why to functions show different wrapping behavior.
Just in case, I've attached the channel matrix data file.
  2 comentarios
Walter Roberson
Walter Roberson el 4 de En. de 2017
Please show
which -all phase
I am having difficulty locating a Mathworks phase() routine
N/A
N/A el 4 de En. de 2017
In my case,
C:\Program Files\MATLAB\R2015b\toolbox\ident\idobsolete\phase.m
C:\Program Files\MATLAB\R2015b\toolbox\ident\ident\@iddata\phase.m % iddata method

Iniciar sesión para comentar.

Respuesta aceptada

Zhao Wang
Zhao Wang el 9 de En. de 2017
I understand that you want to extract phase angles from channel matrix (which is 'csi' in the data file). However, using the script you provided, I am not able to get the same plot you had.
The difference is that using the "unwrap" function leads to phase angles within a range of [-5 5). This behavior is expected with regards to the documentation page in the following help link.
As described in the above page, the default tolerance of the "unwrap" function is 'pi'. Most of the phase angle jumps (in absolute values) are less than 'pi' in the original phase angle matrix. As a result, the result of using the "unwrap" function includes three sawtooth-shape curves within a range of [-5 5).
The difference you saw might be caused by the tolerance used in the "phase" function. You can inspect the code of this function by executing the following command in the MATLAB Command Window:
>> edit phase
The tolerance used by the "phase" function is '3.5' at line 26. This value is larger than the default tolerance used by the "unwrap" function. If you modify the tolerance in the "phase" function and use it to process the data in 'csi', the result is similar to the curves in the middle plot you had.
  2 comentarios
Walter Roberson
Walter Roberson el 9 de En. de 2017
This agrees with the analysis that I did. The phase function uses a different tolerance on wrapping.
Also, unwrap() watches out for the possibility of gaps that span multiple 2*pi groups, but phase() does not.
Idin Motedayen-Aval
Idin Motedayen-Aval el 18 de Nov. de 2024 a las 16:30
For completeness: phase() was a function in System Identification Toolbox that is now obsolete (it has been removed).

Iniciar sesión para comentar.

Más respuestas (1)

Rune Dueholm Bådsgård
Rune Dueholm Bådsgård el 15 de En. de 2018
Can I ask which app you are using for the phase function?
  1 comentario
N/A
N/A el 15 de En. de 2018
Indoor positioning (AoA, ToA) using IEEE 802.11 CSI (wireless channel).
Is that what you want? I am not sure whether I understood your question correctly.

Iniciar sesión para comentar.

Categorías

Más información sobre Uncertainty Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by