Phase spectrum range I computed spectrum analysis of sine wave (without windowing and zero-padding) and I got plots as follows:



As far as I know they are correct. When I learnt about DSP, I got the huge problem with understanding what is the phase spectrum. Recently I realised that "phases" are translations along time axis of each sinusoidal component. So I don't see any point to get them out of range $\langle -\pi, \pi \rangle$. I computed my spectrums with python and to get the phase spectrum I used unwrap function from numpy. As I understand this documentation correctly, it is impossible to get the result larger than $\pi$ or less than $-\pi$ unless I set the discount parameter. It does make sense for me.

Could you explain me:


whether I understand the phase spectrum correctly?
why the values of phase spectrum are out of range $\langle -\pi, \pi \rangle$?
how does the function unwrap work?
Yes you can think of phases as describing translations.

If you (kind of passively) wrap the phase to ⟨−π,π⟩ you may be introducing discontinuities that are not truly there considering that −π and π are equivalent. Such artificial discontinuities will hinder calculation of things like group delay.

Unwrapping the phase properly is not trivial. One way to do it properly is to factor the system into such small component systems (connected in series) that you can track the phase frequency response of each without any wrapping ambiguities. The phase frequency response of the composite system will be the sum of those of the component systems. Calculated this way, the phase naturally get values outside of ⟨−π,π⟩. Computationally, the factorization can be done by finding the z-plane zeros of the system. My guess is that numpy.unwrap does nothing of the sort but simply looks for big jumps of the wrapped phase as function of frequency and tries to make those jumps shorter by adding or subtracting 2π. That will easily fail do do a proper job if the frequency response has two zeros at the same frequency, as that gives a jump of 2π that phase unwrapping ought to preserve.