Smoothing jumps when using unwrap()

5 visualizaciones (últimos 30 días)
adeq123
adeq123 el 12 de Dic. de 2019
Comentada: Don el 26 de Jul. de 2023
Hello,
I need to use atan() function in my code. That results into zig-zag kind of type result when plotting. Therefore I used unwrap() function which solves the issue. Nevertheless after zooming the plot I can see that the resulting plot has small "jumps" in places where it was unwraped. Is there any robust way to reduce those ?
close all;
y = deg2rad(0:0.1:600)
P = atan(2.2757 * tan(y) ./ (1.6545 + 0.1176*tan(y)));
P = unwrap(rad2deg(P));
plot(y,P);
Thanks for help in advance.

Respuesta aceptada

Alex Mcaulley
Alex Mcaulley el 12 de Dic. de 2019
You need to have a jump higher than pi to avoid the small jumps using unwrap (and this is not you case). Then, a trick you can do:
y = deg2rad(0:0.1:600)
P = atan(2.2757 * tan(y) ./ (1.6545 + 0.1176*tan(y)));
P2 = rad2deg(unwrap(2*P)/2);
plot(y,P);
  2 comentarios
adeq123
adeq123 el 12 de Dic. de 2019
Thanks. That was an precise answer.
Don
Don el 26 de Jul. de 2023
Thanks! The same problem I had has been resolved..

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by