Skip to content

mlab.psd behavior change #2565

@megies

Description

@megies

@toddrjen, 809411c breaks a test in @obspy that uses matplotlib.mlab.psd. Is a behavior change intended for 1.4.x? I would have to introduce more matplotlib version checking on our end then.. Or is this a bugfix in spectral estimation even? The commit message sounded like only refactoring was intended..

Here is an example of a program that yields different results after 809411c:

import numpy as np
from matplotlib import mlab

np.random.seed(1)
x = np.random.randn(100)
spec, freq = mlab.psd(x, NFFT=32, Fs=2, detrend=mlab.detrend_linear,
                      window=mlab.window_hanning, noverlap=20, pad_to=200,
                      sides="onesided", scale_by_freq=True)

Here is the image with the results before/after:
psd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions