Documentation Center

  • Trial Software
  • Product Updates



angle is a MATLAB® function.

Signal-Specific Example

FFT Phase

Generate a signal and compute its DFT. Find the phase of the transform and plot it as a function of frequency.

t = (0:99)/100;                        % Time vector
x = sin(2*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
xlabel 'Frequency (arb.)'
ylabel 'Phase (rad)'

Was this topic helpful?