# Phase Spectrum of Signals

I did fft of a fish's trajectory, because it looks periodic and I tried to find the frequency. However, I can't understand what does the phase spectrum below represent. Does this lower left to upper right curve have any special meaning?

Below is my Matlab code:

L = length(X);
Fs = 30;            % Sampling frequency
T = 1/Fs;             % Sampling period
t = (0:L-1)*T;        % Time vector
figure;
plot(t,X);
X = X - mean(X);
y = fft(X);
z = fftshift(y);
ly = length(y);
f = (-ly/2:ly/2-1)/ly*Fs;
figure;
plot(f,abs(z))
title("Double-Sided Amplitude Spectrum of x(t)")
xlabel("Frequency (Hz)")
ylabel("|y|")
grid
tol = 1e-6;
z(abs(z) < tol) = 0;
theta = angle(z);
figure;
plot(f,theta/pi)
title("Phase Spectrum of x(t)")
xlabel("Frequency (Hz)")
ylabel("Phase/\pi")
grid

• Can you provide more details about what your did to generate this plot? Usually one looks at the amplitude of the FFT output when looking for periodicity. Commented May 14, 2023 at 10:39
• Read: Odd Symmetry of Phase Response Commented May 14, 2023 at 10:42
• It would be much easier if you put the amplitude on a log scale in dB. Commented May 16, 2023 at 11:44

1. The DFT of a real signal is conjugate symmetric, i.e. $$\varphi(-\omega) = - \varphi(\omega)$$ so the left side of the graph is just the negative of the right half. Most people don't bother looking at negative frequencies since there is no independent information there.
2. Interpreting the phase without looking at the amplitude is tricky. A real measurement will always have some amount of noise and limited signal to noise ratio (SNR) at low frequencies. The phase of $$z=0$$ is undefined and the phase of a small but noisy amplitude is just a random number. That seem to be the case here below maybe 3 Hz or so.
3. The sudden jumps at 11Hz or 12 Hz are phase wrapping issues. You constrain the phase to the interval $$[-\pi,+\pi]$$. That means that if the "real" phase moves a small amount from, say 3.1 to 3.2, in your graph it jumps from 3.1 to -3.08. This can be improved by so-called "unwrapping" algorithms but that's not trivial for measured data with bad SNR at the band edges, so I recommend asking a different question around that.