DSPRelated.com
Forums

Do I need a window?

Started by blackhermi March 22, 2010
Hi

I need to find out the frequencies present in the variation of a physical
quantity from a discretely sampled data of finite length. Which window (if
any) should I use? I think doing an fftn in MATLAB uses a rectangular
function by default. Please correct me if I am wrong.

Also, is there a way to create a 2D version of a given window?

Thanks and Regards


On 22 Mar, 14:35, "blackhermi" <dheeraj.iitm@n_o_s_p_a_m.gmail.com>
wrote:
> Hi > > I need to find out the frequencies present in the variation of a physical > quantity from a discretely sampled data of finite length. Which window (if > any) should I use?
It depends entirely on the data and what you attempt to do. If the SNR is large and the sinusoidals are well separated, then don't use any. If the SNR is low and you need to suppress side lobes, choose a window that can be tuned to your particular needs (the Kaiser window is just about the only one that fits that bill). Or avoid controversy by using the most popular window that everybody else use. I don't have any statistics, but the Hanning / Hann / von Hann window ought to end up among the top 3 in the popularity polls. Rune
Rune Allnor wrote:
> On 22 Mar, 14:35, "blackhermi" <dheeraj.iitm@n_o_s_p_a_m.gmail.com> > wrote: >> Hi >> >> I need to find out the frequencies present in the variation of a physical >> quantity from a discretely sampled data of finite length. Which window (if >> any) should I use? > > It depends entirely on the data and what you attempt to do. > If the SNR is large and the sinusoidals are well separated, > then don't use any. If the SNR is low and you need to > suppress side lobes, choose a window that can be tuned to > your particular needs (the Kaiser window is just about the > only one that fits that bill). Or avoid controversy by using > the most popular window that everybody else use. I don't have > any statistics, but the Hanning / Hann / von Hann window ought > to end up among the top 3 in the popularity polls.
Understanding the properties of the FFT would help, too -- that will let you understand why you want to window the data, which in turn will help you understand what window (if any) you want and why. While I could stand in front of a room of fellow engineers and defend a choice of window by "it's popular _and_ it doesn't matter much anyway", defending it with "'cause it's popular" would quite deservedly get me laughed out of the room. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On 22 Mar, 15:14, Tim Wescott <t...@seemywebsite.now> wrote:
> Rune Allnor wrote: > > On 22 Mar, 14:35, "blackhermi" <dheeraj.iitm@n_o_s_p_a_m.gmail.com> > > wrote: > >> Hi > > >> I need to find out the frequencies present in the variation of a physical > >> quantity from a discretely sampled data of finite length. Which window (if > >> any) should I use? > > > It depends entirely on the data and what you attempt to do. > > If the SNR is large and the sinusoidals are well separated, > > then don't use any. If the SNR is low and you need to > > suppress side lobes, choose a window that can be tuned to > > your particular needs (the Kaiser window is just about the > > only one that fits that bill). Or avoid controversy by using > > the most popular window that everybody else use. I don't have > > any statistics, but the Hanning / Hann / von Hann window ought > > to end up among the top 3 in the popularity polls. > > Understanding the properties of the FFT would help, too -- that will let > you understand why you want to window the data, which in turn will help > you understand what window (if any) you want and why. > > While I could stand in front of a room of fellow engineers and defend a > choice of window by "it's popular _and_ it doesn't matter much anyway", > defending it with "'cause it's popular" would quite deservedly get me > laughed out of the room.
The alternative is to stand on the podium and defend why one uses some obscure window: "Why did you use the Gavrilovich-Cheng window? What properties does that window offer that a regular window like, say, a Hann window, does not?" You'd better have a clear answer to that one, or avoid the question being asked at all. Rune

