Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

The y-axis label of figures created with psd() should not say "Density" when scale_by_freq=False #862

roger- opened this Issue May 10, 2012 · 6 comments


None yet
5 participants

roger- commented May 10, 2012

When the scale_by_freq parameter is False, a more appropriate description might be "Power spectrum (dB)".

See definition here: http://en.wikipedia.org/wiki/Spectral_density#Power_spectral_density


mdboom commented May 11, 2012

@efiring, @dopplershift: It looks like you guys were the last to work around the psd code. Any opinions?


dopplershift commented May 11, 2012

Technically correct, but I was just trying to keep code simple in the
psd() plotting method.

On Fri, May 11, 2012 at 8:51 AM, Michael Droettboom

@efiring, @dopplershift: It looks like you guys were the last to work around the psd code.  Any opinions?

Reply to this email directly or view it on GitHub:
#862 (comment)

Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma


efiring commented Oct 13, 2013

@dopplershift, I am trying to clean up the labels and documentation for these functions, and I find the docstring for Fc to be completely incomprehensible. It sounds like what you are really trying to describe is heterodyning: mixing with a given frequency and low-pass filtering. But that leaves frequencies shifted down, and positive Fc corresponds to the case where frequencies have been shifted up. Whatever it is, Fc seems to be too arcane to be included in the quick and dirty psd and csd Axes methods. Actually, it is highly debatable whether we should even have such methods, and if we do, whether they should be using db. But we are stuck with them for now. Unless you can come up with a really short, clear explanation of how and when one uses Fc, I think we should deprecate it.


dopplershift commented Nov 14, 2013

@efiring I'm not clear on what you mean by Fc? I don't see that string anywhere in the entire mlab.py file.

If you're talking about Fs, we absolutely need to keep this, as this represents the sampling frequency. Providing this allows psd() and company to display the x-axis in physical units (Hz) rather than normalized frequency.


efiring commented Nov 14, 2013

@dopplershift, Fc is not in mlab, but it is in all the pyplot functions and axes methods.

Regarding Fs, yes, it is essential--but for many applications, Hz is not a customary physical unit for frequency, so probably yet another kwarg is needed in the axes methods and pyplot functions to allow alternatives.


tacaswell commented Aug 18, 2014

These functions were overhauld by @toddrjen in #2522 #2547 and #2571

@roger- Please ping to have this re-opened if these changes don't fully address your concerns.

@tacaswell tacaswell closed this Aug 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment