cross-spectrum to cross-correlogram
j.schoffelen at PSY.GLA.AC.UK
Fri Oct 3 22:11:49 CEST 2008
I did not yet completely think it through, but I see two problems
here. Obviously, you would like to verify whether multiplication in
the frequency domain is equivalent to convolution in the time
actually that conjugate multiplication is equivalent to cross-
covariancing (shouldn't you use xcov, instead of xcorr?)
1 you apply a hanning taper in your frequency analysis; to make a
fair comparison you probably should specify cfg.taper='rectwin',
because your time domain data is not tapered in the xcorr-analysis
2 mathematically the convolution vs. multiplication holds when you
also take into account the 'negative frequencies' in your ifft.
However, freqanalysis does not output these in the first place
3 (sorry there's a third thing): probably you should specify the
additional option 'unbiased' when calling xcorr (or xcov), because
fft assumes circular data so the ifft'ed csd does not taper off at
the edges (which in the xcov/xcorr is due to a decrease in the number
of overlapping samples).
Hopefully these thoughts help.
On Sep 29, 2008, at 8:54 AM, Jasper Poort wrote:
> y = real((squeeze(mean(CS))));
> % inverse fft of cross-spectrum
> y = real(ifft(squeeze(mean(CS))));
> % compare to cross-correlation function
> [c,lags] = xcorr(mean(squeeze(wav(:,:,1)),2),mean(squeeze(wav(:,:,
The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fieldtrip