<div dir="ltr">raw.filter() operates inplace (and doesn&#39;t return anything, which is why you get None as a result), so your raw object is now filtered.<div><br></div><div>You can use raw_2 = raw.copy(), raw_2.filter(...) if you don&#39;t want to modify your original raw instance.<br><div><br></div><div>Eric</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 23, 2016 at 1:31 PM, Megan Schendel <span dir="ltr">&lt;<a href="mailto:mschendel@mrn.org" target="_blank">mschendel@mrn.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div>     I&#39;ve also been trying to figure out filtering, and getting a bit stuck on what to do with the result of such.  If I follow along above and then do something like:</div><div><br></div><div>filtered_data = <span style="font-size:12.8px">raw.notch_filter(freqs=</span><span style="font-size:12.8px">harmonics[:-1]+noise_freq//2, notch_widths=noise_freq - 2*width)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I can&#39;t treat the result like a raw RawFIF, and if I ask python</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">type(filtered_data)</span></div><div><span style="font-size:12.8px">NoneType</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">So how does one use (say, plot) such a result?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks! </span></div><div><span style="font-size:12.8px">Megan</span></div><span style="font-size:12.8px"><font color="#888888"><div><span style="font-size:12.8px"><font color="#888888"><br></font></span></div><br></font></span><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div>MEG Technician<br>The Mind Research Network<br>1101 Yale Blvd. NE<br>Albuquerque, New Mexico 87106<br><a href="tel:505-272-3304" value="+15052723304" target="_blank">505-272-3304</a><br><br></div></div><div><div class="h5">
<br><div class="gmail_quote">On Wed, Mar 23, 2016 at 10:10 AM, JR KING <span dir="ltr">&lt;<a href="mailto:jeanremi.king@gmail.com" target="_blank">jeanremi.king@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks!<br><br>For the record I did:<br><br>noise_freq = 60.  # US line noise<br></div><div>width = 2. # notch widh in Hz<br></div><div><br># harmonics until nquist<br>n_harm = <a href="http://raw.info" target="_blank">raw.info</a>[&#39;sfreq&#39;] // (2. * noise_freq) + 1  <br><br># band pass first to last harmonics<br>harmonics = noise_freq * np.arange(1, n_harm)<br>raw.filter(noise_freq - width, harmonics[-1] + width)<br><br></div><div># band stop filter in between harmonics (it&#39;s not really a notch, since the freq width is very large)<br></div><div>raw.notch_filter(freqs=harmonics[:-1]+noise_freq//2, notch_widths=noise_freq - 2*width)<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">JR<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 23 March 2016 at 10:13, dgw <span dir="ltr">&lt;<a href="mailto:dgwakeman@gmail.com" target="_blank">dgwakeman@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi JR,<br>
<br>
what about:<br>
bandpass: 55: 245, plus notch filters for the other gaps<br>
<br>
d<br>
<div><div><br>
On Wed, Mar 23, 2016 at 10:11 AM, JR KING &lt;<a href="mailto:jeanremi.king@gmail.com" target="_blank">jeanremi.king@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; Is there a way in MNE to do the opposite of notch-filtering so as to filter<br>
&gt; out everything but the line noise and its harmonics?<br>
&gt;<br>
&gt; I&#39;m typically trying to filter the signals so as to only keep the 60, 120,<br>
&gt; 180, 240 Hz frequency bands.<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; JR<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
&gt;<br>
&gt;<br>
&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt; e-mail<br>
&gt; contains patient information, please contact the Partners Compliance<br>
&gt; HelpLine at<br>
&gt; <a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in<br>
&gt; error<br>
&gt; but does not contain patient information, please contact the sender and<br>
&gt; properly<br>
&gt; dispose of the e-mail.<br>
&gt;<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>