DSPRelated.com
Forums

Most commonly used window functions

Started by Max November 21, 2015
On Saturday, November 21, 2015 at 1:55:05 PM UTC-5, Max wrote:
> The window functions that I generally see are: Hamming, Hann (why call > it Hanning?),
there is no good reason. one of the bad reasons to call the Hann window "Hanning" is because MATLAB does. another of the bad reasons is that some electrical engineers in the 60s and 70s conflated the Hann and Hamming windows a lot, because of their similar shape and somehow morphed the names. and then the historical mistake got stuck somehow. sorta like the historical mistake that some mathematicians made a long time ago counting from 1 (instead of counting from 0). but that mistake in convention still does not excuse MATLAB for its hard-wired index origin being 1. r b-j
On Sunday, November 22, 2015 at 11:15:34 PM UTC-5, Max wrote:
> 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?
windows that are "complementary". with the proper scaling (either time or amplitude or maybe both), these are complementary: Rectangular Hann Hamming (times 0.92) triangular (is that the Blackman)? a "flattened Hann" window that i introduced in 1994 ( https://www.researchgate.net/publication/255966071_A_Detailed_Analysis_of_a_Time-Domain_Formant-Corrected_Pitch-Shifting_Algorithm ) only to later understand that it is a time-domain counterpart to the frequency response of the Daubechies 4-tap (or "D4") halfband filter. so it isn't **really** new (but i was surprized to see Carla Scaletti refer to it as the "BristowJohnson" window in the Kyma manual http://www.symbolicsound.com/zzz/pub/Learn/KymaOldDocumentation/Kyma4.5Manualbody.pdf ) you could use the same philosophy and describe an infinite number of complementary windows. r b-j
On Monday, November 23, 2015 at 12:48:13 AM UTC-5, dbd wrote:
> 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. >
whoa, Dale, i just looked this up. the complementariness applies to the *square* of the window, at least according to http://research.microsoft.com/pubs/68201/Malvar_TSP498.pdf , not the window itself. maybe i am reading it wrong. (never heard of "Princen-Bradley conditions" before.) r b-j
If a window is complementary in the square then it needs to be applied twice (analysis plus synthesis). There is some advantages to using a window during construction if you are doing dynamic frame-by-frame spectral modifications since it smooths the transitions (ok I'm guessing about this but it has a certain ring of truthiness). 

Bob
On Tuesday, November 24, 2015 at 9:40:26 PM UTC-8, robert bristow-johnson wrote:
...
> whoa, Dale, i just looked this up. the complementariness applies to the *square* of the window, at least according to http://research.microsoft.com/pubs/68201/Malvar_TSP498.pdf , not the window itself. maybe i am reading it wrong. (never heard of "Princen-Bradley conditions" before.) > > r b-j
Yes the square; 'complementary' means 'energy complementary'. That's one of the Princen-Bradley conditions, which is why I suggested the OP look for them to get the real literature instead of what was posted here. (People have been using them whether you have heard of them or not.) Dale B. Dalrymple
On Wednesday, November 25, 2015 at 5:25:38 AM UTC-8, radam...@gmail.com wrote:
> If a window is complementary in the square then it needs to be applied twice (analysis plus synthesis). There is some advantages to using a window during construction if you are doing dynamic frame-by-frame spectral modifications since it smooths the transitions (ok I'm guessing about this but it has a certain ring of truthiness). > > Bob
Yes, the Princen-Bradley conditions are the required relationship between the two windows used in the analysis/synthesis system. Dale B. Dalrymple
On Wednesday, November 25, 2015 at 12:12:33 PM UTC-5, dbd wrote:
> On Tuesday, November 24, 2015 at 9:40:26 PM UTC-8, robert bristow-johnson wrote: > ... > > whoa, Dale, i just looked this up. the complementariness applies to the *square* of the window, at least according to http://research.microsoft.com/pubs/68201/Malvar_TSP498.pdf , not the window itself. maybe i am reading it wrong. (never heard of "Princen-Bradley conditions" before.) > > > > Yes the square; 'complementary' means 'energy complementary'. That's one of the Princen-Bradley conditions, which is why I suggested the OP look for them to get the real literature instead of what was posted here. (People have been using them whether you have heard of them or not.) >
well, as far as i can tell, complementary of the square is *not* gonna work right with the phase vocoder or a similar sinusoidal modeling process. you want it so that if you set the process to be a null process, then the output should equal the input (perhaps with a known delay). r b-j
On Wednesday, November 25, 2015 at 12:26:43 PM UTC-5, dbd wrote:
> On Wednesday, November 25, 2015 at 5:25:38 AM UTC-8, radam...@gmail.com wrote: > > If a window is complementary in the square then it needs to be applied twice (analysis plus synthesis). There is some advantages to using a window during construction if you are doing dynamic frame-by-frame spectral modifications since it smooths the transitions (ok I'm guessing about this but it has a certain ring of truthiness). > > > > Bob > > Yes, the Princen-Bradley conditions are the required relationship between the two windows used in the analysis/synthesis system. >
i seem to remember Jean Laroche or Miller Puckette telling us about doing that, applying the Hann window both at analysis and then at synthesis, but, if i remember right, you needed to have 75% overlap for the thing to come out correctly (the output of the null process being identical to the input). r b-j
On Wednesday, November 25, 2015 at 2:18:35 PM UTC-8, robert bristow-johnson wrote:
> ... > well, as far as i can tell, complementary of the square is *not* gonna work right with the phase vocoder or a similar sinusoidal modeling process. you want it so that if you set the process to be a null process, then the output should equal the input (perhaps with a known delay). > > r b-j
That's exactly what Princen and Bradley designed to do. J. P. Princen and A. B. Bradley "Analysis/synthesis filter bank design based on time domain aliasing cancellation", IEEE Trans. Acoust., Speech, Signal Processing, vol. 34, pp.1153 -1161 1986 J. P. Princen , A. W. Johnson and A. B. Bradley "Subband/transform coding using filter bank designs based on time domain aliasing cancellation", Proc. ICAASP, pp.2161 -2164 1987 Dale B. Dalrymple
On Wednesday, November 25, 2015 at 6:11:57 PM UTC-5, dbd wrote:
> On Wednesday, November 25, 2015 at 2:18:35 PM UTC-8, robert bristow-johnson wrote: > > ... > > well, as far as i can tell, complementary of the square is *not* gonna work right with the phase vocoder or a similar sinusoidal modeling process. you want it so that if you set the process to be a null process, then the output should equal the input (perhaps with a known delay). > > > > r b-j > > That's exactly what Princen and Bradley designed to do. > > J. P. Princen and A. B. Bradley "Analysis/synthesis filter bank design > based on time domain aliasing cancellation", IEEE Trans. Acoust., Speech, > Signal Processing, vol. 34, pp.1153 -1161 1986 > > J. P. Princen , A. W. Johnson and A. B. Bradley "Subband/transform coding using filter bank designs based on time domain aliasing cancellation", Proc. ICAASP, pp.2161 -2164 1987 >
well, i don't have access to that. but as i look around, it seems to have application to MDCT used in a codec like Dolby AAC. now we know that complementary power crossfades (that's the term i am using, i am viewing a window as the concatenation of a fade up function followed by a fade down function) is what you use for incoherent phase sinusoids. but if the sinusoids are coherent (and all of the phase vocoders i have worked on made sure that every sinusoid had its phase adjusted so that they were coherent across adjacent frames) the crossfades must be complementary **voltage**. they must cross-over when they're both at 0.5 (whereas the complementary power crossfades cross over when both are at 0.707). so, there *is* *no* perfect reconstruction (assuming a null process) using these complementary power crossfade windows **unless** the overlap is 75% (as pointed out by Laroche and Puckette). these authors you are citing *must* be talking about "good" reconstruction in the case where the phases are incoherent, and in that case complementary voltage crossfades will suffer a dip in amplitude at the crossover point. i've thunk that the DCT *does* trash phase at analysis, but i didn't realize that the phase at reconstruction would be randomized at synthesis. no? i thought the phases of each frequency component were all fixed to 0 in the DCT or something like that. r b-j