How to Calculate the Hann Low Pass Filter / Kernel for Image Processing
So if I run

#30271

A &lt;- 0.5
B &lt;- 0.5
C &lt;- 0

K &lt;- 5

k &lt;- seq(0,K-1)

w_k &lt;- A - B * cos(2*pi*k/(K-1)) + C * cos(4*pi*k/(K-1))

print(w_k)


and it outputs 

[1] 0.0 0.5 1.0 0.5 0.0


Does that help?