<div dir="ltr"><div><div>Hi Ian,<br><br></div>If you want to approximate a chebyshev filter with butterworth, you obviously need a higher order than the actual chebyshev uses. Some simple calculations are involved on your data  which basically suggests even to get a 3dB of stopband attenuation for the delta range, you would be needing an order of 3 for a chebyshev-1 type filter. Similarly you will be needing a 4th order butterworth filter.<br>
<br></div>By default, even the filedtrip uses 4th order for butterworth filter. So I would suggest you to use a 4th order butterworth filter to approximate the chebyshev filter you mentioned here.<br></div><div class="gmail_extra">
<br clear="all"><div><div dir="ltr"><font face="arial, sans-serif"><div><b><div style="color:rgb(0,0,153)"><font color="#000099">===============================================</font></div></b><br><b><img alt="Inline image 1" src="cid:ii_13f6c73ea79c7353"><br>
<br></b></div></font><font face="arial, sans-serif"><div><b>Best Regards</b></div></font><font face="arial, sans-serif"><div><b>Chaitanya Srinivas Lanka <br><br><span style="color:rgb(153,153,153)">Wiss. Mitarbeiter                                       </span></b><span style="color:rgb(153,153,153)"><b><font face="arial, sans-serif">PhD Student</font><font face="arial, sans-serif"><b><br>
</b></font><span><font><span>Functional and Restorative Neurosurgery </span></font></span><span><font><span><font face="arial, sans-serif">Neural Information Processing</font></span></font></span><span><font><span><br>Neurosurgical University Hospital</span></font></span></b><b><span><font><font face="arial, sans-serif"><b>             </b></font></font></span><span><font><font face="arial, sans-serif">Graduate Training Center for Neuroscience</font></font></span><span><font>  <br>
<span>Eberhard Karls University                          </span></font></span><span><font><font face="arial, sans-serif">Eberhard Karls University</font></font></span><span><font><font face="arial, sans-serif"><b> </b></font><span><br>
</span></font></span></b></span><font face="arial, sans-serif"><span style="color:rgb(153,153,153)"><b><span><font><span>Otfried-Mueller-Str.45</span>                                </font></span>Österbergstr. 3</b></span><b><span style="color:rgb(153,153,153)"><font><span>  <br>
D-72076 Tuebingen</span></font></span>                                    </b><font face="arial, sans-serif"><b><span style="color:rgb(153,153,153)"><font><span>D-72074 Tuebingen</span></font></span></b></font></font><b><br>
</b></div><div><b><font color="#006600">Mobile Phone Number : </font><a value="+4917679038395">+49-176-79035731<br></a></b><a value="+4917679038395"><font face="arial, sans-serif"><b><font color="#000099">===============================================</font></b></font><br>
</a></div>
</font></div></div>
<br><br><div class="gmail_quote">On Tue, Feb 25, 2014 at 11:25 AM, Ian M. Andolina <span dir="ltr"><<a href="mailto:i.andolina@ucl.ac.uk" target="_blank">i.andolina@ucl.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>
      <p style="margin:1.2em 0px!important">Hi, I wanted to use
        Fieldtrip to recreate the methodology used in a paper by <a href="http://dx.doi.org/10.1093/cercor/13.4.422" target="_blank">Leopold et
          al., 2003</a> — the relevant methods section is the following:</p>
      <p style="margin:1.2em 0px!important"><em>“The LFP signals
          were resampled to 1 kHz, and then band-pass filtered into
          seven frequency ranges using a second order, bi-directional,
          zero-phase Chebyshev type-1 filter. The frequency ranges, as
          well as their rough mapping onto classically defined
          electroencephalographic conventions, were the following: δ
          (1–4 Hz), θ (5–8 Hz), α (9–14 Hz), β (15–30 Hz), γL (30–50
          Hz), γH (50–100 Hz), and γVH (100–150 Hz). The resulting
          band-limited signals were full-wave rectified by taking their
          absolute value. They were then resampled to 20 Hz after
          low-pass filtering with an eighth order Chebyshev type-1
          filter (cutoff = 8 Hz).”</em></p>
      <p style="margin:1.2em 0px!important">My LFP data is sampled
        at 1kHz, and I manually pad with data either side of the event
        triggered region of interest. Fieldtrip doesn’t have a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">chebyshev
          type-1</code> filter, but would a second order two-pass (aka
        zero phase?) butterworth be good enough considering the
        frequency bands used? I’m using the following cfg passed to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">ft_preprocessing</code>
        for the initial bandpass filtering and rectification:</p>
      <pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px 3px 3px 3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background:none repeat scroll 0% 0% rgb(248,248,255)">freq = <span>{[<span style="color:rgb(0,153,153)">1</span> <span style="color:rgb(0,153,153)">4</span>], [<span style="color:rgb(0,153,153)">5</span> <span style="color:rgb(0,153,153)">8</span>], [<span style="color:rgb(0,153,153)">9</span> <span style="color:rgb(0,153,153)">14</span>], [<span style="color:rgb(0,153,153)">15</span> <span style="color:rgb(0,153,153)">30</span>], [<span style="color:rgb(0,153,153)">30</span> <span style="color:rgb(0,153,153)">50</span>], [<span style="color:rgb(0,153,153)">50</span> <span style="color:rgb(0,153,153)">100</span>], [<span style="color:rgb(0,153,153)">100</span> <span style="color:rgb(0,153,153)">150</span>]}</span>;
