[Mne_analysis] help

czx chenzx_cqu at 163.com
Tue Dec 22 00:35:05 EST 2020
Search archives:

        External Email - Use Caution        


> On Dec 21, 2020, at 10:45 PM, mne_analysis-request at nmr.mgh.harvard.edu wrote:
> 
> Send Mne_analysis mailing list submissions to
>   mne_analysis at nmr.mgh.harvard.edu
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://secure-web.cisco.com/1Q3LaUGwMMWztB-8lwGXWeXLWWI_oDQieyTCRxppdAzat2MwvKQAiQFLXYVoc1Y1QQ9xc1nMmnxJfL-exXVh0IFFl_bCs2oDvFdzXQyEfYXnMRlijSS-Wec1085qiehWGbuQOCz2qPV_SDzfemt0ztiJ3Iljt_OxjUk-5n7AvufW-VvmWH1Q39cwHMy7PHkzYJP1rjAPi0IYU7nwwDCdPz1CAMBTqHN-OBooy0JxTk4b2bh5QW97N9OrLtpYqGd0nICPRnKTUtLfOivZ2nBsyHA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis
> or, via email, send a message with subject or body 'help' to
>   mne_analysis-request at nmr.mgh.harvard.edu
> 
> You can reach the person managing the list at
>   mne_analysis-owner at nmr.mgh.harvard.edu
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Mne_analysis digest..."
> 
> 
> Today's Topics:
> 
>  1. Re: n_fft option for tfr_array_stockwell {Disarmed}
>     (Alexandre Gramfort)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 21 Dec 2020 15:42:03 +0100
> From: Alexandre Gramfort <alexandre.gramfort at inria.fr>
> Subject: Re: [Mne_analysis] n_fft option for tfr_array_stockwell
>   {Disarmed}
> To: Discussion and support forum for the users of MNE Software
>   <mne_analysis at nmr.mgh.harvard.edu>
> Message-ID:
>   <CADeotZrJBEVQY97NvJzK3GX=0zkiDv3tK6r3FOsW0MLePp9Y+w at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
>       External Email - Use Caution        
> 
> hi,
> 
> here are the lines that generate this behavior.
> 
> https://secure-web.cisco.com/19bmNMoYnXLOkU_iFnakp_XeteNEgsBBxfAGwS0rF2CpZNdLrEeQ2Q7gkaBm6CPlzSZf0ojCFXZ9hmC1DsZAEgb0US11kbgMbsLoCOjXYEOf-NN97XCe29r1vUCh20gEOZLm2BIVUjGq3PJnp4npGEOWbrB5lG3fytl7LKURPdRZnu695xfBaNgSLPXjQqDRJ6MW6-NU8lSF9eSsZErLm6Xs_wM9LU9iGRhhtFMZfRgwj_W4Z4Ug6Ds8xnaQsostgCuEzh10kChT37jmHmXJKlQ/https%3A%2F%2Fgithub.com%2Fmne-tools%2Fmne-python%2Fblob%2Fmaster%2Fmne%2Ftime_frequency%2F_stockwell.py%23L26
> 
> I read that "n_fft cannot be smaller than signal size".
> 
> maybe simply the doc needs to be updated?
> 
> HTH
> Alex
> 
> 
>> On Sun, Dec 20, 2020 at 6:32 PM Paul Fishback <fishbacp at mail.gvsu.edu>
>> wrote:
>>       External Email - Use Caution
>> Alex,
>> I'm so sorry I left that out. Here's a snippet that includes that info as
>> well as plots the results. I set n_fft=500, but still received the warning,
>> RuntimeWarning: The input signal is shorter (5001) than "n_fft" (8192).
>> Applying zero padding..
>> import numpy as np
>> from scipy.signal import chirp
>> import matplotlib.pyplot as plt
>> from mne.time_frequency import tfr_array_stockwell
>> Nt=5000
>> time_length=10
>> t = np.linspace(0, time_length, Nt+1)
>> w = chirp(t, f0=12.5, f1=2.5, t1=10, method='linear')
>> y = np.expand_dims(w, axis=[0,1])
>> fmin = 0  # Hz
>> fmax = 25  # Hz
>> Fs = int(np.ceil(Nt/time_length))
>> st_power, itc,
>> freqs=tfr_array_stockwell(y,sfreq=Fs,fmin=fmin,fmax=fmax,n_fft=500)
>> extent = (t[0], t[-1], fmin, fmax)
>> fig, ax = plt.subplots(2, 1, sharex=True)
>> ax[0].plot(t, w)
>> ax[0].set(ylabel='amplitude')
>> ax[1].imshow(np.abs(st_power[0,:,:]), origin='lower', extent=extent)
>> ax[1].axis('tight')
>> ax[1].set(xlabel='time (s)', ylabel='frequency (Hz)')
>> plt.show()
>> On Sun, Dec 20, 2020 at 12:06 PM Alexandre Gramfort <
>> alexandre.gramfort at inria.fr> wrote:
>>>       External Email - Use Caution
>>> hi Paul,
>>> can you share a full code snippet?
>>> Nt  and time_length not defined
>>> Alex
>>> On Sat, Dec 19, 2020 at 9:42 PM Paul Fishback <fishbacp at mail.gvsu.edu>
>>> wrote:
>>>>       External Email - Use Caution
>>>> Hello,
>>>> I'm interested in computing the Stockwell Transform of a simple
>>>> univariate time series. Because I already use MNE, I thought I'd
>>>> perform this task with the aid of the
>>>> tfr_array_stockwell command. However, I'm having a problem changing the
>>>> window length, n_fft.
>>>> As a simple "toy example," here's a chirp signal, where the frequency
>>>> decreases linearly from 12.5 to 2.5 Hz over a 10 second period:
>>>> from scipy.signal import chirp
>>>> from mne.time_frequency import tfr_array_stockwell
>>>> t = np.linspace(0, 10, 5001)
>>>> w = chirp(t, f0=12.5, f1=2.5, t1=10, method='linear')
>>>> y = np.expand_dims(w, axis=[0,1])  # Add dimensions to signal in order
>>>> to make a valid input for tfr_array_stockwell
>>>> fmin = 0
>>>> fmax = 25
>>>> Fs = int(np.ceil(Nt/time_length))
>>>> st_power, itc, freqs=tfr_array_stockwell(y,sfreq=Fs,fmin=fmin,fmax=fmax)
>>>> This works fine and the plotted results look great, but I do receive a
>>>> warning message indicating zero padding is being used. This is because the
>>>> signal length (5001)
>>>> is less than the default n_fft, which is 8192 in my case.   (Since
>>>> 2^(12)=4096 < 5001 < 2^(13)=8192 )
>>>> However, if I change the default n_fft to something else, e.g. insert
>>>> n_fft=500 above, I still receive the same warning message.
>>>> Perhaps I'm missing something simple?
>>>> Thanks
>>>> Paul Fishback
>>>> --
>>>> Professor of Mathematics, Grand Valley State University
>>>> Past-President, Pi Mu Epsilon National Honorary Mathematics Society, Inc.
>>>> Department of Mathematics (MAK C-2-408)
>>>> Grand Valley State University
>>>> 1 Campus Dr.
>>>> Allendale, MI 49401
>>>> fishbacp at mail.gvsu.edu
>>>> 616.331.2040
>>>> 616.331.3120 (fax)
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> *MailScanner has detected a possible fraud attempt from
>>>> "secure-web.cisco.com" claiming to be*
>>>> https://secure-web.cisco.com/1V2HoZGdNLp0IFtAYTXTEdVFL6qTpGgJRm2OCrOWu-BPKeW0GOZYTT50BA5CqqaLL4F7Cia6pZ1bgXjpEBbPf4tQcDUwPRFmQ4SO76LkQweDD5ZEX6rWY--QfBPCCK2oKkxrMznXqgSplhMudB93vKc_c1flqMbs5HYUoQlnqldVFc9weJ4urtRK4Jv-1lKttxMvCWdmSfTdYS5kYG3y7QI_RsxsiBBzL28XDuNDaMaRP8qaIuEpabwfeoA7Qspj65b9UzXKBiPlHdjeSGHbgWA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis
>>>> <https://secure-web.cisco.com/1M4CbzTtCaJem1lx1U0buS9f1c2izKtbTjVFnrbjB0yPGi90XuU1Z5zbH7fAswJDcFljz4nDFhhWdKbqEcuR5SoCem1UyfXaKE-shx-JV4-lWrS1HL6eh8opMdufAMu0eO3z895xxr9vmgvNQClV-Rsi0DHYSf5fpW22GZbfJLPXPzfJjpHZB0JXycCZwjO4lHoIoqa-TwctE2IbhjzWXmpQZpxM2Yq3Ur1j_cifW1UHMNXxoIbVqgFtXv07-6Nd2_shMG3tHtbjFhbzfyYuLxA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> *MailScanner has detected a possible fraud attempt from
>>> "secure-web.cisco.com" claiming to be*
>>> https://secure-web.cisco.com/1V2HoZGdNLp0IFtAYTXTEdVFL6qTpGgJRm2OCrOWu-BPKeW0GOZYTT50BA5CqqaLL4F7Cia6pZ1bgXjpEBbPf4tQcDUwPRFmQ4SO76LkQweDD5ZEX6rWY--QfBPCCK2oKkxrMznXqgSplhMudB93vKc_c1flqMbs5HYUoQlnqldVFc9weJ4urtRK4Jv-1lKttxMvCWdmSfTdYS5kYG3y7QI_RsxsiBBzL28XDuNDaMaRP8qaIuEpabwfeoA7Qspj65b9UzXKBiPlHdjeSGHbgWA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis
>>> <https://secure-web.cisco.com/1ctCQ2zsYnftewzKaPfkHy8euSz0Z_C9qeWYG9Vwvew04AcXo9LLpUkkieMGqt1MCu4FTZbv3dDBHdWMVCUYTWPRazAgJVP7pTD1ohCnZATpUNE83BYx3f3sX5WnGVrIDidqjndItRhUBtzXxKVVqghi8ZBZv2VbeKb3z5tCxIOCXBxM2qI_dyxZm9CP08QmgRXVcLePiwX8MPWmFP_bb024AGt5RxjY9LRXWVmEec350uCGrnjOr4MfyAHK5n0O3LC9isssbFfny5JO6oFwchA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis>
>> --
>> Professor of Mathematics, Grand Valley State University
>> Past-President, Pi Mu Epsilon National Honorary Mathematics Society, Inc.
>> Department of Mathematics (MAK C-2-408)
>> Grand Valley State University
>> 1 Campus Dr.
>> Allendale, MI 49401
>> fishbacp at mail.gvsu.edu
>> 616.331.2040
>> 616.331.3120 (fax)
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://secure-web.cisco.com/1V2HoZGdNLp0IFtAYTXTEdVFL6qTpGgJRm2OCrOWu-BPKeW0GOZYTT50BA5CqqaLL4F7Cia6pZ1bgXjpEBbPf4tQcDUwPRFmQ4SO76LkQweDD5ZEX6rWY--QfBPCCK2oKkxrMznXqgSplhMudB93vKc_c1flqMbs5HYUoQlnqldVFc9weJ4urtRK4Jv-1lKttxMvCWdmSfTdYS5kYG3y7QI_RsxsiBBzL28XDuNDaMaRP8qaIuEpabwfeoA7Qspj65b9UzXKBiPlHdjeSGHbgWA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://secure-web.cisco.com/1e1mrMjHdrKkAye1PtWEzYtt8aR2Zzai939Yh4naGf1M3iH_ymqG1fGoYRtvGtRfUQvF0P_XCcTmolfQQlNi2NmY83kGjKSitZGy7X0zMPOkD96f3Dfn2f3M1U50uOUcCO2oHDDeTgSTsCN_6pCeqaazJ1BNVsYY707C5AjZ4yQ__yCik6oXu52WnSTuQQjos2E20F9TWuoCiN-nwH9KgRwoDRHHvHqnK-6s8qkX-g2IlMFlcPt-xm-zp4zj4k5K9USUnh9-mkZENT4g1lZaVHw/http%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fpipermail%2Fmne_analysis%2Fattachments%2F20201221%2Fd7abf8cf%2Fattachment.html 
> 
> ------------------------------
> 
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1Q3LaUGwMMWztB-8lwGXWeXLWWI_oDQieyTCRxppdAzat2MwvKQAiQFLXYVoc1Y1QQ9xc1nMmnxJfL-exXVh0IFFl_bCs2oDvFdzXQyEfYXnMRlijSS-Wec1085qiehWGbuQOCz2qPV_SDzfemt0ztiJ3Iljt_OxjUk-5n7AvufW-VvmWH1Q39cwHMy7PHkzYJP1rjAPi0IYU7nwwDCdPz1CAMBTqHN-OBooy0JxTk4b2bh5QW97N9OrLtpYqGd0nICPRnKTUtLfOivZ2nBsyHA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis
> 
> End of Mne_analysis Digest, Vol 155, Issue 34
> *********************************************





More information about the Mne_analysis mailing list