[Mne_analysis] Compute source power spectral density (PSD) in a label
Vivek Sharma
vivek.sharma1510 at gmail.com
Thu Dec 26 05:10:36 EST 2019
External Email - Use Caution
Hi,
Also I want to discuss if the following code is right.
If during the compute of psd the option dB is set as false then how it can
be plotted in db.
stc = compute_source_psd(raw, inverse_operator, lambda2=1. / 9.,
method="dSPM",
tmin=tmin, tmax=tmax, fmin=fmin, fmax=fmax,
pick_ori="normal", n_fft=n_fft, label=label,
dB=False)
To plot power in db I did the following change in code:
plt.plot(stc.times, 10*np.log10(stc.data.T))
On Thu, Dec 26, 2019 at 1:59 PM Alexandre Gramfort <
alexandre.gramfort at inria.fr> wrote:
> External Email - Use Caution
>
> hi,
>
> you're right. This line:
>
> plt.plot(1e3 * stc.times, stc.data.T)
>
> is wrong. It should just be:
>
> plt.plot(stc.times, stc.data.T)
>
> I just fixed it:
>
> https://github.com/mne-tools/mne-python/commit/4d92429c729fbc34ea7b5ca5e3b79845dcb9cc88
>
> thanks
> Alex
>
> On Wed, Dec 25, 2019 at 9:46 PM Vivek Sharma <vivek.sharma1510 at gmail.com>
> wrote:
> >
> > External Email - Use Caution
> >
> > Hi,
> > In the following example
> > (
> https://mne.tools/stable/auto_examples/time_frequency/plot_source_power_spectrum.html
> )
> > why are we multiplying stc.times and stc.data.T by 1e3?
> >
> > Secondly, I would like to bring it to notice that in the same example
> the plot that is being obtained shows frequency as 10000, 20000, etc. and
> the unit is represented as Hz which I believe is wrong as it should be
> millihertz.
> > I try to keep the frequency in Hz by making the following change in the
> code.
> > plt.plot(stc.times, (1e3 * stc.data.T))
> > is the change valid?
> >
> > --
> > Vivek Sharma
> > _______________________________________________
> > Mne_analysis mailing list
> > Mne_analysis at nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
--
Vivek Sharma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191226/b2ea4479/attachment-0001.html
More information about the Mne_analysis
mailing list