Reply by Bernhard Holzmayer September 9, 20042004-09-09
Rick Lyons wrote:

> On Tue, 07 Sep 2004 09:07:15 +0200, Bernhard Holzmayer > <holzmayer.bernhard@deadspam.com> wrote: > > (snipped) >> >>Sorry for the delayed question >>(holidays on the lake of Constance (Germany) were splendid!), > > (snipped) >> >>Bernhard > > Hello Bernhard, > > ah, you are breaking my heart! > > Lake Constance, ... I'd give almost anything to > sit with my feet in the lake, look at the surrounding > hills, and drink a local German pilsner beer! > > If there is no Lake Constance and no German pilsner > beer in heaven, then I don't want to go to heaven. > > [-Rick-]
In any case, I'll be there, and I can share my memories with you. Indeed, I live only 90km away from the lake and some 100km from Constance. In reach for a one-day-journey.
Reply by axlq September 8, 20042004-09-08
 [posted and emailed]

Rune, your original article expired off this server, but I just came
across something in my files that may be of interest to you.

In your original article
http://groups.google.com/groups?selm=f56893ae.0408310548.8ba60b4%40posting.google.com
you wrote:

>I'm playing a bit with window functions in filter design etc, and >have come across a couple of gruelling expressions. More specifically, >the Chebychev window [1, eq. 5-17], the Tukey window [2, table 8.1] >and the Lanczos window, [2, table 8.1]. > >I would like to know how one estimates the width of the main lobe >for these filters, and how one uses the various control parameters. >Table 8.1 in P&M seems to contain quite a few typos, which does not >exactly help me understand what's going on.
The classic, seminal paper on Window functions, written with comprehensive reference tables and illustrative plots, is Frederic J. Harris, "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform," Proceedings of the IEEE, Vol 66, No. 1, January 1978. (This is the same Harris of the Blackman-Harris window function.) Windows are known by several names, and I don't see Chebychev or Lanczos in that paper, but they may be known as something else (there's a Dolph-Chebychev, which may be what you mean). The Tukey is also known as a cosine-taper window, and a triangle window is also known as a Fejer or Bartlett, for example. For all the window functions, he has this table of "figures of merit" showing highest sidelobe level, sidelobe falloff, coherent gain, equivalent noise bandwidth, 3 dB bandwidth, scallop loss, worst case processing loss, 6 dB bandwidth, and overlap correlation. The paper covers 23 types of windows, some having sub-types constructed by different control parameter values, with data and pictures of each. Even if this paper is not useful for your particular problem, it's still a generally useful reference to have available. I find I have referred to it many times in the past 20 years. Many others reference it also, but the paper doesn't seem available on the web. -Alex [posted and emailed]
Reply by Bernhard Holzmayer September 8, 20042004-09-08
Jerry Avins wrote:

> Bernhard Holzmayer wrote: > >> Jerry Avins wrote: >> >> >>>Stan Pawlukiewicz wrote: >>> >>> >>>>Jon Harris wrote: >>> >>> ... >>> >>> >>>>>That may be true, but the windowing technique can be very >>>>>useful when you need >>>>>to calculate filter coefficients "on the fly". >>>>>Computationally, it is much >>>>>simpler than the optimized methods. So while it might be >>>>>sub-optimal, I wouldn't say it is obsolete. >>>>> >>>>> >>>> >>>>Signal Processing with flies should be called FSP ;) >>> >>>The dyslexics among us sometimes store data in flies. >>> >>>Jerry >> >> >> Sorry for the delayed question >> (holidays on the lake of Constance (Germany) were splendid!), >> but the food chain of curiosity seems to be closed-loop: >> I still want to know what OY! in the topic means! >> >> Is it another stroke of applied dyslexics, and should read OT >> instead, or is it just a personalized form which has to do with >> the last letter of JerrY ? >> >> Bernhard > > It started as a typo; T and Y are adjacent keys. Then I laughed at > the shortening of "Oy Weh!"
Great. That's really something that had swept through my mind, though I don't speak Yiddish. Ten years ago, I'd been in Isreal on a guided tour. In an old synagogue, a very old (around eighty, I guess) man told us all the story of the synagogue - around 20..30 min. In the beginning I didn't understand anything. But the longer I listened to the man, the more familiar I got with the tune. After a while, I really started to get hold of the meaning of what he was saying. Only with my understanding of German (and maybe some other languages like English...). Was really amazing.
> (spelled "oy, vay" in Yiddish > transliteration to English) and decided to leave it. I apologize > for the distraction. > > Jerry
Reply by Rick Lyons September 7, 20042004-09-07
On Tue, 07 Sep 2004 09:07:15 +0200, Bernhard Holzmayer
<holzmayer.bernhard@deadspam.com> wrote:

  (snipped)
> >Sorry for the delayed question >(holidays on the lake of Constance (Germany) were splendid!),
(snipped)
> >Bernhard
Hello Bernhard, ah, you are breaking my heart! Lake Constance, ... I'd give almost anything to sit with my feet in the lake, look at the surrounding hills, and drink a local German pilsner beer! If there is no Lake Constance and no German pilsner beer in heaven, then I don't want to go to heaven. [-Rick-]
Reply by Fred Marshall September 7, 20042004-09-07
"Jerry Avins" <jya@ieee.org> wrote in message
news:41385dd5$0$19718$61fed72c@news.rcn.com...
> Fred Marshall wrote: > > > "Rune Allnor" <allnor@tele.ntnu.no> wrote in message > > news:f56893ae.0409020113.3692a8c0@posting.google.com... > > > >>r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message > > > > news:<41365058.204625031@news.sf.sbcglobal.net>... > > > >>>The DFT of Eq. [1]'s w1(n) is neither real-only nor does > >>>it's freq-domain samples have the correct amplitudes. > >>> > >>>I now think the correct N-point Hamming equation > >>>should be: > >>> > >>>w2(n) = 0.54 - 0.46*cos(2*pi*n/(N)) [2] > >>>for n = 0,1,2,...,N-1. > >>> > >>>If you plot w2(n) in the time domain it does not "look > >>>symmetric". The w2(n) sequence's first and last samples > >>>are not equal. But the DFT of Eq. [2]'s w2(n) is real-only > >>>and it's freq-domain samples do have the correct amplitudes > >>>(0.23N, 0.54N, and 0.23N). > >>> > >>>I want to call w2(n) "DFT symmetric", because if we circularize > >>>(is that a word) it, by repeating it over and over, making > >>>it periodic, then it becomes symmetrical. > >> > >>It's lunchtime and my head is not quite as foggy as when I made my > >>first attempt at answering your post this morning: > >> > >>Should't you use a N-1 pt DFT and leave one end-point out of it? > >> > >>If so, the formulas are correct, and the end points of the windows > >>appear twice in an analysis where they should appear only once. > >> > >>Could this account for the apparent error? > > > > > > Yes. As you say: In a normal N-point FFT we are assuming that the first > > input sample is repeated at N+1. The resulting FFT has the same
property ->
> > N samples with the N+1th sample assumed to be the same as the first. > > > > We would similarly view a window as being periodic with the N+1th point
the
> > same as the first. So, for the window to be symmetric it would have N+1 > > symmetrical points with the N+1th point removed (and assumed). > > > > Fred > > Early in my exploration of DSP, I did a paper design of a windowed > Hilbert Transformer with an odd number of taps (so there would be a > middle tap for matching pure delay). The ripple increases toward the > band edges. To get symmetric ripple, I needed the window's end values to > be the same. Are you saying that filter coefficients and measured data > need to be windowed differently? I'm asking, not maintaining a position. > > The argument about the (N+1)st sample repeating the first (I would have > written the Nth repeating the zeroeth) is persuasive, but what happens > with zero padding?
With zero padding it's different because the assumed period is longer than the length of the window. Thus, the entire window would be captured *within* the sequence and no part of it repeated. Let's think about windows that are *not* zero at the ends. Then it's easier to think about what crimes are committed. A raised cosine on a pedestal or gate is a good example. If we start with N samples that are to be windowed. Then we'd compute a length N+1 window and truncate by 1 sample - as we've been discussing. As long as we stay with N samples, then the sequence is a consistent periodic function. If we start with N samples that are to be windowed and to be zero padded, then we would compute a length N window and apply it on the nonzero data sequence. One might ask: "Why is there a difference in the actual window applied between taking N samples and N samples zero padded?" In the one case, the periodicity in frequency will occur at intervals of 1/T samples with spacing 1/N: First point at index zero. Last point at index N-1. Total points: N Repeats at index N at 1/T with the same value as at index zero. In the latter case, the periodicity in frequency occurs at intervals of 1/T with spacing of 1/(N+M) samples: Fist point at index zero. Nth point at index N-1. Last point at index N-1+M. Total points N+M Repeats at index N+M at 1/T with the same value as at index zero. Simple cases: Case 1 even data Window [1/2 1 1/2] N+1=3 Truncated window [ 1/2 1 ] N=2 Data: [1 1] N=2 Periodic data: [1/2 1 1/2 1 1/2 1 ...... ] Case 2 odd data Window [1/2 1 1 1/2] N+1=4 Truncated window [ 1/2 1 1] N=3 Data: [1 1 1] N=3 Periodic data: [1/2 1 1 1/2 1 1 1/2 ...... ] Case 3 even data padded Window [1/2 1 1/2] N+1=3 Truncated window [ 1/2 1 ] N=2 Data: [1 1] N=2 Padded data: [ 1 1 0 0] M=2 Periodic data: [1/2 1 0 0 1/2 1 ...... ] which doesn't make sense to do Case 4 odd data padded Window [1/2 1 1 1/2] N+1=4 Truncated window [ 1/2 1 1] N=3 Data: [1 1 1] N=3 Padded data: [1 1 1 0 0 0] Periodic data: [1/2 1 0 0 0 1/2 1 1 0 ...... ] which also doesn't make sense to do. The obvious conclusion is that the window needs to be a different length if one is going to zero-pad the *same* data as follows: Case 5 even data padded: Window [1/2 1/2] N=2 (instead of N=3) Truncated window (does not apply) Data: [1 1] N=2 (as before) Padded data: [ 1 1 0 0] M=2 Periodic data: [1/2 1/2 0 0 1/2 1/2 ...... ] Case 6 odd data padded: Window [1/2 1 1/2] N=3 (instead of N=4) Truncated window (does not apply) Data: [1 1 1] N=3 Padded data: [1 1 1 0 0 0] Periodic data: [1/2 1 1/2 0 0 0 1/2 1 1/2 0 0 0 ...... ] So, if zero padding is going to be used, the calculated window should be the same length as the data. If zero padding isn't going to be used, the calculated window should be 1 longer than the data and truncated. I think this makes sense.... Fred
Reply by Jerry Avins September 7, 20042004-09-07
Fred Marshall wrote:

