DSPRelated.com
Forums

Triangle Window ?

Started by brent May 26, 2011
Is the triangle window pretty much lame or are there examples where
the triangle window is the best window to apply to data prior to an
FFT?

Could anyone provide examples of when  triangle window is the best
choice?
On 05/26/2011 11:17 AM, brent wrote:
> Is the triangle window pretty much lame or are there examples where > the triangle window is the best window to apply to data prior to an > FFT?
I suspect it's generally pretty lame. Two downsides (maybe there's more) of any windows are spectral leakage and the tendency to suppress interesting information over the length of the sample vector. The triangle window tends to do both. If you take the FFT of the window itself you'll get an idea of the spectral leakage -- however much that window takes DC and splatters it into adjoining bins, that's what it'll do with any real signal component when you use it in an FFT. How much it suppresses information is a bit trickier, but I suspect that if there's a formal, accepted figure of merit for a window it's pretty close to the ratio of the amplitude at DC to the width of the "splatter". Different problems require different windows (after all, the FFT is exact, but jamming an infinite-length signal into a finite-length vector _is_ an approximation, and sampling a continuous-time signal is another one). So I don't think that there are _any_ one size fits all windows, and maybe there's some oddball problem for which a triangle window really is best.
> Could anyone provide examples of when triangle window is the best > choice?
No, but if there's a situation where it is, it's odd! -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 5/26/2011 11:17 AM, brent wrote:
> Is the triangle window pretty much lame or are there examples where > the triangle window is the best window to apply to data prior to an > FFT? > > Could anyone provide examples of when triangle window is the best > choice?
A triangle windows results from convolving the rectangular window with itself. As such, the following happen: The length of the window doubles. The sinc in frequency is squared so the zeros show up at the "same place" and are doubled so the sidelobes are always positive. I notice that some treatments show the sinc^2 with the same zero locations as the sinc and with a narrower main lobe. All well and good but this only happens if the window length is doubled. Consider that the sinc has the narrowest main lobe of all.... If the window length is kept the same, then the zeros of the sinc^2 function are twice as far apart and the main lobe is wider. Makes sense of you consider that the window function is "narrower" in a general sort of way. The quick answer is that the spectral properties are: - a bit wider than a sinc so maybe not as good for separating close sinusoids and somewhat higher noise in the vicinity. - frequency sidelobes / spreading falls off faster away from the center lobe. Instead of 1/f falloff it's 1/f^2. The falloff in frequency is related to the first derivative in time at the edges of the window. Smoother edge, faster rolloff. That's why the raised cosine is better in that regard with the first derivative You could look at fred harris' paper or one by Al Nuttall that compare various windows with all sorts of measures. http://web.mit.edu/xiphmont/Public/windows.pdf or http://ece.wpi.edu/analog/resources/FFT_Windowing_Tutorial.pdf Fred
On May 26, 2:17&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote:
> Is the triangle window pretty much lame or are there examples where > the triangle window is the best window to apply to data prior to an > FFT? > > Could anyone provide examples of when &#4294967295;triangle window is the best > choice?
it has better sidelobe rejection then rectangular window and being simple to compute doesn't require any memory storage or computational power. It might not be best, but it might be the only window your system could support if you using an 16 bit micro like the TMS430 or similar
On 05/26/2011 12:33 PM, steve wrote:
> On May 26, 2:17 pm, brent<buleg...@columbus.rr.com> wrote: >> Is the triangle window pretty much lame or are there examples where >> the triangle window is the best window to apply to data prior to an >> FFT? >> >> Could anyone provide examples of when triangle window is the best >> choice? > > it has better sidelobe rejection then rectangular window and being > simple to compute doesn't require any memory storage or computational > power. It might not be best, but it might be the only window your > system could support if you using an 16 bit micro like the TMS430 or > similar
You can get pretty close to a raised cosine window with a x^2 and a few 'if' statements. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On May 26, 12:04 pm, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> ... > A triangle windows results from convolving the rectangular window with > itself. As such, the following happen: > > The length of the window doubles. > The sinc in frequency is squared so the zeros show up at the "same > place" and are doubled so the sidelobes are always positive. > > I notice that some treatments show the sinc^2 with the same zero > locations as the sinc and with a narrower main lobe. All well and good > but this only happens if the window length is doubled.
But isn't that about what we get from actually convolving the rectangle with itself (as you said)?
> Consider that the sinc has the narrowest main lobe of all....
Not really. Perhaps narrower than the common ones. Perhaps the narrowest useful one. You can get narrower mainlobe, but only at the expense of having less that the 13.6 dB sidelobe rejection that the rectangular window gives. The Taylor window, for example gives a narrower mainlobe when designed with a specified 10 dB sidelobe rejection.
> ... > > You could look at fred harris' paper or one by Al Nuttall that compare > various windows with all sorts of measures. > http://web.mit.edu/xiphmont/Public/windows.pdf
> orhttp://ece.wpi.edu/analog/resources/FFT_Windowing_Tutorial.pdf
This is a Sound and Vibration article, not Nuttall's, if that is what you intended. For Nuttall's try: http://www.ingelec.uns.edu.ar/pds2803/Materiales/Articulos/0084nutt.pdf Nuttall's paper doesn't include the triangular window, but is a good comparison of the more common cosine-sum windows of 2, 3 or 4 coefficients.
> > Fred
Dale B. Dalrymple
On May 26, 3:33&#4294967295;pm, steve <bungalow_st...@yahoo.com> wrote:
> On May 26, 2:17&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote: > > > Is the triangle window pretty much lame or are there examples where > > the triangle window is the best window to apply to data prior to an > > FFT? > > > Could anyone provide examples of when &#4294967295;triangle window is the best > > choice? > > it has better sidelobe rejection then rectangular window and being > simple to compute doesn't require any memory storage or computational > power. It might not be best, but it might be the only window your > system could support if you using an 16 bit micro like the TMS430 or > similar
Thanks all. Steve, perhaps yours is the best answer. brent
On May 26, 9:04&#4294967295;pm, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> On 5/26/2011 11:17 AM, brent wrote: > > > Is the triangle window pretty much lame or are there examples where > > the triangle window is the best window to apply to data prior to an > > FFT? > > > Could anyone provide examples of when &#4294967295;triangle window is the best > > choice? > > A triangle windows results from convolving the rectangular window with > itself. &#4294967295;
Correct, and that's why the triangle window comes up in analysis: Not because somebody *explicitly* chooses to use it, but because some conv operation between rectangular windows *implicitly* causes the triangle window to affect the result. Naive autocorrelations between two truncated series is one case. Rune
On 5/26/2011 4:32 PM, dbd wrote:
> On May 26, 12:04 pm, Fred Marshall<fmarshallxremove_th...@acm.org> > wrote: >> ... >> A triangle windows results from convolving the rectangular window with >> itself. As such, the following happen: >> >> The length of the window doubles. >> The sinc in frequency is squared so the zeros show up at the "same >> place" and are doubled so the sidelobes are always positive. >> >> I notice that some treatments show the sinc^2 with the same zero >> locations as the sinc and with a narrower main lobe. All well and good >> but this only happens if the window length is doubled. > > But isn't that about what we get from actually convolving the > rectangle with itself (as you said)? > >> Consider that the sinc has the narrowest main lobe of all.... > > Not really. Perhaps narrower than the common ones. Perhaps the > narrowest useful one. You can get narrower mainlobe, but only at the > expense of having less that the 13.6 dB sidelobe rejection that the > rectangular window gives. The Taylor window, for example gives a > narrower mainlobe when designed with a specified 10 dB sidelobe > rejection. > >> ... >> >> You could look at fred harris' paper or one by Al Nuttall that compare >> various windows with all sorts of measures. >> http://web.mit.edu/xiphmont/Public/windows.pdf > >> orhttp://ece.wpi.edu/analog/resources/FFT_Windowing_Tutorial.pdf > > This is a Sound and Vibration article, not Nuttall's, if that is what > you intended. > > For Nuttall's try: > http://www.ingelec.uns.edu.ar/pds2803/Materiales/Articulos/0084nutt.pdf > > Nuttall's paper doesn't include the triangular window, but is a good > comparison of the more common cosine-sum windows of 2, 3 or 4 > coefficients. >> >> Fred > > Dale B. Dalrymple
Dale, Thanks for the link to Nuttall's paper. I looked but couldn't find it. Fred
On 5/26/2011 4:32 PM, dbd wrote:
>> I notice that some treatments show the sinc2 with the same zero >> > locations as the sinc and with a narrower main lobe. All well and good >> > but this only happens if the window length is doubled.
> But isn't that about what we get from actually convolving the > rectangle with itself (as you said)? >
Dale, Yes. But those 'treatments" I refer to are using different window length for the two cases - which would be the temporal convolution of two rectangular windows. In that case the zeros in frequency coincide. Whereas if one uses a triangular window of length N and compares it with a rectangular window of length N then the main lobe is wider for the triangular window and the zeros are further apart by a factor of 2. It's common to compare window functions having the same length.... and not all treatments do that. Fred