[SciPy-Dev] Pull Req: Add periodogram and welch functions

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Dec 4 09:00:10 EST 2012


On Tue, Dec 4, 2012 at 7:51 AM, Eric Moore <ewm at redtetrahedron.org> wrote:
> josef.pktd at gmail.com wrote:
>> On Mon, Dec 3, 2012 at 10:26 PM, Jake Vanderplas
>> <vanderplas at astro.washington.edu>  wrote:
>>> Hi Eric,
>>> The contribution looks good.  Have you compared your results to those of
>>> matplotlib.mlab.psd()?  I believe that also implements Welch's method.
>>>      Jake
>>
>> I'm also glad someone provides this in scipy.
>>
>> nitime from the nipy community also has more spectral analysis.
>>
>> Just one question: Should the periodogram have a bandwidth, window
>> length choice?
>> for example what's the M in your "flattop" example.
>>
>> partial aside:
>> I worked on this for statsmodels some time (years) ago, but I never
>> could quite figure out how to do the windows smoothing with the
>> provided windows. (statsmodels only has raw, unwindowed periodogram
>> and spectral density from estimated IIR/ARMA coefficients.)
>> I didn't manage to get matplotlib's Welch implementation to work
>> meaningfully for short time series that we have in economics, but I
>> think your periodogram should "work like in the textbook".
>>
>> Thanks,
>> Josef
>>
>>> On 12/03/2012 06:54 PM, Eric Moore wrote:
>>>> Hi, I've just submitted a pull request to add a function to compute a
>>>> simple (modified) periodogram and a periodogram using Welch's method.
>>>>
>>>> The pull request is https://github.com/scipy/scipy/pull/373
>>>>
>>>> The biggest question I have with my implementation is whether welch
>>>> should support padded FFTs and detrending.  But I'm happy to hear any
>>>> feedback.
>>>>
>>>> Eric
>
> I'm not sure what M is.  The size of the window is nfft.


scipy.signal.flattop(M, sym=True)[source]¶
    The M-point Flat top window.
http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.flattop.html

More general question then:
How do I make a periodogram smooth or less smooth?

Josef

>
> Eric
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev



More information about the SciPy-Dev mailing list