Fft why window
Related Pages. Transient and Synchronous Sampling. General data analysis, most common when frequency peaks are not guaranteed to be well-separated from each other. Good tradeoff between frequency and amplitude accuracy, reduced spectral leakage.
Performing Calibration or other single tone amplitude measurements when frequency peaks are likely to be distinct and well-separated from each other. Excellent accuracy for amplitude. When signal spectrum is rather flat or broadband in frequency broadband random, such as white noise.
Two tones with frequencies not well-separated and almost equal amplitudes. It is even more fun to analyse the constituing terms of a window, as I have learned from the Harris article.
It shows how the terms cooperate by phase cancellation to create the desired effect. Below is a spectrum plotted, of a cosine function with the fundamental periodicity of it's 16 point frame, and analysed with point FFT. Like the rectangular window itself, by the way, in it's appearance of framed DC component, constant, cos 0 or whatever describes a straight horizontal line. Is this also a Dirichlet kernel? I normalised with factor 64 for the larger FFT size, but look, the peaks are not at 0.
That makes me suspicious. Let me plot the correlations for positive and negative frequencies separately they are both normalised with an extra factor 0. They are one Dirichlet kernel shifted rightward correlating the positive frequencies and the other shifted leftward for the negative frequencies. The Dirichlet kernel is periodic and therefore the shifts are really rotations. Which resulted from modulating the rectangular window in time domain. These things are common knowledge, but when plotted with these 'inter-bin lobes', it looks disturbing.
Positive frequencies also correlate substantially with negative coefficients? If they are not harmonic with the FFT framesize, they will correlate with all bins - positive and negative will happily penetrate into each others' region. A complicated phase-summation and -cancellation pattern is the result.
Let me plot the spectra of these functions in one figure, but not yet summed:. It is clear that in a sum spectrum of these terms, many coefficients will cancel each other. Let me check this by plotting the spectrum of a window that is composed of these functions, each with half magnitude, the Hann window:. The real parts outside the region of the main peaks are substantially reduced.
All imaginary parts, resulting from the window not being symmetric, are completely eliminated by phase cancellation. This Hann-window therefore is phase-neutral. For a window, this phase cancellation is advantageous, but it also demonstrates how coefficients can eat each other in a sum spectrum, equally so if you did want to see them.
The window-analysed-with-larger-FFT represents it's leakage character, and from there it is possible to express the character in terms of standardised parameters. In order to better compare different window types, the y-values need to be recomputed on a logarithmic scale, so details become more pronounced. But I am not going to do that yet, because first I need to understand what the window actually does to the spectrum of a signal input.
Just as convolution in time domain is equivalent to multiplication in frequency domain, the inverse equivalence is also true. Multiplying the input signal with a window is equivalent to convolution of the signal's spectrum with the window spectrum. So, the window's spectrum is a convolution filter , acting on the input signal's spectrum, but normally implemented as a multiplication in time domain. That is one way to observe it.
What type of filter does the Hann window's spectrum represent, with it's three complex coefficients at x[0], x[1] and x[N-1]? I would say it is a lo-pass filter, which will smoothen an alternating function. Let me just try if that is correct.
Below is the spectrum of a non-windowed cosine function with periodicity Since the function does not harmonize with the FFT framesize, there is a lot of leakage visible. Apart from the central peaks, the coefficients do alternate indeed. These alternating coefficients should now be suppressed to some extent, by applying a window to the input signal:. Cool, that works quite OK!
The spectrum is tidied up, as if the mess was shoveled up onto the central peaks, wich have grown fatter. I am kind of exited to see this at work. The window is a lo-pass filter for the spectrum indeed. Well, nothing could be more logical, considering the shape of the window, which looks like the frequency response of a lo-pass filter Still, I was never aware of this now so obvious fact.
Why was it not obvious? In fact, I am still confused. I was doing my experiments with a zero-phase cosine function, using a time-zero centered FFT. This seems to give correct results. Maybe you have read my page 'Centered FFT'. This must be a hi-pass filter then. Let me check if that is the case. Here is the non-windowed cosine of periodicity High-pass filtering in the non-centered case leads to a similar effect of tidying up the spectrum.
The peak coefficients are alternating, but that is just one symptom of the phase-shifts occurring with a shift in time. There is really no fundamental difference in the window's effectivity. The time-zero-centered case can still be emulated by multiplication with -1 n. Look, this is what we get when analysing with centered FFT, but leaving time zero of the function at the start of the window.
Although it is a matter of choice whether to evaluate over the interval starting with time zero or the interval centered round time zero, I will rather use a time-zero-centered FFT whenever possible. Time zero is the reference point for phase angles, which are in that case correctly expressed as running between -pi till pi, not 0 till 2pi like it is in non-centered FFT.
Reducing the risk of misinterpreting complex coefficients, that is. Now that I start to understand how a window does it's job, I want to compare a couple of them. We need to see a spectrum with 'lobes', caused by an analysis frame much wider than the window. The choice of window controls the trade offs between main lobe width and side lobe spacing and height. Your application specific requirements determine what window to use and there are dozens of choices.
Hanning is just one of them. It's basically "the window of choice if you don't have any better ideas". Personally, I prefer Kaiser windows as they have a continuous parameter that can control the window behavior over a wide range. In general, FFT is not a great method for pitch detection.
For most audio signals the maximum in the spectrum is NOT the fundamental typically harmonics have higher energy , in order to get decent resolution you need a long pieces of data but that makes the algorithm very slow and sluggish to respond to changes. Sign up to join this community. The best answers are voted up and rise to the top.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Why should one use windowing functions for FFT? Ask Question. Asked 8 years ago. Active 3 months ago. Viewed 23k times. Improve this question. Skylion Skylion 1 1 gold badge 4 4 silver badges 12 12 bronze badges.
0コメント