FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

mlab.psd behaviour has changed in 1.5.x, psd depends on window size NFFT? · Issue #7237 · matplotlib/matplotlib · GitHub

Repository navigation

mlab.psd behaviour has changed in 1.5.x, psd depends on window size NFFT? #7237

Closed

Description

Issue seen in matplotlib 1.5.3, Linux, installed with pip.

Retesting software that was originally written in matplotlib 1.4 times, I am noticing a huge discrepancy in psd plots.

It looks like recent matplotlib mlab.psd fails to properly normalize the psd wrt the window size NFFT (at least when scale_by_freq is set to False).

As a result psd plots (in dB) are shifted up and down when the NFFT parameter is changed.

It is unclear to me if this is an intended result. In any case, it does not seem to be documented.

Activity

  1. efiring commented on Oct 8, 2016

    Member

    This is intended--it is the way the "power spectrum" works, as opposed to the "power density spectrum". The former is what you get with scale_by_freq=False, the latter with True. It is illustrated in the second plot here: http://currents.soest.hawaii.edu/ocn_data_analysis/_static/Spectrum.html. As NFFT changes, the power spectrum preserves the height of a spectral peak from a single sinusoid, but not the level of a broad-bandwidth background. The reverse is true of the power spectral density.

    See #4328 and #4593.

  2. callegar commented on Oct 10, 2016

    Author

    I was expecting that. My point was actually the change in behavior wrt previous matplotlib versions that I did not find in the changelog and that ended up breaking backwards compatibility. Possibly I missed that.

  3. efiring commented on Oct 10, 2016

    Member

    No, I think we missed it. It looks like it should be in http://matplotlib.org/api/api_changes.html, but isn't.

  4. added this to the milestone on Oct 11, 2016
  5. modified the milestones: , on May 3, 2017
  6. modified the milestones: , on Oct 9, 2017
  7. jklymak commented on Jan 28, 2023

    Member

    This is really old history - closing...

  8. removed this from the future releases milestone on Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL