Signal Processing Toolbox | Help Desk |
angle
Phase angle.
p = angle(h)
p = angle(h)
returns the phase angles, in radians, of the elements of complex vector or array h
. The phase angles lie between -m = abs(h) p = angle(h)To convert back to the original
h
from its magnitude and phase:
i = sqrt(-1) h = m.This function is part of the standard MATLAB environment. Calculate the phase of the FFT of a sequence:*
exp(i*
p)
t = (0:99)/100; % time vector x = sin(2Plot the phase:*
pi*
15*
t) + sin(2*
pi*
40*
t); % signal y = fft(x); % compute DFT of x p = unwrap(angle(y)); % phase
f = (0:length(y)-1)'/length(y)*
100; % frequency vector
plot(f,p)
angle
can be expressed as:
angle(x) = imag(log(x)) = atan2(imag(x),real(x))