Unexpected behaviour with the unwrap() command

조회 수: 15 (최근 30일)
Tim
Tim 2023년 3월 28일
댓글: Walter Roberson 2024년 12월 1일
Hi everyone, i have the plots on the left with phasejumps. If I use the command unwrap the phasejumps get eliminated but I don't understand why for curve 2 and 3 the correction results in the negative while for curve 4, the curve gets corrected to the positive. For what I need line 2 and 3 are corrected "wrong" and only curve 4 is as I want it. I use this code line to unwrap since the standard value of the phasejump in my case is smaller than pi/2:
for v=1:k+1
%% X-Richtung
X_unwrap(:,:,v) = unwrap(2.*(X_phi(:,:,v)+pi/2),[],2)./2;
...
I hope i descirbed my problem well enough and if someone could help me I would appreciate it so much! It is for my master thesis.
  댓글 수: 1
Adam Danz
Adam Danz 2023년 4월 4일
If you can attach your data, mainly X_unwrap and the plotting code, I'd be happy to take a closer look.

댓글을 달려면 로그인하십시오.

답변 (1개)

Abhijeet
Abhijeet 2023년 4월 4일
Hi,
It seems the unwrap function is not working properly. You can try the following to debug and solve the issue:
  1. Check the values of X_phi(:,:,v) for indices 2 and 3: One possible reason for the wrong unwrapping could be that the values of X_phi(:,:,2) and X_phi(:,:,3) are not within the expected range. You can check the values of X_phi(:,:,v) using the MATLAB "disp" function or by setting a breakpoint in the code and inspecting the values during runtime.
  2. Check the output of the unwrap function: The unwrap function can sometimes produce unexpected results, especially when the input values are not within the expected range. You can check the output of the unwrap function by using the MATLAB "disp" function.
  3. Use alternative unwrapping methods: If the issue persists, you can try using alternative unwrapping methods, such as the "unwrapToPi" or "unwrapToZero" functions in MATLAB.
I hope by following these steps you should be able to identify and fix any issues with the code and ensure that the unwrapping is performed correctly.
  댓글 수: 2
Devyani Varshney
Devyani Varshney 2024년 12월 1일
There is no command such as "unwrapToPi" or "unwrapToZero"
Walter Roberson
Walter Roberson 2024년 12월 1일
Indeed.
The Mapping toolbox contains wrapToPi and wrapTo2Pi and wrapTo180 and wrapTo360 -- but does not contain corresponding unwrap* functions.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by