> "Jerry Avins" <jya@ieee.org> wrote in message > news:4138af32$0$19728$61fed72c@news.rcn.com... > >>Fred Marshall wrote: >> >> >>>"Jerry Avins" <jya@ieee.org> wrote in message >>>news:4138592b$0$19725$61fed72c@news.rcn.com... >>> >>> >>>>Fred Marshall wrote: >>>> >>>> >>>>>Jerry, >>>>> >>>>>If the end points are zero then you need to use them. And, the results >>> >>>are >>> >>> >>>>>not the same. >>>>> >>>>>That is, if I understand you: >>>>> >>>>>a) Calculate an N+2 window with zero end points and throw out both zero >>> >>>end >>> >>> >>>>>points to get a length N window. >>>>> >>>>>b) Calculate an N+1 window with zero end points and throw out one zero >>> >>>(the >>> >>> >>>>>N+1th) end point to get a length N window. >>>>> >>>>>In a, there are no zero end points at all. >>>>>In b, there is a zero on the first point and an assumed zero on the >>> >>>N+1th >>> >>> >>>>>point. >>>>>So, they are different. >>>>> >>>>>Fred >>>>>But, you will drop one of them because it occurs on the N+1th == the >>> >>>first >>> >>> >>>>>location (repeats). >>>> >>>>Let's stay with the non-circular symmetric case. I collect N samples and >>>>window them to prepare for a DFT with a window of length N. The first >>>>and last window coefficients are zero, so the first and last samples >>>>that the N-point DFT operates on are zero. Except for the bin spacing, I >>>>will get the same results by discarding the end samples and running an >>>>(N-2)-point DFT. Why did I bother to collect those samples? >>> >>> >>>Jerry, >>> >>>I think we're talking about two different things. And, the second > > sentence > >>>above isn't really proper - which is what we *are* talking about I > > think. I > >>>suppose we've all done what you describe, but it isn't really proper I >>>believe - Rick's point. >>> >>>What's (I think) proper is to prepare for a DFT with a window of length > > N+1 > >>>and drop the last sample in the window to apply it to a sequence of > > length N > >>>and do a DFT of length N. >>>(I have said nothing about zeros at the ends one way or another). >>>And, this has nothing to do with efficiency or collecting samples, just >>>plain proper math. >>> >>>Now, if you want to say that a particular window is going to have zeros > > at > >>>the ends, then you could collect one fewer sample - the first one - and > > pad > >>>a single zero at the beginning of the array > > beforedoingtheDFT.Whichever > >>>is best for your situation is fine. >>> >>> >>> >>>>Conversely: I use a window of length N+2, discarding the zero end >>>>points. After applying the truncated window to the data, I pad the >>>>result with a zero at each end, achieving what is indistinguishable from >>>>what would be had starting with N+2 samples. Where did those two free >>>>samples come from? They ain't no free lunch. Those samples were there >>>>all along; this time, I didn't throw them away. >>> >>> >>>You start with the idea that there will be an N+2 point DFT, right? >>>I prefer to keep the DFT at N points just to keep apples to apples. >>>So, then is this what you're saying: >>> >>> >>> >>>>Conversely: I use a window of length N [that has zero end points), >>>>discarding the zero end points. >>>>After applying the truncated window to the data, I pad the >>>>result with a zero at each end, achieving what is indistinguishable from >>>>what would be had starting with N samples. Where did those two free >>>>samples come from? They ain't no free lunch. Those samples were there >>>>all along; this time, I didn't throw them away. >>> >>> >>>It's the same deal. You would compute a window of length *N+1* [that > > has > >>>zero end points] discarding one end point for an apparently asymmetrical >>>window (Rick's point). Now you have a window of length N, that has a >>>starting point of zero, to be applied to a data sequence of length N . > > If > >>>you would like to not capture the first sample or multiply by zero, > > either > >>>one, and pad the sequence with a zero at the beginning - th > > at'sfine.It > >>>doesn't change the fact that you need to compute the window to be one > > sample > >>>longer than the data and truncate the window by one sample before > > applying > >>>it. >>> >>>Fred >> >>I'm confused, but that's not new. Suppose I collect 65 samples, then pad >>out to 128 for easy FFT. (I know don't have to, but I'm lazy.) I surely >>don't want a window of length 128; that would be about as bad as no >>window at all. It seems to me that I want to taper the significant >>samples to zero at both ends -- or just outside them. I just don't see >>how driving one end but not the other to zero makes sense here. > > > Jerry, > > We agree - if you're going to zero pad then the situation changes. > > In that case, the periodicity is longer than the non-zero part. > In that case, I would apply the full window over the non-zero part. > > Still, I would caution that not all windows are zero at the edges. So, you > don't want to throw out the ends of the window. > What you want to do is apply a length N window to a length N sequence and > then zero pad the result with M zero-valued samples - in principle. > > Now, if you do have a window with zero edges then you could do one of two > things (at least): > Have the windowed sequence of length N start with a zero value and end with > a zero value plus the zero padding of M zero-valued samples - same as above. > or > Have the windowed sequence start with the first non-zero sample and then end > with a zero value (length N-1) plus the zero padding of M as above, plus one > zero-valued sample to bring the N-1 up to N. This is simply a one-sample > rotation of the first case.
Fred, What I would do without thinking is pad my 65 samples with a single zero at each end, apply a 67-point window, then pad with the additional 61 points to get up to 128. That works whether the window is zero at the end points or not. Now that you've encouraged me to think, I don't know what I would do. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jerry Avins September 7, 20042004-09-07
Bernhard Holzmayer wrote:

