DSPRelated.com
Forums

Most commonly used window functions

Started by Max November 21, 2015
One thing that no one mentioned yet is that if you are reconstructing a time-domain signal using the ifft (let's assume an overlap of 50%), then the window needs to have the property that when you shift the window by half the frame length and add it to itself, the sum must be 1.0 in the overlapped region. Otherwise alias cancellation doesn't work. This assumes the only window is on the input side; it's also possible to window during the overlap-add operation and then the product of the input and output windows has to meet this condition. 

Anyway this rules out the majority of possible windows, unless you don't care about reconstruction.  

Bob
On Sun, 22 Nov 2015 16:01:48 -0800 (PST), radams2000@gmail.com wrote:

>One thing that no one mentioned yet is that if you are reconstructing a time-domain signal using the ifft (let's assume an overlap of 50%), then the window needs to have the property that when you shift the window by half the frame length and add it to itself, the sum must be 1.0 in the overlapped region. Otherwise alias cancellation doesn't work. This assumes the only window is on the input side; it's also possible to window during the overlap-add operation and then the product of the input and output windows has to meet this condition. > >Anyway this rules out the majority of possible windows, unless you don't care about reconstruction. > >Bob
Very good point, Bob! Which windows still qualify?
On Sunday, November 22, 2015 at 8:15:34 PM UTC-8, Max wrote:
...
> > Very good point, Bob! Which windows still qualify?
You might Google "Princen-Bradley conditions", "perfect reconstruction" and/or "time domain aliasing cancellation" to find a more thorough description of the window requirements. Dale B, Dalrymple
On Sat, 21 Nov 2015 20:36:02 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>There are also specialized windows like the flat-top windows where the >main lobs has a flat top to prevent scalloping in tone amplitude as >the frequency changes (i.e., so the amplitude stays constant, rather >than dipping in between main lobes).
PS: Eric, you've got me thinking about the correlation between window shape and spectrum. It appears that the 'flat top' windows have a sort of sinc-function look. Does this relate to the parallel relationships between FIR filter coefficients and output response? IOW: sinc-shaped coefficients = boxcar response, boxcar coefficients = sinc response Not sure I've got a good handle on why they're mirrored like that yet, but this seems similar...?
On Mon, 23 Nov 2015 01:57:51 -0500, Max <Max@sorrynope.com> wrote:

>On Sat, 21 Nov 2015 20:36:02 GMT, eric.jacobsen@ieee.org (Eric >Jacobsen) wrote: > >>There are also specialized windows like the flat-top windows where the >>main lobs has a flat top to prevent scalloping in tone amplitude as >>the frequency changes (i.e., so the amplitude stays constant, rather >>than dipping in between main lobes). > >PS: Eric, you've got me thinking about the correlation between window >shape and spectrum. It appears that the 'flat top' windows have a >sort of sinc-function look. Does this relate to the parallel >relationships between FIR filter coefficients and output response? > >IOW: > sinc-shaped coefficients = boxcar response, > boxcar coefficients = sinc response >Not sure I've got a good handle on why they're mirrored like that yet, >but this seems similar...?
That's correct, because the FIR filter coefficients and their frequency response are Fourier transforms of each other. Another key to help understand how all this works is that convolution in one domain is multiplication in the other. So if you want to multiply two frequency responses together, say, the spectrum of a signal and a filter frequency response, you can achieve the same thing by convolving the time-domain signal with the FIR filter filter coefficients. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
One of my pet peeves on comp.dsp is people who think you can filter a signal by drawing some arbitrary response curve and multiplying in the frequency domain using a STFT with reconstruction. They don't get that they are breaking the rules for alias cancellation. You need to start with a set of FIR filter coefficients and then transform them into the frequency domain before multiplying with the transform of the input signal. Only then will you get complete alias cancellation.  I think you also need to zero-stuff the FIR array to make sure you get linear convolution and not circular. 

Bob
On Sun, 22 Nov 2015 07:26:03 -0800 (PST), Victor Reijs
<victor.reijs@gmail.com> wrote:

>I think this section of wikipedia is interesting (as it tells when to use rectangular [flat-top] window): >https://en.wikipedia.org/wiki/Window_function#Applications_for_which_windows_should_not_be_used
Not to be too nit-picky, but Rectangular is "no window at all", whereas Flat-Top is a specific special-purpose window (discussed farther down the page in that Wikipedia reference). Best regards, Bob Masta DAQARTA v8.00 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE 8-channel Signal Generator, DaqMusiq generator Science with your sound card!
On Tuesday, November 24, 2015 at 5:28:17 AM UTC-8, Bob Masta wrote:
...
> > Not to be too nit-picky, but Rectangular is "no window at > all", whereas Flat-Top is a specific special-purpose window > (discussed farther down the page in that Wikipedia > reference). > ... > Bob Masta
Not to be any pickier than you Bob, but "no window at all" is an unlimited extent of data. Perhaps the "open window" with all coefficients 1.0 that appears rectangular in the time domain is what you mean. "Flat-top" windows are several families of windows and several different design approaches. Only one example of which is included in the wiki. They may appear rectangular in the frequency domain to a casual observer. This has the effect, noted in the wiki that the time response goes negative, like a sinc function, sincs and rectangles being Fourier transform pairs whichever domain the rectangular falls in. Dale B. Dalrymple
On Tuesday, 24 November 2015 13:28:17 UTC, Bob Masta  wrote:
> On Sun, 22 Nov 2015 07:26:03 -0800 (PST), Victor Reijs > <victor.reijs@gmail.com> wrote: > > >I think this section of wikipedia is interesting (as it tells when to use rectangular [flat-top] window): > >https://en.wikipedia.org/wiki/Window_function#Applications_for_which_windows_should_not_be_used > > Not to be too nit-picky, but Rectangular is "no window at > all", whereas Flat-Top is a specific special-purpose window > (discussed farther down the page in that Wikipedia > reference).
Thanks Bob and dale, I meant indeed a rectangular window. Sorry for making this error! All the best, Victor
On Tuesday, November 24, 2015 at 12:10:28 PM UTC-5, dbd wrote:
> On Tuesday, November 24, 2015 at 5:28:17 AM UTC-8, Bob Masta wrote: > ... > > > > Not to be too nit-picky, but Rectangular is "no window at > > all", whereas Flat-Top is a specific special-purpose window > > (discussed farther down the page in that Wikipedia > > reference). > > ... > > Bob Masta > > Not to be any pickier than you Bob, but "no window at all" is an unlimited extent of data. Perhaps the "open window" with all coefficients 1.0 that appears rectangular in the time domain is what you mean. >
yeah, Dale's right. a rectangular window multiplies some samples by 1 and other samples by 0. my understanding of "no window at all" is that all samples are multiplied by 1. Dale and i might get into a little (mostly semantic, but not entirely) argument about the use of the rectangular window and the DFT. or, at least in the past we had. bestest, r b-j