# [FieldTrip] dimord single-trial source data

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Thu Nov 16 15:52:06 CET 2017

```Hi Stephen,

siz = size(freq.fourierspctrm);
F = freq.fourierspctrm;
F = permute(freq.fourierspctrm,[2 1 3]);
F = reshape(F,siz(2),siz(1)*siz(3));
sourceF = svdfft(source.avg.filter{some_index}*F); % by the way, your use in the time domain per trial is dangerous, because it does a trial specific rotation, which you may or may not want
sourceF = reshape(sourceF, siz(1), siz(3));
sourceP = abs(sourceF).^2;

Of zoiets.

Cheers,
JM

On 16 Nov 2017, at 15:43, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:

Hi again again Jan-Mathijs,

Ah yes, that does seem like the most elegant and memory-efficient approach!
I will need to figure out how to apply spatial filters to Fourier (and redo my sensor level spectral analysis to Fourier).

Shout-out to the list: anyone have an example of applying spatial filters to Fourier that I could use?

Thanks again again,
Stephen

On 16 November 2017 at 14:38, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:
Hi again Stephen,

I forgot to mention a third approach: you can compute your spatial filter with cfg.method = ‘lcmv’ and cfg.lcmv.keepfilter = ‘yes’, and subsequently compute the source level spectra by applying these spatial filters to the sensor level fourier spectra.

Best wishes,
Jan-Mathijs

> On 16 Nov 2017, at 12:36, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:
>
> Hi FieldTrippers,
>
> I was wondering is there is a recommend/most consistent way to represent trial x pos x time data from an LCMV beamformer, also considering the dimord. In other words:
>
> with:
>
> data.method = 'singletrial'
>
> should I use:
>
> data.trial{pos} = [rpt x time]
> data.dimord = '{pos}_rpt_time'
>
> or rather:
>
> data.trial = {pos x rpt x time}
> data.dimord = 'pos_rpt_time'
>
> or something else? The purpose is to then do a frequency analysis (with keeptrials = 'yes').
>
> Best,
> Stephen
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20171116/859bf129/attachment-0002.html>
```