DSPRelated.com
Forums

How to design/specify a window?

Started by Richard Owlett January 19, 2006
I am neophyte [ perhaps read ignorant ;]

I've been told that a poorly chosen window can cause problems .}

For my application the ratio of "maximumly flat" to transition region is 
 > 1000:1.

What should I be considering?
where should I be looking?

Thanks
[PS this group has made a start on teaching me to *explicitly* say THANK 
YOU. ]

therefore DANKE



"Richard Owlett" <rowlett@atlascomm.net> wrote in message 
news:11t094t18t1dp02@corp.supernews.com...
>I am neophyte [ perhaps read ignorant ;] > > I've been told that a poorly chosen window can cause problems .} > > For my application the ratio of "maximumly flat" to transition region is > > 1000:1. > > What should I be considering? > where should I be looking? >
Hi Richard! I'm afraid I don't know much about filters so I'm not going to be much help (so I've snipped the Dankje ) - you might get a quicker response from someone who knows what he/she is talking about if you tell him/her what you mean by transition region though. Best of luck - Mike
Mike Yarwood wrote:

> "Richard Owlett" <rowlett@atlascomm.net> wrote in message > news:11t094t18t1dp02@corp.supernews.com... > >>I am neophyte [ perhaps read ignorant ;] >> >>I've been told that a poorly chosen window can cause problems .} >> >>For my application the ratio of "maximumly flat" to transition region is >> >>>1000:1. >> >>What should I be considering? >>where should I be looking? >> > > Hi Richard! I'm afraid I don't know much about filters so I'm not going to > be much help (so I've snipped the Dankje ) - you might get a quicker > response from someone who knows what he/she is talking about if you tell > him/her what you mean by transition region though. > > Best of luck - Mike > >
a supposedly "perfect" filter would be a "brickwall" infinite attenuation below f1 and over f2, otherwise none the Fourier transform to time domain has nasty repercussions the inverse is also true ;] To the experts -- I know that was a lousy/lossy response. Is it correct as far as I went?
"Richard Owlett" <rowlett@atlascomm.net> wrote in message 
news:11t0cqdtoisoh6d@corp.supernews.com...
> Mike Yarwood wrote: > >> "Richard Owlett" <rowlett@atlascomm.net> wrote in message >> news:11t094t18t1dp02@corp.supernews.com... >> >>>I am neophyte [ perhaps read ignorant ;] >>> >>>I've been told that a poorly chosen window can cause problems .} >>> >>>For my application the ratio of "maximumly flat" to transition region is >>> >>>>1000:1. >>> >>>What should I be considering? >>>where should I be looking? >>> >> >> Hi Richard! I'm afraid I don't know much about filters so I'm not going >> to be much help (so I've snipped the Dankje ) - you might get a quicker >> response from someone who knows what he/she is talking about if you tell >> him/her what you mean by transition region though.
> a supposedly "perfect" filter would be a "brickwall" > infinite attenuation below f1 and over f2, otherwise none > > the Fourier transform to time domain has nasty repercussions > the inverse is also true ;] > > To the experts -- I know that was a lousy/lossy response. > Is it correct as far as I went? >
I dunno - but I've just realised I read your "maximumly flat" as "maximally flat", now I really haven't got a clue what you mean so I'll just shut up. Best of Luck - Mike
Mike Yarwood wrote:

