PDA

View Full Version : How to design/specify a window?


Richard Owlett
01-19-2006, 11:45 PM
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

Mike Yarwood
01-20-2006, 12:13 AM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
>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

Richard Owlett
01-20-2006, 12:48 AM
Mike Yarwood wrote:

> "Richard Owlett" <[email protected]> wrote in message
> news:[email protected]...
>
>>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?

Mike Yarwood
01-20-2006, 01:09 AM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
> Mike Yarwood wrote:
>
>> "Richard Owlett" <[email protected]> wrote in message
>> news:[email protected]...
>>
>>>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

Richard Owlett
01-20-2006, 02:08 AM
Mike Yarwood wrote:

> "Richard Owlett" <[email protected]> wrote in message
> news:[email protected]...
>
>>Mike Yarwood wrote:
>>
>>
>>>"Richard Owlett" <[email protected]> wrote in message
>>>news:[email protected]...
>>>
>>>
>>>>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 ;]

Jerry Avins
01-20-2006, 03:16 AM
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Fred Marshall
01-20-2006, 08:06 AM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
>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

Richard Owlett
01-20-2006, 02:32 PM
Fred Marshall wrote:

> "Richard Owlett" <[email protected]> wrote in message
> news:[email protected]...

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
>
>

Jerry Avins
01-20-2006, 05:00 PM
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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Richard Owlett
01-20-2006, 05:19 PM
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?

Jerry Avins
01-20-2006, 06:01 PM
Richard Owlett wrote:
> 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?

None of the above. Which approximation best suits your purpose?

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Fred Marshall
01-20-2006, 06:41 PM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
> Fred Marshall wrote:
....................
>
>> 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?
>

Well, no wonder you're having a bit of trouble. With all respect, that page
doesn't help a heck of a lot.

the first window is over a scale of -256 to + 256 and the frequency response
starts at f=0 and is plotted on a log scale.

the second window is over a scale of -N/2 to +N/2 and the frequency response
is centered at f=0 and is plotted on a linear scale. (The implication of
this is that the first window has N=512).

So, no wonder you don't see the differences directly. It's simply a poor
presentation if you want to compare windows. I'm sure there are any number
of better presentations on the web.

You would learn a lot by computing the Fourier Transforms of various windows
yourself. Then you could plot them using the same registration, normalized
amplitude and log magnitude so you can see the fine detail.

Fred

Richard Owlett
01-20-2006, 07:49 PM
Fred Marshall wrote:

> "Richard Owlett" <[email protected]> wrote in message
> news:[email protected]...
>
>>Fred Marshall wrote:
>
> ...................
>
>>>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?
>>
>
>
> Well, no wonder you're having a bit of trouble. With all respect, that page
> doesn't help a heck of a lot.
>
> the first window is over a scale of -256 to + 256 and the frequency response
> starts at f=0 and is plotted on a log scale.
>
> the second window is over a scale of -N/2 to +N/2 and the frequency response
> is centered at f=0 and is plotted on a linear scale. (The implication of
> this is that the first window has N=512).
>
> So, no wonder you don't see the differences directly. It's simply a poor
> presentation if you want to compare windows. I'm sure there are any number
> of better presentations on the web.

Actually I came across while looking for the definition of "raised
cosine". I referred to the figures as they WERE an *EXTREME* case of
comparing apples to oranges.


>
> You would learn a lot by computing the Fourier Transforms of various windows
> yourself. Then you could plot them using the same registration, normalized
> amplitude and log magnitude so you can see the fine detail.

Ah which parameter(s) to normalize so they would match how I would use it.

Working in Scilab I will chose to hold constant
max window height = 1.0
test vector size = 10,000
center window at 5,000
window width = 1,000

A problem is what to chose as the "window width". Is it the 50%, 70.7%
or 90% points?

I would initially compare rectangular, triangular, truncated triangular,
and any of the standard windows built into Scilab.

I'm also mulling using a sinc as a window. Its fft would be an
understandable shape. Does anyone ever do that?


>
> Fred
>
>

Jerry Avins
01-20-2006, 08:41 PM
Richard Owlett wrote:

...

> Actually I came across while looking for the definition of "raised
> cosine". I referred to the figures as they WERE an *EXTREME* case of
> comparing apples to oranges.

Raised cosine == von Hann


The window width should match the number of data points. (If the end
window values are zero, make the width two larger.)

> A problem is what to chose as the "window width". Is it the 50%, 70.7%
> or 90% points?
>
> I would initially compare rectangular, triangular, truncated triangular,
> and any of the standard windows built into Scilab.
>
> I'm also mulling using a sinc as a window. Its fft would be an
> understandable shape. Does anyone ever do that?

You can't. It's infinite in extent.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

dbell
01-20-2006, 09:09 PM
Jerry,

Wouldn't the Hamming window also be a raised cosine window?

I think "raised cosine" is a family of windows.

Dirk


Jerry Avins wrote:

<clipped>

>
> Raised cosine == von Hann
>
>
<clipped>

Richard Owlett
01-20-2006, 09:45 PM
Jerry Avins wrote:

