[Mne_analysis] sampling rate and time frequency analysis

Veda Hung vedahung1116 at gmail.com
Thu Nov 29 02:17:02 EST 2018
Search archives:

        External Email - Use Caution        

Hi Clemens,
Thanks for your reply.
To your question, I tried to change the decim as 1, the output is still not
correct.

Here are the codes:

raw = mne.io.kit.read_raw_kit(file, stim=[200], preload=True)

raw.resample(500)

raw.filter(0.5, None)

events_all = numpy.loadtxt(f3)

tmin, tmax = -2, 12

baseline = (None, 0)

epoch2 = mne.Epochs(raw, events_sel,event_id , tmin, tmax, picks=picks,
baseline=baseline, reject=dict(mag=1.5e-11), preload=True)

ica.apply(epoch2, exclude=rlist.tolist())

n_cycles = 6

freqs = np.arange(4., 100., 1.)

power= tfr_morlet(epoch2, freqs=freqs, n_cycles=n_cycles, use_fft=True,
decim=3,n_jobs=1,average=False,return_itc=False)


Veda





On Sat, Nov 24, 2018 at 6:34 PM Brunner, Clemens (
clemens.brunner at uni-graz.at) <clemens.brunner at uni-graz.at> wrote:

>         External Email - Use Caution
>
> Hi!
>
>
>
> Can you share the full code that starts with the raw data (or a minimal
> working example)? Note that you also set decim=3 in tfr_morlet, which
> should also influence the length of the result.
>
>
>
> Clemens
>
>
>
>
>
> *From:* mne_analysis-bounces at nmr.mgh.harvard.edu <
> mne_analysis-bounces at nmr.mgh.harvard.edu> *On Behalf Of *Veda Hung
> *Sent:* Wednesday, 21 November 2018 09:55
> *To:* Discussion and support forum for the users of MNE Software <
> mne_analysis at nmr.mgh.harvard.edu>
> *Subject:* [Mne_analysis] sampling rate and time frequency analysis
>
>
>
> *        External Email - Use Caution        *
>
> Hi MNE experts,
>
>
>
> I conducted time frequency analysis on resampled MEG data (from 1000Hz to
> 500 Hz) with the following parameters. the length of epoch is between -2s
> to 12s.
>
> n_cycles = 6
>
> freqs = np.arange(4., 100., 1.)
>
> power= tfr_morlet(epoch, freqs=freqs, n_cycles=n_cycles, use_fft=True,
> decim=3,n_jobs=1,average=False,return_itc=False)
>
>
>
> The length of the resulting power is  2334. However, I expect that the
> length should be 14*500/6, which is 1667, where 14 is the total length of
> epoch, 500 is sampling rate and 6 is the number of cycle. It seems that the
> sampling rate is still 1000, rather than the new sampling rate (500). I am
> pretty sure that I resampled the data before time frequency analysis.
> Anyone has a clue why the length of the power from tfr_morlet does not
> respect the length of the epoch. Thanks.
>
>
>
> Best,
>
> Veda
>
>
>
>
>
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20181129/3c73f79c/attachment.html 


More information about the Mne_analysis mailing list