On 10/2/07, Lars Friedrich <lfr...@im...> wrote:
> Hello all,
>
> I am using matplotlib.mlab.psd to find power spectra of measured data.
> Sometimes it happens that I use the automatic zero padding (if the
> length of my measured data is smaller than nFFT) and detrending
> (pylab.detrend_mean) at the same time.
>
> I think that the psd-algorithm does the zero padding *first* and *then*
> uses the detrend function.
>
> For my application this is not good because it introduces low-frequency
> signals that I can see in the spectrum. So the detrending does not work
> as good as it does when there is no zero padding.
>
> What is the reason for this order of applying zero padding and
> detrending? Wouldn't it make sense to change it?
I wrote this function many years ago and do not remember why I choose
the order pad then detrend, but what you propose makes sense, so let's
let this percolate for a bit and if noone objects I will change it
(and related functions).
JDH
|