Rune Allnor wrote:
> On 22 Mar, 15:14, Tim Wescott <t...@seemywebsite.now> wrote: > >>Rune Allnor wrote: >> >>>On 22 Mar, 14:35, "blackhermi" <dheeraj.iitm@n_o_s_p_a_m.gmail.com> >>>wrote: >>> >>>>Hi >> >>>>I need to find out the frequencies present in the variation of a physical >>>>quantity from a discretely sampled data of finite length. Which window (if >>>>any) should I use? >> >>>It depends entirely on the data and what you attempt to do. >>>If the SNR is large and the sinusoidals are well separated, >>>then don't use any. If the SNR is low and you need to >>>suppress side lobes, choose a window that can be tuned to >>>your particular needs (the Kaiser window is just about the >>>only one that fits that bill). Or avoid controversy by using >>>the most popular window that everybody else use. I don't have >>>any statistics, but the Hanning / Hann / von Hann window ought >>>to end up among the top 3 in the popularity polls. >> >>Understanding the properties of the FFT would help, too -- that will let >>you understand why you want to window the data, which in turn will help >>you understand what window (if any) you want and why. >> >>While I could stand in front of a room of fellow engineers and defend a >>choice of window by "it's popular _and_ it doesn't matter much anyway", >>defending it with "'cause it's popular" would quite deservedly get me >>laughed out of the room. > > > The alternative is to stand on the podium and defend why one uses > some obscure window: > > "Why did you use the Gavrilovich-Cheng window? What properties > does that window offer that a regular window like, say, a Hann > window, does not?" > > You'd better have a clear answer to that one, or avoid the > question being asked at all.
Good idea. Nobody knows wtf is Gavrilovich-Cheng window, so everybody will will shut up so not to look as an idiot. VLV
Vladimir Vassilevsky wrote:
> > > Rune Allnor wrote: >> On 22 Mar, 15:14, Tim Wescott <t...@seemywebsite.now> wrote: >> >>> Rune Allnor wrote: >>> >>>> On 22 Mar, 14:35, "blackhermi" <dheeraj.iitm@n_o_s_p_a_m.gmail.com> >>>> wrote: >>>> >>>>> Hi >>> >>>>> I need to find out the frequencies present in the variation of a >>>>> physical >>>>> quantity from a discretely sampled data of finite length. Which >>>>> window (if >>>>> any) should I use? >>> >>>> It depends entirely on the data and what you attempt to do. >>>> If the SNR is large and the sinusoidals are well separated, >>>> then don't use any. If the SNR is low and you need to >>>> suppress side lobes, choose a window that can be tuned to >>>> your particular needs (the Kaiser window is just about the >>>> only one that fits that bill). Or avoid controversy by using >>>> the most popular window that everybody else use. I don't have >>>> any statistics, but the Hanning / Hann / von Hann window ought >>>> to end up among the top 3 in the popularity polls. >>> >>> Understanding the properties of the FFT would help, too -- that will let >>> you understand why you want to window the data, which in turn will help >>> you understand what window (if any) you want and why. >>> >>> While I could stand in front of a room of fellow engineers and defend a >>> choice of window by "it's popular _and_ it doesn't matter much anyway", >>> defending it with "'cause it's popular" would quite deservedly get me >>> laughed out of the room. >> >> >> The alternative is to stand on the podium and defend why one uses >> some obscure window: >> >> "Why did you use the Gavrilovich-Cheng window? What properties >> does that window offer that a regular window like, say, a Hann >> window, does not?" >> >> You'd better have a clear answer to that one, or avoid the >> question being asked at all. > > Good idea. Nobody knows wtf is Gavrilovich-Cheng window, so everybody > will will shut up so not to look as an idiot.
Not even Garilovich or Cheng? Rune has a point -- using an obscure technique when some more popular one would do has its pitfalls as well. But using a technique just because all your friends use it* -- that's just crying out for some corrective action. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
Vladimir Vassilevsky wrote:

   ...