> "Richard Owlett" <rowlett@atlascomm.net> wrote in message > news:11t0cqdtoisoh6d@corp.supernews.com... > >>Mike Yarwood wrote: >> >> >>>"Richard Owlett" <rowlett@atlascomm.net> wrote in message >>>news:11t094t18t1dp02@corp.supernews.com... >>> >>> >>>>I am neophyte [ perhaps read ignorant ;] >>>> >>>>I've been told that a poorly chosen window can cause problems .} >>>> >>>>For my application the ratio of "maximumly flat" to transition region is >>>> >>>> >>>>>1000:1. >>>> >>>>What should I be considering? >>>>where should I be looking? >>>> >>> >>>Hi Richard! I'm afraid I don't know much about filters so I'm not going >>>to be much help (so I've snipped the Dankje ) - you might get a quicker >>>response from someone who knows what he/she is talking about if you tell >>>him/her what you mean by transition region though. > > >>a supposedly "perfect" filter would be a "brickwall" >>infinite attenuation below f1 and over f2, otherwise none >> >>the Fourier transform to time domain has nasty repercussions >>the inverse is also true ;] >> >>To the experts -- I know that was a lousy/lossy response. >>Is it correct as far as I went? >> > > I dunno - but I've just realised I read your "maximumly flat" as "maximally > flat", now I really haven't got a clue what you mean so I'll just shut up. > > Best of Luck - Mike > >
Not to worry, probably makes at least two of us ;] We'll wait for Avins &/or Lyons to translate Owl to Normal ;]
Richard Owlett wrote:
> I am neophyte [ perhaps read ignorant ;] > > I've been told that a poorly chosen window can cause problems .} > > For my application the ratio of "maximumly flat" to transition region is > > 1000:1. > > What should I be considering? > where should I be looking? > > Thanks > [PS this group has made a start on teaching me to *explicitly* say THANK > YOU. ] > > therefore DANKE
Bitte. Please explain what "the ratio 'maximumly flat' to transition region" means. I see it as the ratio of an amplitude to a frequency band, which seems absurd to me. I'd also like to know what "maximally flat" means to you. In analog filters, it is the Butterworth criterion. For lowpass filters, that amounts to setting as many derivatives of f(w) to zero at w = 0 as the degrees of freedom will allow. 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;
"Richard Owlett" <rowlett@atlascomm.net> wrote in message 
news:11t094t18t1dp02@corp.supernews.com...
>I am neophyte [ perhaps read ignorant ;] > > I've been told that a poorly chosen window can cause problems .} > > For my application the ratio of "maximumly flat" to transition region is > > 1000:1. > > What should I be considering? > where should I be looking? > > Thanks
Well, you might be a bit more explicit with your terms. I'll just use conjecture here: The transition region might be defined as a fraction of fs, as a fraction of fs/2 or maybe as a fraction of the passband. You seem to imply as a fraction of the passband of a lowpass. It's a lot easier to talk about if it's a fraction of fs or fs/2. Here's a rule of thumb: The transition band width (or the narrowest transition band width) will be no narrower than the reciprocal of the length of the filter. So, if you're going to window data then that same length requirement applies. Next, it's important to state the purpose of the window because: - you might be windowing data for the purpose of reducing spectral spreading (which is related to ripple in a filter). - you might be doing filter design using the windowing method. Either way, the Fourier Transform of the window function will convolve either: - the signal spectrum or - the filter frequency response. Think about this: A window in time will look something like a sinc in the frequency domain - with more or less ripple decay and with more or less main lobe width. The affect of multiplying in time by one of these windows is convolution in frequency. So, you are convolving in frequency with something very similar to a sinc. As the sinc gets wider, the ripples on the edges get smaller for good windows. For sharp response, the sinc-like function needs to be narrow / so the filter needs to be long in time. For a narrow sinc-like function, the convolution with a typical perfect rectangular lowpass or bandpass filter will appear much like the integral of the sinc-like function centered on the transitions. So, a very ripply sinc-like function - integrated - will be ripply. A wider sinc-like function will make the transitions wide. and so forth ..... Unless you care about fine detail, the details of the window don't matter all that much. Each decent window gets you close to the same result. To see this do the following: 1) Compute the Fourier Transform of a triangle and of a raised cosine both of the same length. How much different are the results? 2) Apply each of these windows to a temporal sinc to get a windowed design of a lowpass filter. How much different are the Fourier Transforms / the filter responses? More control of the window gets better results but as the windows get better, the results vary not all that much. Fred
Fred Marshall wrote:

