<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi FT users,<br>
<br>
I am having some problems with resampling (downsampling) the data.<br>
<br>
Here is what I'm doing:<br>
<br>
I preprocess the continuous data to obtain band-pass filtered signal
in several frequencies (4-8,8-12,12-30, etc), also taking the abs
value of the Hilbert transform. The absolute value of the Hilbert is
ultimately what I need.<br>
<br>
I have used the following code:<br>
<i><br>
</i><i>cfg = [];</i><i><br>
</i><i>cfg.channel = 'MEG';</i><i><br>
</i><i>cfg.demean = 'yes';</i><i><br>
</i><i>cfg.detrend = 'yes';</i><i><br>
</i><i>cfg.lpfilter = 'yes';</i><i><br>
</i><i>cfg.hilbert = 'abs';</i><i><br>
</i><i>cfg.hpfilter = 'yes';</i><i><br>
</i><i>cfg.hilbert = 'abs';</i><i><br>
</i><i>cfg.lpfreq = 30;</i><i><br>
</i><i>cfg.hpfreq = 12;</i><i><br>
</i><i>cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';</i><i><br>
</i><i>cfg.continuous = 'yes';</i><i><br>
</i><i>beta = ft_preprocessing(cfg);</i><i><br>
</i><br>
After this, I epoch the data as follows<br>
<br>
<i>cfg = [];</i><i><br>
</i><i>cfg.trl = trl2; % this is a trial definition previously
created</i><i><br>
</i><i>beta_ep = ft_redefinetrial(cfg,beta);</i><br>
<br>
and then I downsample as follows:<br>
<br>
<i>cfg = [];</i><i><br>
</i><i>cfg.resamplefs = 500;</i><i><br>
</i><i>beta_epdw = ft_resampledata(cfg, beta_ep)</i><br>
<br>
I don't encounter any errors, but the strange thing is that the data
looks fine up to before I downsample (i.e.g. if I plot one trial,
it's all positive values, as I would expect from the abs of the
Hilbert), but if I plot the downsampled data, the signal has both
negative and positive values. <br>
<br>
Is there something I'm missing? <br>
<br>
Thanks a lot if you can help,<br>
<br>
Elisa<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>