I need to change a graphic without using unwrap

조회 수: 2 (최근 30일)
Patricio Morales
Patricio Morales 2022년 6월 29일
댓글: Jonas 2022년 6월 30일
Please I need a Matlab expert!!
I need this totally discontinuous graph to be transformed into a continuous graph like the one in the following figure, but without using the unwrap function that is built into Matlab. I need if you can guide me and show a code which will help me to achieve the continuity of the graph. It is very important not to use the unwrap function to achieve the goal. Thank you in advance
This is the graph or discontinuous function
I need to get to this graph or function without using the unwrap function

답변 (1개)

Jonas
Jonas 2022년 6월 29일
you can unwrap manually. if you have data x and y
myWrapThr=-150;
dy=diff(y);
dy(dy<myWrapThr)=dy(dy<myWrapThr)+180;
newY=cumsum([y(1) dy]);
  댓글 수: 2
Patricio Morales
Patricio Morales 2022년 6월 29일
Could you explain the estimated code in a little more detail?
Why is myWrapthr -150?
Jonas
Jonas 2022년 6월 30일
your aim is to remove the jump from approx. +90 to -90. This would equal of exactly -180. depending on the last point before the jump and the first after, the values could also be +86 and -88, then the difference would be only -174. the vatch this natural unprecision, i use a threshold of -150. You could also use -175 as threshold or -170. So my choosing was very generous ;)
this jump values are the corrected by 180 to remove the jump and then the vector is reformed using cumsum on the differental dy
note two things: at the moment the given code only removes jumps near -180 and not +180. But the code can be easily adjusted or expanded for such behavior.
the other point is the unwrapping itself: normally unwrapping is used for visual phase jumps of signals, but those are normally between +-180, or 360 in absolute terms. phases of +- 180 are the equal, but +-90 are not

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

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by