mlab.psd API

Hi,

How much freedom would I (and my colleague) have in changing up some of
the behavior/API of mlab.psd? My current issues with the function:

1) Returning one-sided or two-sided depends on whether the data is
complex. I'd like that to be controlled by a keyword parameter (could
take strings, such as 'two-sided' like matlab)

2) We'd like to add a parameter to control how many points are used for
performing the FFT (automatic zero padding for increased plotting
detail). The obvious name for this would be nfft, but this seems to
conflict with the NFFT parameter. NFFT, confusingly, is used to specify
the blocksize used for averaging. If we can't outright change names
here, I'd love for suggestions on a good way forward.

3) Can we remove the requirement for even NFFT (blocksize)?

Ryan

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Hi,

How much freedom would I (and my colleague) have in changing up some of
the behavior/API of mlab.psd? My current issues with the function:

1) Returning one-sided or two-sided depends on whether the data is
complex. I'd like that to be controlled by a keyword parameter (could
take strings, such as 'two-sided' like matlab)

Sounds good

2) We'd like to add a parameter to control how many points are used for
performing the FFT (automatic zero padding for increased plotting
detail). The obvious name for this would be nfft, but this seems to
conflict with the NFFT parameter. NFFT, confusingly, is used to specify
the blocksize used for averaging. If we can't outright change names
here, I'd love for suggestions on a good way forward.

I wrote this function a *long* time ago, so my memory is a little
hazy, but I don't find the terminology confusing. The method breaks
the sequence into NFFT sized chunks and does an fft on each NFFT
length piece, so that is the length of the fft. Perhaps an addition
pad argument if you want to zero pad the chunks?

I intended to replicate the matlab function when I wrote this, and
vaguely recall that I did some close comparisons on the output, but if
I am misusing this parameter let me know. Some (possibly dated)
matlab docs are here:

3) Can we remove the requirement for even NFFT (blocksize)?

Sure

A while back someone on the list said that the amplitude scaling for
psd was of, but I never delved into it. Something you may want to
check into while you are poking around in there.

http://www.nabble.com/forum/Search.jtp?forum=2906&local=y&query=psd+amplitude

JDH

···

On Wed, Nov 5, 2008 at 4:55 PM, Ryan May <rmay31@...149...> wrote: