<div dir="ltr"><div><div><div>Hi Yun,<br></div>If I'm right, just by high-pass filtering your data you should be able to remove the DC component of it.<br><br></div>Best<br><br></div>Rodrigo<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 4:20 PM, Yun Wen <span dir="ltr"><<a href="mailto:Yun.Wen@nottingham.ac.uk" target="_blank">Yun.Wen@nottingham.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 link="#0563C1" vlink="#954F72" lang="EN-GB"><div><p class="MsoNormal">Hi all, I want to remove DC offset before applying the high-pass filter. I  was wondering if I can achieve that by putting cfg.detrend = 'yes' before cfg.hpfilter = 'yes', something like:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">cfg = []; <u></u><u></u></p><p class="MsoNormal">cfg.dataset = filename_raweeg;<u></u><u></u></p><p class="MsoNormal">cfg.detrend = 'yes'; <u></u><u></u></p><p class="MsoNormal">cfg.hpfilter = 'yes';<u></u><u></u></p><p class="MsoNormal">cfg.hpfiltord = 2; % Order of the filter = 2.<u></u><u></u></p><p class="MsoNormal">cfg.hpfreq = 0.1; % High-pass cutoff at 0.1 Hz;<u></u><u></u></p><p class="MsoNormal">[data] = ft_preprocessing (cfg);<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank you in advance.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Best,<u></u><u></u></p><p class="MsoNormal">Yun<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p></div><pre>

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
</pre></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>