<span style="color:rgb(51,51,51);font-weight:bold">for</span> <span style="color:rgb(0,134,179)">j</span> = <span style="color:rgb(0,153,153)">1</span>:<span style="color:rgb(0,134,179)">length</span>(freq)
 cfg                        = <span>[]</span>;
 <span>cfg.</span>padding                = <span style="color:rgb(0,153,153)">0</span>;
 <span>cfg.</span>bpfilter            = <span style="color:rgb(221,17,68)">'yes'</span>;
 <span>cfg.</span>bpfilttype            = <span style="color:rgb(221,17,68)">'but'</span>;
 <span>cfg.</span>bpfreq                = freq<span>{j}</span>;
 <span>cfg.</span>bpfiltdir            = <span style="color:rgb(221,17,68)">'twopass'</span>;
 <span>cfg.</span>bpfiltord            = <span style="color:rgb(0,153,153)">2</span>;
 <span>cfg.</span>bpinstabilityfix    = <span style="color:rgb(221,17,68)">'reduce'</span>;
 <span>cfg.</span>rectify                = <span style="color:rgb(221,17,68)">'yes'</span>;
 bp<span>{j}</span> = ft_preprocessing(cfg,ft);
<span style="color:rgb(51,51,51);font-weight:bold">end</span>
</code></pre>
      <p style="margin:1.2em 0px!important">As far as I can see in <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">ft_preprocessing</code>
        rectification occurs after filtering, so this is as specified by
        Leopold <em>et al.,</em></p>
      <p style="margin:1.2em 0px!important">Then for
        downsampling/resampling:</p>
      <pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px 3px 3px 3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background:none repeat scroll 0% 0% rgb(248,248,255)">cfg                        = <span>[]</span>;
<span>cfg.</span>padding                = <span style="color:rgb(0,153,153)">0</span>;
<span>cfg.</span>lpfilter            = <span style="color:rgb(221,17,68)">'yes'</span>;
<span>cfg.</span>lpfreq                = <span style="color:rgb(0,153,153)">8</span>;
<span>cfg.</span>lpfilttype            = <span style="color:rgb(221,17,68)">'but'</span>;
<span>cfg.</span>lpfiltdir            = <span style="color:rgb(221,17,68)">'twopass'</span>;
<span>cfg.</span>lpfiltord            = <span style="color:rgb(0,153,153)">8</span>;
<span>cfg.</span>lpinstabilityfix    = <span style="color:rgb(221,17,68)">'reduce'</span>;
bp<span>{j}</span> = ft_preprocessing(cfg,bp<span>{j}</span>);
cfg                        = <span>[]</span>;
<span>cfg.</span>resample            = <span style="color:rgb(221,17,68)">'yes'</span>;
<span>cfg.</span>resamplefs            = <span style="color:rgb(0,153,153)">20</span>;
<span>cfg.</span>detrend                = <span style="color:rgb(221,17,68)">'no'</span>;
bp<span>{j}</span> = ft_resampledata(cfg,bp<span>{j}</span>);
</code></pre>
      <p style="margin:1.2em 0px!important">Does this seem a correct
        translation of this method in Fieldtrip? Are there any caveats
        other than the filter differences?</p>
      <p style="margin:1.2em 0px!important">Thanks, Ian</p>
    </div>
  </div>

<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>