"dave-compdsp" <
[email protected]> writes:
> Thanks Anton, for your reply. A question:
>>>
>>>1. Window your buffer (hanning should be fine)
>>>2. Rearrange your buffer before the analysis so that the
>>> middle point is at the beginning (otherwise your phase
>>> information will be very bad)
>
> I'm not sure I understand this. Is there a short answer to why it's
> necessary?
To bring the center of the windowed data into the time-origin.
This is called zero-phase windowing.
It always made intuitively sense to me, because the fft phase information
corresponds to the phase at the beginning of the buffer (the time-origin)
and the window will have the strongest suppresion at this point (down to
0 in case of a von Hann window). And for a hanning window the cosine
is at phase pi at this point (because it is -0.5 cos(..))
But now that you ask, I realize that
this is not an explanation.
Some thoughts about it:
The multiplication with the window in the time domain is a convolution
in the frequency domain. So looking at the window for both cases
gives
for the non-rearranged case:
time domain: 0.5 - 0.5 * cos(2*pi*n/(N-1))
freq. domain convolution: [-0.25, 0.5, -0.25]
for the rearranged case:
time domain: 0.5 + 0.5 * cos(2*pi*n/(N-1))
freq. domain convolution: [ 0.25, 0.5, 0.25]
The only difference are the minus signs.
I really hope somebody will enlight me, with a real explanation.
What is the effect on the phase when you apply a hanning window
before taking the fft and how does rearranging the windowed data,
so that the midpoint of the window is in the time-origin, improve
the result?
Some resources for the topic:
F. J. Harris,
"On the use of windows for harmonic analysis
with the discrete fourier transform"
Proceedings of the IEEE, vol. 66, no. 1, pp. 51--83, 1978
(I am not an IEEE member, so I do not have access to this paper)
Here are some pages which talk about how to do zero phase windowing
but there is no in-depth explanation why:
http://ccrma.stanford.edu/~jos/parsh...ut_Buffer.html
http://www.iua.upf.es/~xserra/articl...mputation.html
http://www.dsprelated.com/showmessage/41851/1.php