필터 지우기
필터 지우기

Unwrap does not work for vector

조회 수: 14 (최근 30일)
Will Hardiman
Will Hardiman 2022년 1월 24일
답변: Will Hardiman 2022년 1월 24일
I have a vector, y, calculated as atan(a/b). Naturally when b is close to 0 the tan function exhibits a phase wrap:
y = atan(a/b);
plot(y)
title('Wrapped function')
I can manually check the jump size:
plot(diff(y))
title('Y(n) - Y(n-1)')
Clearly there are jumps greater than 3. But when I use unwrap:
plot(unwrap(y,3))
title('"Unwrapped" function')
The function clearly is not unwrapped. Note I have used a tolerance of 3, and there are differences larger than 3. Even if I set the tolerance to 0.1, the same behaviour occurs.
I have tested this on R2019a and R2020a and see the same behaviour.
What have I done wrong?

채택된 답변

Will Hardiman
Will Hardiman 2022년 1월 24일
I just re-read the documentation for unwrap, where it clearly says:
Q = unwrap(P,tol) compares the jump between elements of P to the jump threshold tol instead of the default value π radians. If you specify a jump threshold less than π, unwrap uses the default jump threshold π.
Perhaps unwrap should give a warning when tol < pi, because it's misleading otherwise?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by