<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570</link>
    <title>MATLAB Central Newsreader - how to reverse windowing effect?</title>
    <description>Feed for thread: how to reverse windowing effect?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 19 May 2008 23:59:02 -0400</pubDate>
      <title>how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433030</link>
      <author>ggk giust</author>
      <description>Greetings, &lt;br&gt;
&lt;br&gt;
I'd like to apply the blackman-harris window to my real-&lt;br&gt;
time data array, before taking its FFT and applying a &lt;br&gt;
frequency-domain filter to it. &lt;br&gt;
&lt;br&gt;
My question is, when I then do the inverse FFT, how do I &lt;br&gt;
reverse the effect of windowing (in this case using &lt;br&gt;
blackman-harris 4 term, -92db) so that the resulting real-&lt;br&gt;
time waveform is as accurate as possible?&lt;br&gt;
&lt;br&gt;
Is there some equation I can simply apply? I see a lot of &lt;br&gt;
references to windowing in the literature, but no &lt;br&gt;
information about how to reverse the effect of windowing &lt;br&gt;
when going back from the frequency to the time domain. &lt;br&gt;
Looking for practical advice how to compute this.&lt;br&gt;
&lt;br&gt;
Best regards, -GGK&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 20 May 2008 04:29:02 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433043</link>
      <author>Paul Mennen</author>
      <description>"ggk giust" &amp;lt;ggkmath@comcast.net&amp;gt; wrote &lt;br&gt;
&amp;gt; I see a lot of &lt;br&gt;
&amp;gt; references to windowing in the literature, but no &lt;br&gt;
&amp;gt; information about how to reverse the effect of windowing &lt;br&gt;
&amp;gt; when going back from the frequency to the time domain. &lt;br&gt;
&lt;br&gt;
That's because it is not possible. Some operations, such as&lt;br&gt;
the FFT for example do not destroy information and thus are&lt;br&gt;
completely reversible. Other operations are not.&lt;br&gt;
&lt;br&gt;
Consider an operation on a block of data where each point is&lt;br&gt;
replaced with the average of the current point and the&lt;br&gt;
previous point (i.e. blk(k) = (blk(k) + blk(k-1))/2.&lt;br&gt;
(I sometimes call this the "1 1" filter). Clearly the result&lt;br&gt;
is smoother than the input. Now would you expect this&lt;br&gt;
operation to be reversible? ... I hope not :)&lt;br&gt;
&lt;br&gt;
Windowing is much the same thing, and you can think of it as&lt;br&gt;
a smoothing filter in the frequency domain. For instance the&lt;br&gt;
Hanning window is a "1/4 1/2 1/4" filter in the frequency&lt;br&gt;
domain. Regardless of whether you are smoothing in the&lt;br&gt;
frequency domain or the time domain, information is lost and&lt;br&gt;
you can't reverse the operation.&lt;br&gt;
&lt;br&gt;
~Paul&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 20 May 2008 06:02:47 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433049</link>
      <author>dbd</author>
      <description>On May 19, 4:59 pm, "ggk giust" &amp;lt;ggkm...@comcast.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; Greetings,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'd like to apply the blackman-harris window to my real-&lt;br&gt;
