DSPRelated.com
Forums

Why (if) should be windows in spectral analysis nonnegative ?

Started by Robert Rozman September 3, 2003
Hello,

I'm reading a lot of literature on windowing in spectral analysis but
haven't found theoretical cause of background for statement that windows
sequences should be nonnegative. It seems logical that weighting should be
done with positive factors but since gained frequency response is
convolution integral between "real" response and window's response there
seems to be no  cause for not to use for example design method for FIR
filter to construct window with "better" frequency response but with
negative time domain samples ?

Any comments, ideas and pointers ?

Thanks in advance,

Robert Rozman



Robert Rozman wrote:
> Hello, > > I'm reading a lot of literature on windowing in spectral analysis but > haven't found theoretical cause of background for statement that windows > sequences should be nonnegative. It seems logical that weighting should be > done with positive factors but since gained frequency response is > convolution integral between "real" response and window's response there > seems to be no cause for not to use for example design method for FIR > filter to construct window with "better" frequency response but with > negative time domain samples ? > > Any comments, ideas and pointers ? > > Thanks in advance, > > Robert Rozman > > >
Thomson's Multitaper windows, above the zeroth order, are positive and negative. In Matlab, these are the DPSS (discrete prolate spheroidal sequences) functions in the signal processing toolbox. They are also known as Slepian Sequences. Many classical window functions are polynomials with all their roots on the (Z domain) unit circle.
"Robert Rozman" <rozman@fri.uni-lj.si> wrote in message
news:bj4itk$kce$1@planja.arnes.si...
> Hello, > > I'm reading a lot of literature on windowing in spectral analysis but > haven't found theoretical cause of background for statement that windows > sequences should be nonnegative. It seems logical that weighting should be > done with positive factors but since gained frequency response is > convolution integral between "real" response and window's response there > seems to be no cause for not to use for example design method for FIR > filter to construct window with "better" frequency response but with > negative time domain samples ? >
Robert, It would help to keep the terminology clear. For example, you talk about windowing, weighting and convolution more or less together. So, it's a bit confusing. It's hard to know if you mean time domain or frequency domain in any particular phrase. In general, a multiplied window in time is real and positive - a weighting. If the window in time is centered at time zero, then the Fourier Transform of the window function is real but not necessarily positive. One can "window" by convolving in frequency with this frequency-domain function. A simple example is a gate or rectangular weighting - which we get for "free" if we do nothing to a time epoch. - We multiply by 1.0 over the epoch length T and by zero everywhere else in time. - Corrrespondingly, we convolve by a sinc function in frequency - which is not always positive. Either operation is equivalent to the other. The effect on the time-frequency pair is the same. Fred
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:Fun5b.694$v22.561185@feed2.centurytel.net...
> > "Robert Rozman" <rozman@fri.uni-lj.si> wrote in message > news:bj4itk$kce$1@planja.arnes.si... > > Hello, > > > > I'm reading a lot of literature on windowing in spectral analysis but > > haven't found theoretical cause of background for statement that windows > > sequences should be nonnegative. It seems logical that weighting should
be
> > done with positive factors but since gained frequency response is > > convolution integral between "real" response and window's response there > > seems to be no cause for not to use for example design method for FIR > > filter to construct window with "better" frequency response but with > > negative time domain samples ? > > > > Robert, > > It would help to keep the terminology clear. For example, you talk about > windowing, weighting and convolution more or less together. So, it's a
bit
> confusing. It's hard to know if you mean time domain or frequency domain
in
> any particular phrase. > > In general, a multiplied window in time is real and positive - a
weighting.
> > If the window in time is centered at time zero, then the Fourier Transform > of the window function is real but not necessarily positive. One can > "window" by convolving in frequency with this frequency-domain function.
I should have said if the window in time is centered at time zero *and even / symmetrical*.... Fred
Hello,

thanks for response and sorry for any inconvenience. I admit I wasn't clear
enough.

Let me repeat question in more precise way:

