[Mne_analysis] How to filter harmonics?

JR KING jeanremi.king at gmail.com
Wed Mar 23 12:10:17 EDT 2016
Search archives:

Thanks!

For the record I did:

noise_freq = 60.  # US line noise
width = 2. # notch widh in Hz

# harmonics until nquist
n_harm = raw.info['sfreq'] // (2. * noise_freq) + 1

# band pass first to last harmonics
harmonics = noise_freq * np.arange(1, n_harm)
raw.filter(noise_freq - width, harmonics[-1] + width)

# band stop filter in between harmonics (it's not really a notch, since the
freq width is very large)
raw.notch_filter(freqs=harmonics[:-1]+noise_freq//2,
notch_widths=noise_freq - 2*width)

JR

On 23 March 2016 at 10:13, dgw <dgwakeman at gmail.com> wrote:

> Hi JR,
>
> what about:
> bandpass: 55: 245, plus notch filters for the other gaps
>
> d
>
> On Wed, Mar 23, 2016 at 10:11 AM, JR KING <jeanremi.king at gmail.com> wrote:
> > Hi all,
> >
> > Is there a way in MNE to do the opposite of notch-filtering so as to
> filter
> > out everything but the line noise and its harmonics?
> >
> > I'm typically trying to filter the signals so as to only keep the 60,
> 120,
> > 180, 240 Hz frequency bands.
> >
> > Thanks!
> >
> > JR
> >
> >
> >
> > _______________________________________________
> > Mne_analysis mailing list
> > Mne_analysis at nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> >
> >
> > The information in this e-mail is intended only for the person to whom
> it is
> > addressed. If you believe this e-mail was sent to you in error and the
> > e-mail
> > contains patient information, please contact the Partners Compliance
> > HelpLine at
> > http://www.partners.org/complianceline . If the e-mail was sent to you
> in
> > error
> > but does not contain patient information, please contact the sender and
> > properly
> > dispose of the e-mail.
> >
> _______________________________________________
> 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/20160323/757eb44a/attachment.html 


More information about the Mne_analysis mailing list