&amp;gt; time data array, before taking its FFT and applying a&lt;br&gt;
&amp;gt; frequency-domain filter to it.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; My question is, when I then do the inverse FFT, how do I&lt;br&gt;
&amp;gt; reverse the effect of windowing (in this case using&lt;br&gt;
&amp;gt; blackman-harris 4 term, -92db) so that the resulting real-&lt;br&gt;
&amp;gt; time waveform is as accurate as possible?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is there some equation I can simply apply? I see a lot of&lt;br&gt;
&amp;gt; references to windowing in the literature, but no&lt;br&gt;
&amp;gt; information about how to reverse the effect of windowing&lt;br&gt;
&amp;gt; when going back from the frequency to the time domain.&lt;br&gt;
&amp;gt; Looking for practical advice how to compute this.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Best regards, -GGK&lt;br&gt;
&lt;br&gt;
A few thoughts:&lt;br&gt;
&lt;br&gt;
1) There is no need to apply a window just to implement a frequency&lt;br&gt;
domain filter.&lt;br&gt;
&lt;br&gt;
2) If you want to generate a windowed power spectrum from the data you&lt;br&gt;
are filtering, apply the window in the frequency domain after the FFT&lt;br&gt;
and after pulling off the unwindowed frequency domain data for the&lt;br&gt;
filter processing. The window you suggest belongs to the family of&lt;br&gt;
cosine-summed filters that can be applied as small convolutions in the&lt;br&gt;
frequency domain.&lt;br&gt;
&lt;br&gt;
3) Why are you considering the 4-term -92 db window instead of the&lt;br&gt;
correctly optimized 4-term -98 dB version Nuttall published in a&lt;br&gt;
correction to the harris paper?&lt;br&gt;
&lt;br&gt;
4) Windows can be applied as a matrix multiply in the frequency domain&lt;br&gt;
after the FFT. For the cosine-summed windows, this matrix has only&lt;br&gt;
near diagonal elements. For a discussion of the conditions under which&lt;br&gt;
the matrix is invertible and can be used to remove the windowing see&lt;br&gt;
section V of the article:&lt;br&gt;
Practical methods for rapid and accurate computation of&lt;br&gt;
interferometric spectra for remote sensing&lt;br&gt;
applications&lt;br&gt;
Barnet, C.D.   Blaisdell, J.M.   Susskind, J.&lt;br&gt;
Gen. Sci. Corp., Beltsville, MD, USA ;&lt;br&gt;
Geoscience and Remote Sensing, IEEE Transactions on&lt;br&gt;
Jan. 2000   Volume: 38 , Issue: 1   page(s): 169 - 183&lt;br&gt;
&lt;br&gt;
5) For examples of the use of windows in a transform-modify-&lt;br&gt;
inverse_transform context, look at pre and post processing used in&lt;br&gt;
audio compression schemes like MP3. Also look in the music analysis/&lt;br&gt;
synthesis literature.&lt;br&gt;
&lt;br&gt;
I hope that will give you a few ideas to consider.&lt;br&gt;
&lt;br&gt;
Dale B. Dalrymple&lt;br&gt;
&lt;a href="http://dbdimages.com"&gt;http://dbdimages.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 20 May 2008 14:26:02 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433142</link>
      <author>ggk </author>
      <description>Thanks,&lt;br&gt;
&lt;br&gt;
Is the Nuttall window you describe above called the &lt;br&gt;
Blackman-Nuttall window in this link?&lt;br&gt;
&lt;br&gt;
&lt;a href="http://en.wikipedia.org/wiki/Window_function#Nuttall_window."&gt;http://en.wikipedia.org/wiki/Window_function#Nuttall_window.&lt;/a&gt;&lt;br&gt;
2C_continuous_first_derivative&lt;br&gt;
&lt;br&gt;
The only paper reference I could find on the internet for &lt;br&gt;
Nuttall was the following:&lt;br&gt;
&lt;br&gt;
A.H. Nuttall, &amp;#8220; Some Windows with Very Good Sidelobe &lt;br&gt;
Behavior&amp;#8221;, IEEE Transactions on Acoustics, Speech, and &lt;br&gt;
Signal Processing, Volume 29, Issue 1, February 1981, pp. &lt;br&gt;
84 &amp;#8211; 91.&lt;br&gt;
&lt;br&gt;
Does the paper call it the Nuttall window? Thanks again, GGK&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 20 May 2008 17:38:55 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433176</link>
      <author>dbd</author>
      <description>On May 20, 7:26 am, "ggk " &amp;lt;ggkm...@comcast.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is the Nuttall window you describe above called the&lt;br&gt;
