[Mne_analysis] n_fft option for tfr_array_stockwell

Paul Fishback fishbacp at mail.gvsu.edu
Sat Dec 19 15:39:36 EST 2020
Search archives:

        External Email - Use Caution        


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?


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.3120 (fax)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201219/dc4588fb/attachment.html 

More information about the Mne_analysis mailing list