> Richard Owlett wrote:
>
> ...
>
>> Actually I came across while looking for the definition of "raised
>> cosine". I referred to the figures as they WERE an *EXTREME* case of
>> comparing apples to oranges.
>
>
> Raised cosine == von Hann
>
>
> The window width should match the number of data points. (If the end
> window values are zero, make the width two larger.)



We may not being talking about quite the same thing.
Time I get down to producing some Scilab code so I and others can
visualize what I'm thinking.


>
>> A problem is what to chose as the "window width". Is it the 50%, 70.7%
>> or 90% points?
>>
>> I would initially compare rectangular, triangular, truncated
>> triangular, and any of the standard windows built into Scilab.
>>
>> I'm also mulling using a sinc as a window. Its fft would be an
>> understandable shape. Does anyone ever do that?
>
>
> You can't. It's infinite in extent.

In theory I agree. However, computers have finite precision/resolution.
IF x < epsilon THEN x = 0
So it would be equivalent of multiplying a "sinc window" by "much wider
rectangular window" giving an OWLwindow ;)

Would not the FFT(OWLwindow) ~= FFT(sinc window) ?




>
> Jerry

Jerry Avins
01-20-2006, 10:22 PM
dbell wrote:
> Jerry,
>
> Wouldn't the Hamming window also be a raised cosine window?
>
> I think "raised cosine" is a family of windows.

Raised cosine on a pedestal. The pedestal is a way to suppress the first
sidelobe at the expense of raising all the others. BTW: raised cosine is
another way to say sine squared. sin^2(2x) = 1/2 + cos(x)/2. The added
1/2 raises the cosine term to make it all positive.

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Jerry Avins
01-20-2006, 10:27 PM
Richard Owlett wrote:

...

> Would not the FFT(OWLwindow) ~= FFT(sinc window) ?

If you keep enough terms so that the lopped-off ones couldn't be
represented, yes. That means that the smallest term kept will be about
1/2^31. I haven't figured out how many that will be, but the operative
part of that is "many".

jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Fred Marshall
01-20-2006, 10:28 PM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
> Ah which parameter(s) to normalize so they would match how I would use it.
>
> Working in Scilab I will chose to hold constant
> max window height = 1.0
> test vector size = 10,000
> center window at 5,000
> window width = 1,000
>
> A problem is what to chose as the "window width". Is it the 50%, 70.7% or
> 90% points?
>
> I would initially compare rectangular, triangular, truncated triangular,
> and any of the standard windows built into Scilab.
>

The window width is 100% of the window I should think. It would not be very
useful to use a window that's shorter than the data set unless you have a
reason to do so. Otherwise window the entire data set. The shorter the
window, the coarser the frequency resolution - so use all the data you have
if possible.

Normalization might more likely be so that the frequency response is 1.0 in
one or more passbands. A very common one is that the sum of the
coefficients (which is the same as the dc response) is 1.0.

> I'm also mulling using a sinc as a window. Its fft would be an
> understandable shape. Does anyone ever do that?

Yes. But it has to be a trunctated sinc or a windowed sinc. Normally the
sinc-like function is the transform of the window function. So a sinc
"window" is a bit strange. I'd not contemplate that terminology further. A
window is most typically a gradual weighting of a data set with the
objective of removing sharp edges in the data and getting less ripple in the
opposite domain. A sinc doesn't fit that property but its transform does
sort of .... it's a rectangular window function - the worst one of all
really.

Fred

Richard Owlett
01-20-2006, 10:59 PM
Fred Marshall wrote:

> "Richard Owlett" <[email protected]> wrote in message
> news:[email protected]...
>
>>Ah which parameter(s) to normalize so they would match how I would use it.
>>
>>Working in Scilab I will chose to hold constant
>>max window height = 1.0
>>test vector size = 10,000
>>center window at 5,000
>>window width = 1,000
>>
>>A problem is what to chose as the "window width". Is it the 50%, 70.7% or
>>90% points?
>>
>>I would initially compare rectangular, triangular, truncated triangular,
>>and any of the standard windows built into Scilab.
>>
>
>
> The window width is 100% of the window I should think. It would not be very
> useful to use a window that's shorter than the data set unless you have a
> reason to do so.

My incoming data is essentially infinite in extent ;}


> Otherwise window the entire data set. The shorter the
> window, the coarser the frequency resolution - so use all the data you have
> if possible.

That could be VERY interesting. One data source is sampled once per
second should be available for decades ;] Can you say "GPS"?



>
> Normalization might more likely be so that the frequency response is 1.0 in
> one or more passbands. A very common one is that the sum of the
> coefficients (which is the same as the dc response) is 1.0.
>
>
>>I'm also mulling using a sinc as a window. Its fft would be an
>>understandable shape. Does anyone ever do that?
>
>
> Yes. But it has to be a trunctated sinc or a windowed sinc. Normally the
> sinc-like function is the transform of the window function. So a sinc
> "window" is a bit strange. I'd not contemplate that terminology further. A
> window is most typically a gradual weighting of a data set with the
> objective of removing sharp edges in the data and getting less ripple in the
> opposite domain. A sinc doesn't fit that property but its transform does
> sort of .... it's a rectangular window function - the worst one of all
> really.

