Wrong phase plot generated by angle()

4 vues (au cours des 30 derniers jours)
Zhaoyang Li
Zhaoyang Li le 8 Oct 2021
Réponse apportée : Paul le 8 Oct 2021
I was trying to plot the phase spectrum of using the angle function, however matlab gives me which is incorrect since the phase of this signal is , and ω is undefined at -1 and 1. The correct plot should be . I wonder if I did something wrong or if it's something intertal of the angle() function.

Réponses (1)

Paul
Paul le 8 Oct 2021
The four-quadrant arctangent is needed to find the angle of a (non-zero) complex number:
syms w real
X(w) = 1/(1 + 1j*w)^2;
phase(w) = atan2(simplify(imag(X)),simplify(real(X)))
phase(w) = 
angle(X(1))
ans = 
phase(1)
ans = 

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by