> Good idea. Nobody knows wtf is Gavrilovich-Cheng window, so everybody > will will shut up so not to look as an idiot.
I'm the sort who, smelling something new to learn, would ask all sorts of (possibly embarrassing) questions. Jerry -- Discovery consists of seeing what everybody has seen, and thinking what nobody has thought. .. Albert Szent-Gyorgi &#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;
On 22 Mar, 15:25, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> Rune Allnor wrote: > > On 22 Mar, 15:14, Tim Wescott <t...@seemywebsite.now> wrote: > > >>Rune Allnor wrote: > > >>>On 22 Mar, 14:35, "blackhermi" <dheeraj.iitm@n_o_s_p_a_m.gmail.com> > >>>wrote: > > >>>>Hi > > >>>>I need to find out the frequencies present in the variation of a physical > >>>>quantity from a discretely sampled data of finite length. Which window (if > >>>>any) should I use? > > >>>It depends entirely on the data and what you attempt to do. > >>>If the SNR is large and the sinusoidals are well separated, > >>>then don't use any. If the SNR is low and you need to > >>>suppress side lobes, choose a window that can be tuned to > >>>your particular needs (the Kaiser window is just about the > >>>only one that fits that bill). Or avoid controversy by using > >>>the most popular window that everybody else use. I don't have > >>>any statistics, but the Hanning / Hann / von Hann window ought > >>>to end up among the top 3 in the popularity polls. > > >>Understanding the properties of the FFT would help, too -- that will let > >>you understand why you want to window the data, which in turn will help > >>you understand what window (if any) you want and why. > > >>While I could stand in front of a room of fellow engineers and defend a > >>choice of window by "it's popular _and_ it doesn't matter much anyway", > >>defending it with "'cause it's popular" would quite deservedly get me > >>laughed out of the room. > > > The alternative is to stand on the podium and defend why one uses > > some obscure window: > > > "Why did you use the Gavrilovich-Cheng window? What properties > > does that window offer that a regular window like, say, a Hann > > window, does not?" > > > You'd better have a clear answer to that one, or avoid the > > question being asked at all. > > Good idea. Nobody knows wtf is Gavrilovich-Cheng window, so everybody > will will shut up so not to look as an idiot.
I wouldn't play on human stupidity quite like that - there is the chance that someone like Jerry or myself is in the audiendce. In that case, the presenter will look like the idiot. I know. I did ask that question, once upon a time many years ago. Made a total fool - unintentionally! - of the presenter when she had no answer to why she had made some choise she had commented on during the presentation. If you want to play an insult, hide it in plain sight: Make the obvious choise, but without justification. Or keep quiet about the key trick while exanding on some triviality. The Danes and the English are masters at that game: One basks in the glory of some comment for hours or days, until the intended meaning all of a sudden dawns upon you. Sir Humphrey Appleby of "Yes (Prime) Minister" is the seminal example: http://en.wikipedia.org/wiki/Yes_Minister Rune

Tim Wescott wrote:


> But using a technique just because all your friends use it* -- that's > just crying out for some corrective action.
That's #1 point in the future book "How to quit being an idiot and start living": Have a purpose. Don't do anything just because many other people do that. VLV
Jerry Avins wrote:
> Vladimir Vassilevsky wrote: > > ... > >> Good idea. Nobody knows wtf is Gavrilovich-Cheng window, so everybody >> will will shut up so not to look as an idiot. > > I'm the sort who, smelling something new to learn, would ask all sorts > of (possibly embarrassing) questions.
I make a point of asking about things that are new to me -- I either learn something useful, or I expose a poseur. Since either of these are good things, there's no reason not to ask. (Note: even if one _thinks_ one is exposing a poseur, one should always ask with full humility -- if it turns out that the speaker is Gavrilovich's niece, and learned her DSP on her uncle's knee, it reduces the embarrassment. And if you _are_ exposing a poseur, then you can retain your status as the little kid in "The Emperor's New Cloths".) -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com