<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Philip,
<div class=""><br class="">
</div>
<div class="">
<div>The error you run into seems a hard constraint for the ‘dftfilter', with the option ’neighbour’. This means that this type of filtering cannot be done if your trials are of different length.</div>
<div>In this case, I would recommend just using the default value for dftreplace.</div>
<div><br class="">
</div>
<div>Best wishes and good luck,</div>
<div>Jan-Mathijs</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 24 Aug 2022, at 16:57, philip Joadavi via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Dear all,
<div class=""><br class="">
</div>
<div class="">I have a question (which might be very stupid) regarding the line noise removal using spectrum interpolation using DFT method.</div>
<div class=""><br class="">
</div>
<div class="">currently, I'm applying the notch filter on my data, but I noticed for some of my subjects the 50Hz is not entirely removed. </div>
<div class=""><br class="">
</div>
<div class="">I have 32-channel EEG data (with a sampling frequency of 2048) with many trials that have different lengths (from 15 seconds to 5 min). If I understood correctly the best method for removing the 50 Hz from this kind of data is spectrum interpolation.
 Unfortunately, I'm having a hard time making it to work. </div>
<div class=""><br class="">
</div>
<div class="">here is what I have defined:</div>
<div class="">cfg.dftfilter       = 'yes';<br class="">
</div>
<div class="">cfg.dftreplace  = 'neighbour';<br class="">
</div>
<div class="">cfg.continuous = 'yes';<br class="">
</div>
<div class="">cfg.padding      =  (2^nextpow2(size(Data{1}.trial,2)))/Data{1}.fsample</div>
<div class="">cfg.padtype      =  'data'<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">so, my first trial has a length of 368200, which for the cfg.padding I use 256. </div>
<div class="">here is where I'm stuck and apparently I'm doing something wrong, which gives me this error:<br class="">
</div>
<div class="">=><b class=""> "Padding by data mirroring is not supported for spectrum interpolation"</b><br class="">
</div>
<div class="">I also remove the option for continuous data, but it did not solve my problem.</div>
<div class=""><br class="">
</div>
<div class="">I would appreciate any help!</div>
<div class=""><br class="">
</div>
<div class="">Thanks a lot!</div>
<div class="">Philip</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6td7bxSDzrO0lAIxrPIxPyWzWfyYFviu0ar57L3kKcBWyzBKqQMWrhvKWS2RvKkx0i2Z0nTNhB3TM01RCBGpBXrVeqkM2sXQLpNyUw$  <br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>