I have an acceleration record and i want to smooth it's spectrum by using a hanning window with Bandwidth=0.5 Hz.
How could i do that?
Example in python/matlab will be appreciated!
You can generate Hann window of size $N$ and use it to window your signal $x$ using the MATLAB command
w=hann(N); x_windowed = x.*w;
Since you specified BW of 0.5Hz, you need normalize it with your sampling rate $F_s$. That is $w_s = \pi 0.5/F_s$. You need to choose $N$ such that your main lobe width of the Hann window falls at $w_s$. It is not an easy problem and you may have to do trial and error initially. You can use
freqz(w) command in MATLAB to see the frequency plot of Hann window. You can hover an see at what normalized frequency your main lobe width is.