- I have for instance Hamming window (positive in time domain). Now I design
new window sequence of same length with method for design of optimal FIR
filter. I get new window that has lower side lobes in magnitude response but
is also negative in time domain. From magnitude response' point of view it
would be better since distortion from latter window should be smaller (lower
spectral leakage). But I've read in several articles that windows sequences
should be nonnegative in time domain.

Now I wonder if this statement has theoretical ground and proper theoretical
explanation.

Regards,

Robert Rozman.
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:Dsp5b.696$v22.568103@feed2.centurytel.net...
> > "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > news:Fun5b.694$v22.561185@feed2.centurytel.net... > > > > "Robert Rozman" <rozman@fri.uni-lj.si> wrote in message > > news:bj4itk$kce$1@planja.arnes.si... > > > Hello, > > > > > > I'm reading a lot of literature on windowing in spectral analysis but > > > haven't found theoretical cause of background for statement that
windows
> > > sequences should be nonnegative. It seems logical that weighting
should
> be > > > done with positive factors but since gained frequency response is > > > convolution integral between "real" response and window's response
there
> > > seems to be no cause for not to use for example design method for FIR > > > filter to construct window with "better" frequency response but with > > > negative time domain samples ? > > > > > > > Robert, > > > > It would help to keep the terminology clear. For example, you talk
about
> > windowing, weighting and convolution more or less together. So, it's a > bit > > confusing. It's hard to know if you mean time domain or frequency
domain
> in > > any particular phrase. > > > > In general, a multiplied window in time is real and positive - a > weighting. > > > > If the window in time is centered at time zero, then the Fourier
Transform
> > of the window function is real but not necessarily positive. One can > > "window" by convolving in frequency with this frequency-domain function. > > I should have said if the window in time is centered at time zero *and
even
> / symmetrical*.... > > Fred > > > >
I think you are confusing a "window" with "windowed filter coefficients".
The filter coefficients are created by multiplying the window by a sinx/x
(AKA sinc) function.  The window itself is not a filter per se--you don't
directly convolve the window with the input data.  Instead, you convolve the
windowed filter coefficients with the input data.

In your example, the Hamming window is positive in the time domain, but a
low-pass filter created using a Hamming window would have both positive and
negative values since it consists of the Hamming window multiplied by the
oscillating sinc function.  In your "method for design of optimal FIR
filter", presumably what you get out is the low-pass filter coefficients,
NOT a window.  If you want to see what the window would have looked like,
you can work backwards by dividing the filter coefficients by the
appropriate sinc function.  I suspect the optimal window will end up being
non-negative.

I Hope I am understanding you correctly and have cleared things up a bit.

-Jon