WHY?
IS IT REALLY?
;}

Actually, we need some frames of reference as to just what is desirable.

I'm interested in the "instantaneous spectrum" of a signal.
[ perhaps someone should fund a prise for the most mutually exclusive
statements implied above ;]




>
> Fred
>
>

Naebad
01-21-2006, 12:55 AM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
> I am neophyte [ perhaps read ignorant ;]
>
> I've been told that a poorly chosen window can cause problems .}
>
>
Absolutely - but recommend double glazing. Get's rid of the drafts as well
as the noise from the street.

Naebad

Richard Owlett
01-21-2006, 01:09 AM
Naebad wrote:
> "Richard Owlett" <[email protected]> wrote in message
> news:[email protected]...
>
>>I am neophyte [ perhaps read ignorant ;]
>>
>>I've been told that a poorly chosen window can cause problems .}
>>
>>
>
> Absolutely - but recommend double glazing. Get's rid of the drafts as well
> as the noise from the street.
>
> Naebad
>
>

Love that attitude. Am currently suffering a severe Ozark winter. Its
January and 60 F ;]

PS grew up in upstate NY ;!

Fred Marshall
01-21-2006, 07:24 AM
"Richard Owlett" <[email protected]> wrote in message
news:[email protected]...
> Fred Marshall wrote:
>
>> "Richard Owlett" <[email protected]> wrote in message
>> news:[email protected]...
>>
>>>Ah which parameter(s) to normalize so they would match how I would use
>>>it.
>>>
>>>Working in Scilab I will chose to hold constant
>>>max window height = 1.0
>>>test vector size = 10,000
>>>center window at 5,000
>>>window width = 1,000
>>>
>>>A problem is what to chose as the "window width". Is it the 50%, 70.7% or
>>>90% points?
>>>
>>>I would initially compare rectangular, triangular, truncated triangular,
>>>and any of the standard windows built into Scilab.
>>>
>>
>>
>> The window width is 100% of the window I should think. It would not be
>> very useful to use a window that's shorter than the data set unless you
>> have a reason to do so.
>
> My incoming data is essentially infinite in extent ;}

***It appears you have a reason to do so..... That doesn't change the basis
for the suggestion, just your application of it.

>
>
>> Otherwise window the entire data set. The shorter the window, the
>> coarser the frequency resolution - so use all the data you have if
>> possible.
>
> That could be VERY interesting. One data source is sampled once per second
> should be available for decades ;] Can you say "GPS"?


***Once more, the observation stands. How you apply it to a particular
situation is up to you.

Jerry Avins
01-21-2006, 06:14 PM
Richard Owlett wrote:

...

> My incoming data is essentially infinite in extent ;}

Then you need to break it into pieces that last about half as long as
the time resolution you want. You can't resolve minute-to-minute
variations in data that have been averaged for an hour.

...

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Rune Allnor
01-22-2006, 07:10 PM
Richard Owlett wrote:
> Mike Yarwood wrote:
>
> > "Richard Owlett" <[email protected]> wrote in message
> > news:[email protected]...
> >
> >>Mike Yarwood wrote:
> >>
> >>
> >>>"Richard Owlett" <[email protected]> wrote in message
> >>>news:[email protected]...
> >>>
> >>>
> >>>>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 ;]

Don't know of an "owl2normal" translation, but here's an
"owl2allnor"...

As you know, filters are basically eilther FIR or IIR. The term
"window"
is usually associated with a FIR filter while the term "maximally flat"
is
usually associated with IIR filters, more specifically Butterworth
filters.

So it appears you might be comparing apples and oranges.

Now, a closer reading of your post suggests that "maximally flat" might

not be the best term to use when decribing your problem. I suspect
you mean that the transition band is 1/1000th of the 0 - Fs/2 interval.


What you need to do, then, in order to design your filter, is something

like this:

1) Choose between FIR or IIR architecture
If FIR:
a) Choose window type (hann, hamming, kaiser...)
a.1) If Kaiser, set a stopband attenuation
b) Estimate the number M of coefficients necessary
c) Compute a sing pulse of length M
d) If applicable, transform from LP to HP, BP or BS
e) Apply the window to the sinc
f) Compute the DFT of the filter impulse response and see if it
works.

If IIR:
a) Choose filter type (Butterworth, Cheb 1/2, elliptic)
b) Choose a passband ripple and stop-band attenuation
c) Pre-warp frequencies from discrete-time to continuous-time domain
d) Estimate the necessary order of the filter
e) Compute a LP filter prototype
f) Transform from continuous-time to discrete-time domain
g) Apply the relevant frequency transform
h) Compute the impulse response
i) Compute the DFT of the filter impulse response and see if it
works

The nuts and bolts of almost all of these steps depend on the filter
type
you choose. Now, Rick's book doesn't contain many details about what to
do.
I haven't found a book yet, that goes into these details in a very
useful way.
Most books use the Butterworth LP filter as an example on how to design

a lowpass filter from an analog prototype. Some books show how to use
the Kaiser window when designing a FIR lowpass filter, and that's about
it.

Rune