<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div dir="ltr">Hello everyone!<div><br></div><div><div>I carried out an EEG/MEG study and I am also interested in HEART RATE VARIABILITY analysis. I would like to use my ECG signal (recorded with the channel BIO003 at the same time of EEG/MEG records ) not only to detect the ecg artifacts on my EEG/MEG sinalgs, but also to analyse the heart rate variability. </div><div>I found this script : </div><div><br></div><div></div><div><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;border-spacing:0px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-LC21" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;overflow:visible;white-space:pre"><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">def</span> <span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193)">qrs_detector</span>(<span class="gmail-pl-smi" style="box-sizing:border-box">sfreq</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">ecg</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">thresh_value</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">0.6</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">levels</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">2.5</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">n_thresh</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">3</span>,</td></tr><tr style="box-sizing:border-box"><td id="gmail-L22" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;color:rgba(27,31,35,0.3);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;line-height:20px;min-width:50px;text-align:right;vertical-align:top;white-space:nowrap;width:50px"></td><td id="gmail-LC22" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;overflow:visible;white-space:pre">                 <span class="gmail-pl-smi" style="box-sizing:border-box">l_freq</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">5</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">h_freq</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">35</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">tstart</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">0</span>, <span class="gmail-pl-smi" style="box-sizing:border-box">filter_length</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73)">=</span><span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98)"><span class="gmail-pl-pds" style="box-sizing:border-box">&#39;</span>10s<span class="gmail-pl-pds" style="box-sizing:border-box">&#39;</span></span>)

</td></tr></tbody></table></div><div><a href="https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ecg.py" target="_blank">https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ecg.py</a> </div><div><br></div><div>I&#39;ve just started to use mne-python. So my question are: </div><div>- is &quot;<span class="gmail-m_7002510439834887502gmail-pl-k" style="font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;box-sizing:border-box;color:rgb(215,58,73)">def</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap"> </span><span class="gmail-m_7002510439834887502gmail-pl-en" style="font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;box-sizing:border-box;color:rgb(111,66,193)">qrs_detector</span>&quot;  the good script to know the R-R inteval in seconds ? Because with the RR inteval I could be able to compute the heart rate (HR=60 seconds / RR) </div><div>- What is the difference between &quot;<span style="color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap">Detect QRS component in ECG channels</span> &quot; and &quot;<span style="color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap">Indices of ECG peaks</span> &quot; ? </div><div><span style="color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap"><br></span></div><div><div>Thank you !!</div><div><br></div><div>Jasmina</div></div></div></div>