"Robert Rozman" <rozman@fri.uni-lj.si> wrote in message
news:bj5rmq$m9b$1@planja.arnes.si...
> Hello, > > thanks for response and sorry for any inconvenience. I admit I wasn't
clear
> enough. > > Let me repeat question in more precise way: > > - I have for instance Hamming window (positive in time domain). Now I
design
> new window sequence of same length with method for design of optimal FIR > filter. I get new window that has lower side lobes in magnitude response
but
> is also negative in time domain. From magnitude response' point of view it > would be better since distortion from latter window should be smaller
(lower
> spectral leakage). But I've read in several articles that windows
sequences
> should be nonnegative in time domain. > > Now I wonder if this statement has theoretical ground and proper
theoretical
> explanation. > > Regards, > > Robert Rozman. > "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > news:Dsp5b.696$v22.568103@feed2.centurytel.net... > > > > "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > > news:Fun5b.694$v22.561185@feed2.centurytel.net... > > > > > > "Robert Rozman" <rozman@fri.uni-lj.si> wrote in message > > > news:bj4itk$kce$1@planja.arnes.si... > > > > Hello, > > > > > > > > I'm reading a lot of literature on windowing in spectral analysis
but
> > > > haven't found theoretical cause of background for statement that > windows > > > > sequences should be nonnegative. It seems logical that weighting > should > > be > > > > done with positive factors but since gained frequency response is > > > > convolution integral between "real" response and window's response > there > > > > seems to be no cause for not to use for example design method for
FIR
> > > > filter to construct window with "better" frequency response but with > > > > negative time domain samples ? > > > > > > > > > > Robert, > > > > > > It would help to keep the terminology clear. For example, you talk > about > > > windowing, weighting and convolution more or less together. So, it's
a
> > bit > > > confusing. It's hard to know if you mean time domain or frequency > domain > > in > > > any particular phrase. > > > > > > In general, a multiplied window in time is real and positive - a > > weighting. > > > > > > If the window in time is centered at time zero, then the Fourier > Transform > > > of the window function is real but not necessarily positive. One can > > > "window" by convolving in frequency with this frequency-domain
function.
> > > > I should have said if the window in time is centered at time zero *and > even > > / symmetrical*.... > > > > Fred > > > > > > > > > >
"Robert Rozman" <rozman@fri.uni-lj.si> wrote in message
news:bj5rmq$m9b$1@planja.arnes.si...
> Hello, > > thanks for response and sorry for any inconvenience. I admit I wasn't
clear
> enough. > > Let me repeat question in more precise way: > > - I have for instance Hamming window (positive in time domain). Now I
design
> new window sequence of same length with method for design of optimal FIR > filter. I get new window that has lower side lobes in magnitude response
but
> is also negative in time domain. From magnitude response' point of view it > would be better since distortion from latter window should be smaller
(lower
> spectral leakage). But I've read in several articles that windows
sequences
> should be nonnegative in time domain. > > Now I wonder if this statement has theoretical ground and proper
theoretical
> explanation.
Robert, You didn't say what the optimization criteria or the objective function were for the "new window". So, maybe that's the difference. Here's a factoid: the definition of "window" is a function that is intended to minimize the main lobe width and minimize the side lobe amplitude simultaneously. van der Maas came up with the theoretical limiting function. Taylor found a physically realizable analytical approximation. I developed a method that was minimax in the sidelobe peaks (similar to Taylor) and would allow forcing zeros (such as for intersymbol interference reduction) at the same time. All of these methods result in a window that is real, even and always positive. Gibby and Smith extended the Nyquist criterion for bandwidth which has some interesting aspects in that the window has multiple zeros at the ends (but is still all positive). So, what can be said is that the optimum windows come out to be all positive. Why this would be the case is an interesting question that I'd have to think about. One guess is that many of these developments were done for antenna illumination weighting for beam pattern control. In those cases, the phase is equal across the array - which would preclude having zeros in the weighting (which would represent phase reversals). Think of this: The objective of a good window is to have its Fourier Transform approximate a dirac. The inverse transform of a dirac is flat response for all time. When we limit time, we generate a "gate" function which has a sinx/x Fourier Transform. The objective of windowing is to modify the "gate" so that the Fourier Transform is as narrow as possible yet have low sidelobes. This ultimately means that the main lobe in frequency will be wider than the main lobe of the sinx/x and that the sidelobes will have better properties than the sinx/x. We can start to approach improved windows by slightly tapering the edges of the gate. Then, by tapering the edges of the gate to zero perhaps. Then, by extending the taper region until the taper region extends from both ends to the middle. As soon as you introduce zeros in the middle of the window function, you have effectively shortened the window which results in a wider main lobe than necessary for a given sidelobe level. Wider main lobe, higher spectral leakage for nearby frequencies. So, it appears that your objective function was something like a lowpass filter? It wasn't something like a sinx/x I'd venture to guess. REd
"Jon Harris" <jon_harrisTIGER@hotmail.com> wrote in message
news:3f552fae$1_3@newsfeed.slurp.net...
> I think you are confusing a "window" with "windowed filter coefficients". > The filter coefficients are created by multiplying the window by a sinx/x > (AKA sinc) function. The window itself is not a filter per se--you don't > directly convolve the window with the input data. Instead, you convolve
the
> windowed filter coefficients with the input data. > > In your example, the Hamming window is positive in the time domain, but a > low-pass filter created using a Hamming window would have both positive
and
> negative values since it consists of the Hamming window multiplied by the > oscillating sinc function. In your "method for design of optimal FIR > filter", presumably what you get out is the low-pass filter coefficients, > NOT a window. If you want to see what the window would have looked like, > you can work backwards by dividing the filter coefficients by the > appropriate sinc function. I suspect the optimal window will end up being > non-negative.
Jon, I always thought a window could be viewed as a filter (but in the opposite domain). That is, with respect to where multiplication and where convolution occur. I don't understand how you've brought sincs together with a Hamming window. Of course, if we talk in the continuous domains, a Hamming window is time-limited and therefore is not bandlimited. Because it's time limited, it can be constructed with an infinite family of frequency domain sincs. That's very different from "the Hamming window multiplied by the oscillating sinc function." It would be correct to say that the Hamming window is used to multiply a gate in time and, correspondingly, convolves with the gate's (sinc) Fourier Transform which is pretty much the same thing as saying it can be built up of an infinite family of superimposed shifted sincs. I don't see how dividing filter coefficients by a sinc would yield anything interesting. Let's see: let's start with a FIR filter and its frequency response. If we divide by a sinc in time then that's the same as multiplying by the inverse of the sinc in time. Lots of zeros to deal with so lots of infinities to deal with. But, ignoring that for now, this is the same as convolving in the frequency domain with the Fourier Transform of the inverse of the time sinc. Awww, I give up.... I don't think this goes anywhere that's useful. Anyway, it does appear that the OP has confusion regarding what a window is. Fred
Robert Rozman <rozman@fri.uni-lj.si> wrote in message
news:bj4itk$kce$1@planja.arnes.si...
> Hello, > > I'm reading a lot of literature on windowing in spectral analysis but > haven't found theoretical cause of background for statement that
windows
> sequences should be nonnegative.
It is commonly assumed that the purpose of a window is to maximize main lobe response compared to sidelobe response. This goal leads to the assumption of the desirability of positivity. Positive only windows are also easier to optimize in some respects.
>It seems logical that weighting should be > done with positive factors but since gained frequency response is > convolution integral between "real" response and window's response
there
> seems to be no cause for not to use for example design method for FIR > filter to construct window with "better" frequency response but with > negative time domain samples ?
This is true if you have other goals. Robert Rozman <rozman@fri.uni-lj.si> wrote in message news:bj5rmq$m9b$1@planja.arnes.si...
> Hello,
...
> - I have for instance Hamming window (positive in time domain). Now I
design
> new window sequence of same length with method for design of optimal
FIR
> filter. I get new window that has lower side lobes in magnitude
response but
> is also negative in time domain. From magnitude response' point of
view it
> would be better since distortion from latter window should be smaller
(lower
> spectral leakage). But I've read in several articles that windows
sequences
> should be nonnegative in time domain. >
Again this is true for the often unstated assumption. Jon Harris <jon_harrisTIGER@hotmail.com> wrote in message news:3f552fae$1_3@newsfeed.slurp.net...
> I think you are confusing a "window" with "windowed filter
coefficients".
> The filter coefficients are created by multiplying the window by a
sinx/x
> (AKA sinc) function. The window itself is not a filter per se--you
don't
> directly convolve the window with the input data. Instead, you
convolve the
> windowed filter coefficients with the input data. > > In your example, the Hamming window is positive in the time domain,
but a
> low-pass filter created using a Hamming window would have both
positive and
> negative values since it consists of the Hamming window multiplied by
the
> oscillating sinc function. In your "method for design of optimal FIR > filter", presumably what you get out is the low-pass filter
coefficients,
> NOT a window. If you want to see what the window would have looked
like,
> you can work backwards by dividing the filter coefficients by the > appropriate sinc function. I suspect the optimal window will end up
being
> non-negative. > > I Hope I am understanding you correctly and have cleared things up a
bit. Robert Rozman's language is a little hard to follow, but works either way we look at it. If he intends a time domain weighting before a Fourier transform he does have a window with negative values. If he means a FIR filter coefficient set, then the filter output is still the DC term of a Fourier transform with that coefficient set as time domain window. Fred Marshall <fmarshallx@remove_the_x.acm.org> wrote in message news:C6w5b.707$v22.590005@feed2.centurytel.net...
>
...
> > You didn't say what the optimization criteria or the objective
function were
> for the "new window". So, maybe that's the difference. > > Here's a factoid: the definition of "window" is a function that is
intended
> to minimize the main lobe width and minimize the side lobe amplitude > simultaneously. van der Maas came up with the theoretical limiting > function. Taylor found a physically realizable analytical
approximation. I
> developed a method that was minimax in the sidelobe peaks (similar to > Taylor) and would allow forcing zeros (such as for intersymbol
interference
> reduction) at the same time. All of these methods result in a window
that
> is real, even and always positive. Gibby and Smith extended the
Nyquist
> criterion for bandwidth which has some interesting aspects in that the > window has multiple zeros at the ends (but is still all positive). >
Here Fred Marshall has finally stated the assumption and elevated it to "factoid".
> So, what can be said is that the optimum windows come out to be all > positive. Why this would be the case is an interesting question that
I'd
> have to think about. One guess is that many of these developments
were done
> for antenna illumination weighting for beam pattern control. In those > cases, the phase is equal across the array - which would preclude
having
> zeros in the weighting (which would represent phase reversals). > > Think of this: The objective of a good window is to have its Fourier > Transform approximate a dirac. The inverse transform of a dirac is
flat
> response for all time. When we limit time, we generate a "gate"
function
> which has a sinx/x Fourier Transform. The objective of windowing is
to
> modify the "gate" so that the Fourier Transform is as narrow as
possible yet
> have low sidelobes. This ultimately means that the main lobe in
frequency
> will be wider than the main lobe of the sinx/x and that the sidelobes
will
> have better properties than the sinx/x. >
An alternate definition of window could be the weighting applied in the time domain to control the frequency domain response. Antenna folk often use the above assumption made by Fred Marshall. Instumentation designers who want accurate amplitude measurements of high SNR tones from a frequency domain representation trade off efficiency for accuracy. For them the flat response is desired in the frequency domain. The goal is a flat topped rectangular shape instead of a "dirac". The corresponding time domain response then approaches a "sinc" which has positive and negative values. Commercial instruments from B&K, Agilent and Tektronics provide flatness to less than 0.01 dB with "flattop window" weights applied as time domain weights or as frequency domain convolutions by kernals with real time domain equivalent responses with negative values. An example of this kind of response can be designed with a Kaiser-Bessel weight applied as a weight to a sinc weight with two time domain zeros on each side of the time center of the weight. Windows can be negative if you have your reasons. Dale B. Dalrymple Sr. Staff Systems Engineer Signal Processing Systems ISL Inc.
"Robert Rozman" <rozman@fri.uni-lj.si> wrote in message news:<bj4itk$kce$1@planja.arnes.si>...
> Hello, > > I'm reading a lot of literature on windowing in spectral analysis but > haven't found theoretical cause of background for statement that windows > sequences should be nonnegative. It seems logical that weighting should be > done with positive factors but since gained frequency response is > convolution integral between "real" response and window's response there > seems to be no cause for not to use for example design method for FIR > filter to construct window with "better" frequency response but with > negative time domain samples ?
I think this is a matter of finding a method for designing filters that both can be done without very sophisticated tools, and that also yields relevant filters. As you and others have commented on, it is possible to construct "better" filters, that meets the specs and that are not confined by the limits of the "usual" window functions. However, doing that requires quite sophisticated optimization software and rather powerful computers. With the "naive" filter specs and one or two simple window functions, the designer can get a filter up and running by using nothing more than a piece of paper and the simplest hand calculator (I'm not quite old enough to mention the slide rule...) in, say, half an hour's time. So in my view, it's a matter of getting the job done with a minimum of tools available. Complicated window functions quickly become too complex for a human to work with. And once you bring in the computer to optimize the filter coefficients, you don't need the window functions anyway. Rune