[SciPy-Dev] SciPy-Dev Digest, Vol 157, Issue 15

David Nicholson nicholdav at gmail.com
Tue Nov 22 10:42:38 EST 2016


Hi Eric,
I think I can do that over the holiday.
--David

On Tue, Nov 22, 2016 at 7:00 AM, <scipy-dev-request at scipy.org> wrote:

> Send SciPy-Dev mailing list submissions to
>         scipy-dev at scipy.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.scipy.org/mailman/listinfo/scipy-dev
> or, via email, send a message with subject or body 'help' to
>         scipy-dev-request at scipy.org
>
> You can reach the person managing the list at
>         scipy-dev-owner at scipy.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of SciPy-Dev digest..."
>
>
> Today's Topics:
>
>    1. Re: signal.spectrogram doesn't change nperseg to length of
>       window? (Eric Larson)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 21 Nov 2016 16:15:19 -0500
> From: Eric Larson <larson.eric.d at gmail.com>
> To: SciPy Developers List <scipy-dev at scipy.org>
> Subject: Re: [SciPy-Dev] signal.spectrogram doesn't change nperseg to
>         length of window?
> Message-ID:
>         <CAGu2niVW-MWH4h9Hk+tP7dssDv9YJ6JhJrQOvei8NrRxHQoK
> HQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> It looks like you are reading the docs correctly. From looking at the code,
> I can confirm that it doesn't change `nperseg` based on what is passed for
> `window`. So it looks like a bug to me.
>
> Do you have time to look into making a Pull Request to fix it?
>
> Eric
>
>
> On Sat, Nov 19, 2016 at 10:41 PM, David Nicholson <nicholdav at gmail.com>
> wrote:
>
> > Hi scipy-dev list,
> >
> > I'm using spectrogram from scipy.signal with a custom window. My
> > understanding from the docs is that when I provide an array_like for the
> > window, the value for nperseg will change from the default of 256 to
> > whatever the length is of the window I provide.
> >
> > But instead I get an error saying  'noverlap must be less than nperseg'
> and
> > when I check with pdb I can see that nperseg is still the default value.
> > I'm using a value for noverlap that's larger than the default nperseg,
> but
> > less than the length of the window. I don't get the error if I call the
> > function with 'nperseg=window.shape[0]'.
> >
> >  I skimmed the source and don't see anything in the _spect_helper
> function
> > that would change nperseg to the length of window.
> >
> > Am I misunderstanding the docs, or am I calling the function wrong, or is
> > this a bug?
> >
> > Here's my code:
> > from scipy.io import wavfile
> > from scipy.signal import slepian # i.e. 'DPSS' window used for FFT
> > from scipy.signal import spectrogram
> >
> > FFT_SIZE = 512
> > FFT_OVERLAP = FFT_SIZE - 32
> > win_dpss = slepian(FFT_SIZE, 4/FFT_SIZE) #shape =
> >
> > [rate,data] = wavfile.read('a_file_you_have.wav')
> > f,t,spec = spectrogram(data, rate, window=win_dpss, noverlap=FFT_OVERLAP)
> >
> > Thanks for your help
> > --David
> >
> > --
> > David Nicholson, Ph.D. Candidate
> > Sober Lab <http://www.biology.emory.edu/research/Sober/Home.html>, Emory
> > Neuroscience Program. <http://www.emory.edu/NEUROSCIENCE/>
> > www.nicholdav.info; <http://www.nicholdav.info>
> > https://github.com/NickleDave
> >
> > _______________________________________________
> > SciPy-Dev mailing list
> > SciPy-Dev at scipy.org
> > https://mail.scipy.org/mailman/listinfo/scipy-dev
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://mail.scipy.org/pipermail/scipy-dev/
> attachments/20161121/d77e09a5/attachment-0001.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
> ------------------------------
>
> End of SciPy-Dev Digest, Vol 157, Issue 15
> ******************************************
>



-- 
David Nicholson, Ph.D. Candidate
Sober Lab <http://www.biology.emory.edu/research/Sober/Home.html>, Emory
Neuroscience Program. <http://www.emory.edu/NEUROSCIENCE/>
www.nicholdav.info; <http://www.nicholdav.info>https://github.com/NickleDave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20161122/758aa2a0/attachment.html>


More information about the SciPy-Dev mailing list