[SciPy-Dev] adding more window functions to scipy.signal

Charles R Harris charlesr.harris at gmail.com
Fri Jan 6 20:21:34 EST 2017


IIRC, I liked this reference
<https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwisqN3D7a7RAhVC6WMKHZJfAUAQFggaMAA&url=https%3A%2F%2Fwww.utdallas.edu%2F~cpb021000%2FEE%25204361%2FGreat%2520DSP%2520Papers%2FHarris%2520on%2520Windows.pdf&usg=AFQjCNHZqACfi_AlFJH_sUthirWTolRIkQ&sig2=y9VJJZUrXejwFhxhsm3mLg&bvm=bv.142059868,d.cGc>,
or another by the same author. It is old, but has a nice table. Perhaps the
windows functions should return an object that also contains the computed
figures of merit.

Chuck

On Fri, Jan 6, 2017 at 6:04 PM, Charles R Harris <charlesr.harris at gmail.com>
wrote:

>
>
> On Thu, Jan 5, 2017 at 10:27 PM, Ralf Gommers <ralf.gommers at gmail.com>
> wrote:
>
>>
>>
>> On Fri, Jan 6, 2017 at 6:07 PM, Nathaniel Smith <njs at pobox.com> wrote:
>>
>>> On Thu, Jan 5, 2017 at 8:58 PM, Ralf Gommers <ralf.gommers at gmail.com>
>>> wrote:
>>> > Hi all,
>>> >
>>> > There are 3 PRs open for adding new window functions to scipy.signal:
>>> > - Kaiser-Bessel, https://github.com/scipy/scipy/pull/4747
>>> > - Planck, https://github.com/scipy/scipy/pull/6012 (also interest in
>>> adding
>>> > Planck-Bessel there)
>>> > - Lanczos, https://github.com/scipy/scipy/pull/6837
>>> >
>>> > So far Kaiser-Bessel and Lanczos got a positive reception, Planck
>>> didn't
>>> > because it looks too specific - only uses found are in gravitational
>>> wave
>>> > research.
>>> >
>>> > One of the annoyances with the window functions is that they really
>>> clutter
>>> > the signal namespace as we keep on adding more. We have two options I
>>> think:
>>> >
>>> > 1. Keep on adding new window functions with the current style
>>> (provided that
>>> > they're general enough, i.e. used in more than one field).
>>> > 2. Only add them behind a unified interface, like signal.get_window.
>>> Could
>>> > also be a new interface, not everyone is a fan of get_window (see
>>> > https://github.com/scipy/scipy/pull/6837).
>>>
>>> Not sure what you're pointing to with that link,
>>
>>
>> Sorry, copy-paste error - should be https://github.com/scipy/scipy
>> /pull/6895
>>
>>
>>> but isn't get_window
>>> basically reinventing the concept of the python namespace? Maybe
>>> declare scipy.signal.windows (which already exists!) to be the public
>>> namespace where you find your windows?
>>>
>>
>> Not really. For example, from gh-6895, this (which uses get_window):
>>>
>>
>>     signal.firwin(80, 0.5, window=('kaiser', 8))
>>
>> is equivalent to:
>>
>>    signal.firwin(80, 0.5, window=functools.partial(signal.kaiser,
>> beta=8))
>>
>> Despite the arguments in gh-6895, I'm quite sure that most users prefer
>> not to have to know about functools.partial.
>>
>> Agreed that get_window is a bit ugly though ...
>>
>
> Once upon a time (the 80's called) I solved the problem by providing
> Kaiser-Bessell windows for a select set of side lobes, basically negative
> powers of ten.  Maybe there is a better way to parameterize the windows
> functions that isn't specific to the type. In practice, one is usually
> interested in half width, side lobe, and fall off and the different windows
> achieve different tradeoffs.
>
> Chuck
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20170106/86e6d5f4/attachment.html>


More information about the SciPy-Dev mailing list