&amp;gt; Blackman-Nuttall window in this link?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href="http://en.wikipedia.org/wiki/Window_function#Nuttall_window."&gt;http://en.wikipedia.org/wiki/Window_function#Nuttall_window.&lt;/a&gt;&lt;br&gt;
&amp;gt; 2C_continuous_first_derivative&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The only paper reference I could find on the internet for&lt;br&gt;
&amp;gt; Nuttall was the following:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; A.H. Nuttall, &amp;#8220; Some Windows with Very Good Sidelobe&lt;br&gt;
&amp;gt; Behavior&amp;#8221;, IEEE Transactions on Acoustics, Speech, and&lt;br&gt;
&amp;gt; Signal Processing, Volume 29, Issue 1, February 1981, pp.&lt;br&gt;
&amp;gt; 84 &amp;#8211; 91.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Does the paper call it the Nuttall window? Thanks again, GGK&lt;br&gt;
&lt;br&gt;
Nuttall calls it the minimum 4-term window. The coefficients are given&lt;br&gt;
in (37) on page 89.&lt;br&gt;
&lt;br&gt;
Knowledgeable window selection is about tradeoffs. Nuttall provides&lt;br&gt;
enough examples with parameters to choose the best cosine-summed&lt;br&gt;
window up to 4 terms for most applications.&lt;br&gt;
&lt;br&gt;
Nuttall describes so many windows in this and other papers that&lt;br&gt;
'Nuttall window' has no useful descriptive value. The term 'Blackman -&lt;br&gt;
harris' has also been used for enough different things by enough&lt;br&gt;
authors to be meaningless by itself. Your inclusion of "4 term, -92dB"&lt;br&gt;
was quite appropriate and was the needed information that many people&lt;br&gt;
leave off.&lt;br&gt;
&lt;br&gt;
Your wki reference is, well, a wiki reference. It has some good&lt;br&gt;
information and more. It references good papers by harris and Nuttall&lt;br&gt;
but the descriptions of the papers show a lack of competence in the&lt;br&gt;
windowing literature and are grossly misleading. So read the&lt;br&gt;
references and take the rest as pretty pictures and probably having&lt;br&gt;
had good intentions. The equations given have probably been copied&lt;br&gt;
accurately. The interpretive comments are dubious.&lt;br&gt;
&lt;br&gt;
Dale B. Dalrymple&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 20 May 2008 21:31:53 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433211</link>
      <author>Rune Allnor</author>
      <description>On 20 Mai, 01:59, "ggk giust" &amp;lt;ggkm...@comcast.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; Greetings,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'd like to apply the blackman-harris window to my real-&lt;br&gt;
&amp;gt; time data array, before taking its FFT and applying a&lt;br&gt;
&amp;gt; frequency-domain filter to it.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; My question is, when I then do the inverse FFT, how do I&lt;br&gt;
&amp;gt; reverse the effect of windowing (in this case using&lt;br&gt;
&amp;gt; blackman-harris 4 term, -92db) so that the resulting real-&lt;br&gt;
&amp;gt; time waveform is as accurate as possible?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is there some equation I can simply apply? I see a lot of&lt;br&gt;
&amp;gt; references to windowing in the literature, but no&lt;br&gt;
&amp;gt; information about how to reverse the effect of windowing&lt;br&gt;
&amp;gt; when going back from the frequency to the time domain.&lt;br&gt;
&amp;gt; Looking for practical advice how to compute this.&lt;br&gt;
&lt;br&gt;
So you want to apply a window and then reverse the effects&lt;br&gt;
of the same window? That inspires the question why you think&lt;br&gt;
you want to apply the window in the first place. Keep in&lt;br&gt;
mind that windowing is not a voodoo ritual that needs to be&lt;br&gt;
performed in a seanse to please the powers of the CPU.&lt;br&gt;
&lt;br&gt;
Windowing is a technique which serves a very specific purpose.&lt;br&gt;
&lt;br&gt;
The shortish story is that 'windowing' is one of many ways to&lt;br&gt;
design FIR filters. The method is appealing because FIR&lt;br&gt;
filters are simple to implement (there are no weird numerical&lt;br&gt;
effects to consider) and FIR design by windowing is merely&lt;br&gt;
a cookbook exercise with no need for fancy software.&lt;br&gt;
&lt;br&gt;
Now, the windowing method is based on first finding a finite-&lt;br&gt;
length approximation of an ideal FIR filter, which is of&lt;br&gt;
infinite length. Truncating the ideal filter causes&lt;br&gt;
certain non-ideal effects to appear, most notably what&lt;br&gt;
is known as spectral leakage. There is no way to avoid&lt;br&gt;
this, so from here on the filter design problem consists&lt;br&gt;
of balancing a number of 'bad' factors:&lt;br&gt;
&lt;br&gt;
- Stop-band attenuation&lt;br&gt;
- Filter length&lt;br&gt;
- Transition bandwidth&lt;br&gt;
&lt;br&gt;
The different window functions have different properties:&lt;br&gt;
Some give short filters but mediocre stop band attenuation.&lt;br&gt;
Others give excellent stop band attenuation, but result&lt;br&gt;
in filters that have lots of coefficients and wide&lt;br&gt;
transition bands.&lt;br&gt;
&lt;br&gt;
And so on.&lt;br&gt;
&lt;br&gt;
The very short story is that you have to accept some&lt;br&gt;
'degradation' of the filtered signal. It is your&lt;br&gt;
responibilty as system designer to select a filter which&lt;br&gt;
cleans up the data while avoiding to distort the data&lt;br&gt;
too badly.&lt;br&gt;
&lt;br&gt;
Rune&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 20 May 2008 22:33:03 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433219</link>
      <author>ggk </author>
      <description>Dale, thanks... in your text&lt;br&gt;