> Jerry Avins wrote: > > >>Stan Pawlukiewicz wrote: >> >> >>>Jon Harris wrote: >> >> ... >> >> >>>>That may be true, but the windowing technique can be very useful >>>>when you need >>>>to calculate filter coefficients "on the fly". Computationally, >>>>it is much >>>>simpler than the optimized methods. So while it might be >>>>sub-optimal, I wouldn't say it is obsolete. >>>> >>>> >>> >>>Signal Processing with flies should be called FSP ;) >> >>The dyslexics among us sometimes store data in flies. >> >>Jerry > > > Sorry for the delayed question > (holidays on the lake of Constance (Germany) were splendid!), > but the food chain of curiosity seems to be closed-loop: > I still want to know what OY! in the topic means! > > Is it another stroke of applied dyslexics, and should read OT > instead, or is it just a personalized form which has to do with the > last letter of JerrY ? > > Bernhard
It started as a typo; T and Y are adjacent keys. Then I laughed at the shortening of "Oy Weh!" (spelled "oy, vay" in Yiddish transliteration to English) and decided to leave it. I apologize for the distraction. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Bernhard Holzmayer September 7, 20042004-09-07
Jerry Avins wrote:

> Stan Pawlukiewicz wrote: > >> Jon Harris wrote: > > ... > >>> That may be true, but the windowing technique can be very useful >>> when you need >>> to calculate filter coefficients "on the fly". Computationally, >>> it is much >>> simpler than the optimized methods. So while it might be >>> sub-optimal, I wouldn't say it is obsolete. >>> >>> >> >> Signal Processing with flies should be called FSP ;) > > The dyslexics among us sometimes store data in flies. > > Jerry
Sorry for the delayed question (holidays on the lake of Constance (Germany) were splendid!), but the food chain of curiosity seems to be closed-loop: I still want to know what OY! in the topic means! Is it another stroke of applied dyslexics, and should read OT instead, or is it just a personalized form which has to do with the last letter of JerrY ? Bernhard
Reply by Fred Marshall September 7, 20042004-09-07
"Jerry Avins" <jya@ieee.org> wrote in message
news:4138af32$0$19728$61fed72c@news.rcn.com...
> Fred Marshall wrote: > > > "Jerry Avins" <jya@ieee.org> wrote in message > > news:4138592b$0$19725$61fed72c@news.rcn.com... > > > >>Fred Marshall wrote: > >> > >>> > >>>Jerry, > >>> > >>>If the end points are zero then you need to use them. And, the results > > > > are > > > >>>not the same. > >>> > >>>That is, if I understand you: > >>> > >>>a) Calculate an N+2 window with zero end points and throw out both zero > > > > end > > > >>>points to get a length N window. > >>> > >>>b) Calculate an N+1 window with zero end points and throw out one zero > > > > (the > > > >>>N+1th) end point to get a length N window. > >>> > >>>In a, there are no zero end points at all. > >>>In b, there is a zero on the first point and an assumed zero on the > > > > N+1th > > > >>>point. > >>>So, they are different. > >>> > >>>Fred > >>>But, you will drop one of them because it occurs on the N+1th == the > > > > first > > > >>>location (repeats). > >> > >>Let's stay with the non-circular symmetric case. I collect N samples and > >>window them to prepare for a DFT with a window of length N. The first > >>and last window coefficients are zero, so the first and last samples > >>that the N-point DFT operates on are zero. Except for the bin spacing, I > >>will get the same results by discarding the end samples and running an > >>(N-2)-point DFT. Why did I bother to collect those samples? > > > > > > Jerry, > > > > I think we're talking about two different things. And, the second
sentence
> > above isn't really proper - which is what we *are* talking about I
think. I
> > suppose we've all done what you describe, but it isn't really proper I > > believe - Rick's point. > > > > What's (I think) proper is to prepare for a DFT with a window of length
N+1
> > and drop the last sample in the window to apply it to a sequence of
length N
> > and do a DFT of length N. > > (I have said nothing about zeros at the ends one way or another). > > And, this has nothing to do with efficiency or collecting samples, just > > plain proper math. > > > > Now, if you want to say that a particular window is going to have zeros
at
> > the ends, then you could collect one fewer sample - the first one - and
pad
> > a single zero at the beginning of the array
beforedoingtheDFT.Whichever
> > is best for your situation is fine. > > > > > >>Conversely: I use a window of length N+2, discarding the zero end > >>points. After applying the truncated window to the data, I pad the > >>result with a zero at each end, achieving what is indistinguishable from > >>what would be had starting with N+2 samples. Where did those two free > >>samples come from? They ain't no free lunch. Those samples were there > >>all along; this time, I didn't throw them away. > > > > > > You start with the idea that there will be an N+2 point DFT, right? > > I prefer to keep the DFT at N points just to keep apples to apples. > > So, then is this what you're saying: > > > > > >>Conversely: I use a window of length N [that has zero end points), > >>discarding the zero end points. > >>After applying the truncated window to the data, I pad the > >>result with a zero at each end, achieving what is indistinguishable from > >>what would be had starting with N samples. Where did those two free > >>samples come from? They ain't no free lunch. Those samples were there > >>all along; this time, I didn't throw them away. > > > > > > It's the same deal. You would compute a window of length *N+1* [that
has
> > zero end points] discarding one end point for an apparently asymmetrical > > window (Rick's point). Now you have a window of length N, that has a > > starting point of zero, to be applied to a data sequence of length N .
If
> > you would like to not capture the first sample or multiply by zero,
either
> > one, and pad the sequence with a zero at the beginning - th
at'sfine.It
> > doesn't change the fact that you need to compute the window to be one
sample
> > longer than the data and truncate the window by one sample before
applying
> > it. > > > > Fred > > I'm confused, but that's not new. Suppose I collect 65 samples, then pad > out to 128 for easy FFT. (I know don't have to, but I'm lazy.) I surely > don't want a window of length 128; that would be about as bad as no > window at all. It seems to me that I want to taper the significant > samples to zero at both ends -- or just outside them. I just don't see > how driving one end but not the other to zero makes sense here.
Jerry, We agree - if you're going to zero pad then the situation changes. In that case, the periodicity is longer than the non-zero part. In that case, I would apply the full window over the non-zero part. Still, I would caution that not all windows are zero at the edges. So, you don't want to throw out the ends of the window. What you want to do is apply a length N window to a length N sequence and then zero pad the result with M zero-valued samples - in principle. Now, if you do have a window with zero edges then you could do one of two things (at least): Have the windowed sequence of length N start with a zero value and end with a zero value plus the zero padding of M zero-valued samples - same as above. or Have the windowed sequence start with the first non-zero sample and then end with a zero value (length N-1) plus the zero padding of M as above, plus one zero-valued sample to bring the N-1 up to N. This is simply a one-sample rotation of the first case. Fred
Reply by Eric Backus September 5, 20042004-09-05
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message 
news:f56893ae.0409032307.5aa7d4d9@posting.google.com...
> "Eric Backus" <eric_backus@alum.mit.edu> wrote in message > news:<1094239880.872470@cswreg.cos.agilent.com>... >> "Rick Lyons" <r.lyons@_BOGUS_ieee.org> wrote in message >> news:41365058.204625031@news.sf.sbcglobal.net... > >> > Anyway, I'm thinking that there are two different types of >> > symmetry: "linear symmetry" and "DFT symmetry". And >> > that window functions should always be "DFT Symmetric". >> > And maybe I should change the equations in my book with >> > regard to the Hanning and Hamming windows. >> >> You are exactly correct. This is one of the subtle points about data >> windows that few (if any) textbooks talk about. If your purpose is to >> window data before doing a DFT, you want the window equation to use >> divide-by-N, the one you call "DFT Symmetric". One reason you want this >> is >> that it gives the expected line spectrum when given input data that is >> periodic within the input blocksize. > > OK... you present a very subtle point here, that I haven't really thought > about. My instant reaction is that the reason for using windoes is exactly > to "smear" the spectra they operate on, be it the smoothing of the > periodogram or suppresion of side lobes in FIR filters. The one effect > one does *not* want from a window function, is that the spectrum > degenerates to just a few non-zero coefficients. Designing a window as > a cosine over one period plus one sample, is a very neat way to achieve > this "non-degenerate" spectrum.
I think we all agree that the spectrum resulting from windowing a block of data is the convolution of (un-windowed spectrum) with (spectrum of the window). If the window is composed of a sum-of-cosines, and the periods of those cosines match the DFT blocksize, then the spectrum of the window itself is a line spectrum with the lines showing the magnitudes of the cosine terms. In many cases this doesn't matter much, but in the special case where the input data is also periodic in the DFT blocksize, the spectrum of the windowed input data is another line spectrum. This is sometimes a useful property.
>> Note that in this case, N is usually >> an even number, and you want the window to be symmetric around the N/2+1 >> sample rather than symmetric around N/2+0.5, so that you don't introduce >> a >> phase ramp into your frequency spectrum. > > Even or odd symmetry does not play a part in introducing the phase lag, > except for determining exactly how much of a phase lag is introduced.
Well, that is true, but having the phase lag be an integral number of samples is sometimes a useful property.
> I can think of two reasons to use window functions. The first is in FIR > filter design, which is the main subject of this thread. The second is > for smoothing the periodogram in spectrum estimation.
For the most part, I think suppression of sidelobes is more important and desirable than smoothing. When designing windows, there is generally a trade-off between the amount of sidelobe suppression and the width of the window main lobe. Usually you try to minimize the width of the main lobe (which *minimizes* the smoothing) for a given amount of sidelobe suppression. -- Eric Backus R&D Design Engineer Agilent Technologies, Inc. 425-356-6010 Tel