> "Richard Owlett" <rowlett@atlascomm.net> wrote in message > news:11t094t18t1dp02@corp.supernews.com...
while having had 5 hours sleep in previous 40+ response below is being composed after >12 hrs sleep ;}
> >>I am neophyte [ perhaps read ignorant ;] >> >>I've been told that a poorly chosen window can cause problems .} >> >>For my application the ratio of "maximumly flat" to transition region is >> >>>1000:1. >> >>What should I be considering? >>where should I be looking? >> >>Thanks > > > Well, you might be a bit more explicit with your terms.
Yes and I should have stated what I wanted to window and for what purpose. I have data in time domain on which I would like to examine how its spectrum changes in time.
> I'll just use > conjecture here: > > The transition region might be defined as a fraction of fs, as a fraction of > fs/2 or maybe as a fraction of the passband. You seem to imply as a > fraction of the passband of a lowpass. It's a lot easier to talk about if > it's a fraction of fs or fs/2.
I associate your terms with the frequency domain. I'm thinking about the time domain. I know the math is the same but natural language makes a distinction whose underlying presuppositions can snare. Or, "words are slippery".
> > Here's a rule of thumb: > The transition band width (or the narrowest transition band width) will be > no narrower than the reciprocal of the length of the filter. > So, if you're going to window data then that same length requirement > applies. > > Next, it's important to state the purpose of the window because: > > - you might be windowing data for the purpose of reducing spectral spreading > (which is related to ripple in a filter).
This is what I was thinking of.
> - you might be doing filter design using the windowing method.
No. I'm not even sure of what that is. Let's leave that portion of my education for another time.
> > Either way, the Fourier Transform of the window function will convolve > either: > - the signal spectrum > or > - the filter frequency response. > > Think about this: > A window in time will look something like a sinc in the frequency domain - > with more or less ripple decay and with more or less main lobe width. > The affect of multiplying in time by one of these windows is convolution in > frequency. So, you are convolving in frequency with something very similar > to a sinc. As the sinc gets wider, the ripples on the edges get smaller for > good windows. > For sharp response, the sinc-like function needs to be narrow / so the > filter needs to be long in time. > For a narrow sinc-like function, the convolution with a typical perfect > rectangular lowpass or bandpass filter will appear much like the integral of > the sinc-like function centered on the transitions. > So, a very ripply sinc-like function - integrated - will be ripply. > A wider sinc-like function will make the transitions wide. > and so forth ..... > > Unless you care about fine detail,
But just what is "fine detail". I'm operating intuitively here thinking that a "fine detail" might just come back to bite me.
> the details of the window don't matter > all that much. Each decent window gets you close to the same result. To > see this do the following: > > 1) Compute the Fourier Transform of a triangle and of a raised cosine both > of the same length. > How much different are the results?
I had been working along those lines. But I kept having the problem how to determine that two different windows had comparable width. eg are the first two windows on http://astronomy.swin.edu.au/~pbourke/other/windows/ really comparable?
> > 2) Apply each of these windows to a temporal sinc to get a windowed design > of a lowpass filter. > How much different are the Fourier Transforms / the filter responses? > > More control of the window gets better results but as the windows get > better, the results vary not all that much. > > Fred > >
Richard Owlett wrote:

   ...
> But I kept having the problem how > to determine that two different windows had comparable width. eg are the > first two windows on http://astronomy.swin.edu.au/~pbourke/other/windows/ > really comparable?
Picking a window is fine tuning.If a method works with one, it will work with any. First make it work, then make it work well. 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;
Jerry Avins wrote:

> Richard Owlett wrote: > > ... > >> But I kept having the problem how >> to determine that two different windows had comparable width. eg are >> the first two windows on >> http://astronomy.swin.edu.au/~pbourke/other/windows/ >> really comparable? > > > Picking a window is fine tuning.If a method works with one, it will work > with any. First make it work, then make it work well. > > Jerry
But how do I prove that any work? I have a long stream of data. I window it with WINDOWa, do FFT obtaining SPECTRUMa. I window it with WINDOWb, do FFT obtaining SPECTRUMb. I window it with WINDOWc, do FFT obtaining SPECTRUMc. The correct spectrum is?