&lt;br&gt;
"Nuttall calls it the minimum 4-term window. The &lt;br&gt;
coefficients are given in (37) on page 89."&lt;br&gt;
&lt;br&gt;
is (37) referencing a paper? Or is it just page 89 of the &lt;br&gt;
Nuttall paper I referenced above? &lt;br&gt;
&lt;br&gt;
Rune, thanks... I need to apply a window to separate the &lt;br&gt;
spurs from the random background noise. Then apply a &lt;br&gt;
bandpass filter to the result, take the inverse FFT, and &lt;br&gt;
reverse the effect of the window to get a real-time &lt;br&gt;
waveform to measure the PDF of zero-crossings (my ultimate &lt;br&gt;
goal). &lt;br&gt;
&lt;br&gt;
However, based on the response, it appears I'll need to re-&lt;br&gt;
think my methodology to remove the random noise from the &lt;br&gt;
real-time waveform. Assuming my windowing allows me to &lt;br&gt;
identify the relevant spurs in the waveform, how can I use &lt;br&gt;
this information to re-create an accurate real-time &lt;br&gt;
waveform having only these spurs in it (and not the random &lt;br&gt;
noise)? Perhaps a real-time filter with bandpasses only at &lt;br&gt;
those spur frequencies identified by the windowing...? &lt;br&gt;
&lt;br&gt;
Any recommendation for a new methodology, as reversing the &lt;br&gt;
effect of the windowing seems to out of the question. I &lt;br&gt;
wonder if I could just throw out the edges of the real-&lt;br&gt;
time waveform and use the center? (But I suspect the &lt;br&gt;
center is modified by windowing as well).&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 21 May 2008 02:21:08 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433233</link>
      <author>dbd</author>
      <description>On May 20, 3:33 pm, "ggk " &amp;lt;ggkm...@comcast.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; Dale, thanks... in your text&lt;br&gt;
&lt;br&gt;
&amp;gt; "Nuttall calls it the minimum 4-term window. The&lt;br&gt;
&amp;gt; coefficients are given in (37) on page 89."&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; is (37) referencing a paper? Or is it just page 89 of the&lt;br&gt;
&amp;gt; Nuttall paper I referenced above?&lt;br&gt;
&lt;br&gt;
(37) is the equation number in the paper where the coefficient values&lt;br&gt;
are given.&lt;br&gt;
&lt;br&gt;
Of the dozens of windows Nuttall has described, this one is the one&lt;br&gt;
that Matlab calls "nuttallwin" although there is no way to tell that&lt;br&gt;
from the documentation without looking to see if the coefficients are&lt;br&gt;
the same as in (37) on page 89 of the Nuttall paper. (They are.)&lt;br&gt;
&lt;br&gt;
&amp;gt; Rune, thanks...&lt;br&gt;
&lt;br&gt;
Windowing is still not always irreversible. As Rune points out,&lt;br&gt;
windowing may not even be needed for what you say you want to achieve.&lt;br&gt;
&lt;br&gt;
Go back to my original suggestion 5). You want to perform a transform-&lt;br&gt;
modify-inverse-transform process. So do the audio compression people.&lt;br&gt;
They compress and decompress as their 'modify' and apply windows&lt;br&gt;
complementary and compatible with reconstruction. Your 'modify' seems&lt;br&gt;
to be noise removal. Google on 'spectral subtraction' for an extensive&lt;br&gt;
literature on that topic.&lt;br&gt;
&lt;br&gt;
Good luck&lt;br&gt;
&lt;br&gt;
Dale B. Dalrymple&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 21 May 2008 07:02:03 -0400</pubDate>
      <title>Re: how to reverse windowing effect?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169570#433261</link>
      <author>Bruno Luong</author>
      <description>In the ideal world, reverse windowing effect could be&lt;br&gt;
possible, and what people calls "deconvolution".&lt;br&gt;
&lt;br&gt;
Convolution is multiply the signal with the kernel (windows&lt;br&gt;
- flipped if you are purist) in the frequency domain.&lt;br&gt;
Deconvolution consists thus of dividing the signal by the&lt;br&gt;
kernel, in the frequency domain of course.&lt;br&gt;
&lt;br&gt;
Deconvolution is an "ill-posed" problem, and must be treated&lt;br&gt;
with care. Adding a regularization term is one way. One of&lt;br&gt;
the technique for e-blurring image is deconvolution.&lt;br&gt;
&lt;br&gt;
Bruno&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
