# Why dft of moving average impulse response has 0 angle

I wanted to visualise angle and magnitude of moving average DFT. I used python3 for that:

import numpy
irs = [1 / 5] * 5
dft_irs = numpy.fft.fft(irs)
print("dft", dft_irs)
print("magnitude", numpy.absolute(dft_irs))
print("angle", numpy.angle(dft_irs))


I got results that I do not understand

dft [  1.00000000e+00+0.j   0.00000000e+00+0.j   1.38777878e-17+0.j 1.38777878e-17+0.j   0.00000000e+00+0.j]
magnitude [  1.00000000e+00   0.00000000e+00   1.38777878e-17   1.38777878e-17 0.00000000e+00]
angle [ 0.  0.  0.  0.  0.]


Here phase shift is 0 for every frequency while I know it is not for moving average filter. Please help me understand why I got this strange result.

You are looking at the frequency response at multiples of $2 \pi /5$, where the response is either 1 or 0.
If you add several 0 values to the end of irs, you'll get the frequency response at more intermediate frequencies, where you can see that phase is not zero.