<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">dear fieldtrip-users,<div><br></div><div><br></div><div>actually my first active post in the fieldtrip newsgroup. first i'd like to thank the community and especially the developers of fieldtrip for their great support&help!</div><div><br></div><div>i am interested in a trial-based(!) time-domain data-set in the source space of MEG data for further connectivity analysis. i decided to use a beamformer (lcmv) to recover the neuronal activity by using snythetic data-sets (for testing and verification). the synthetic data-set consists of 3 correlated sources with up to 300 trials and a length of 720 datapoints (=1.2s@600Hz) and many trials of uncorrelated noisy sources.</div><div><br></div><div>i implemented the dipole simulation in the following way:</div><div>1) i used customized data with time dependent (time-delayed) phase correlations as source waveforms and added randomly located uncorrelated dipoles as disturbances and spontaneous brain processes.</div><div>next, i simulated the data in sensor-space and did an lcmv beamforming </div><div>-> works fine (a priori known connectivity can be recovered).</div><div><br></div><div>2) in the next step i repeated the simulation and added 10% rms as additive (delta-correlated) measurement noise to the data in the sensor-space to model thermal noise. </div><div>-> in this case the beamformer reconstruction fails totally...</div><div><br></div><div>3) i averaged the data in sensor-space to get rid of the thermal noise and used the cov to recover every single trial, but in this case the beamformer cannot deal with brain-noise...</div><div>-> this didn't work either..</div><div><br></div><div>MY QUESTION IS: is this a conceptual problem of beamforming, that one cannot recover a trial-based time-series or did i commit a crude error in reasoning/programming?</div><div>do you think a bootstrapping for calculating the cov might make sense, i.e. i could calculate the cov for each trial by averaging over just a few trials (eg 10 randomly chosen trials) to reduce the uncorrelated noise in sensor space without loosing all the information to suppress the brain-noise? </div><div>which other inverse methods can recover source activity in time-domain on trial level? </div><div>eg MNE seems only to work on average over trials?</div><div><br></div><div>so many questions.. thank you in advance for your help!</div><div><br></div><div><br></div><div>with best wishes,</div><div>andreas</div><div><br></div><div><br></div><div><div style="font-size: 12px; ">__________________________________</div><div style="font-size: 12px; ">Dipl.-Phys. Andreas Wilmer</div><div style="font-size: 12px; "><br class="khtml-block-placeholder"></div><div style="font-size: 12px; ">Institut für Allgemeine Psychologie</div><div style="font-size: 12px; ">Westfälische Wilhelms-Universität Münster</div><div style="font-size: 12px; ">AE Prof. Dr. Markus Lappe</div><div style="font-size: 12px; ">Fliednerstraße 21</div><div style="font-size: 12px; ">D 48149 Münster</div><div style="font-size: 12px; "><br class="khtml-block-placeholder"></div><div style="font-size: 12px; ">fon: <span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="white-space: pre; "><span class="Apple-style-span" style="white-space: pre; "> </span></span></span>+49 (251) 83 34175</div><div style="font-size: 12px; ">email: <span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="white-space: pre; "><span class="Apple-style-span" style="white-space: pre; "> </span></span></span><a href="mailto:andreas.wilmer@uni-muenster.de">andreas.wilmer@uni-muenster.de</a></div><div style="font-size: 12px; "><br class="khtml-block-placeholder"></div></div><div style="font-size: 12px; "><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>my code on beamforming</div><div>two further remarks:</div><div>a) i didn't apply a normalization of the virtual channels because i am interested in phase measures - normalizing the amplitudes won't have any effect on the results</div><div>b) narrow band filtering didn't work with my (broad band) data</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); ">%-----------------------------------------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); ">%estimating filter/cov</div></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.channel = {<span style="color: #a020f0">'MEG'</span>};</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.keeptrials = <span style="color: #a020f0">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.bpfrq = [1 150];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.covariance = <span style="color: #a020f0">'yes'</span>; <span style="color: #228b22">%trial/stimulus window</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.covariancewindow = [0 1.2]; <span style="color: #228b22">%complete data</span></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Andale Mono; color: #228b22; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">dataCov = ft_timelockanalysis(cfg,dataSensor);</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "><span class="Apple-style-span" style="color: rgb(34, 139, 34); ">%-----------------------------------------------------------------</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "><span class="Apple-style-span" style="color: rgb(34, 139, 34); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); ">%beamforming</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.method = <span style="color: #a020f0">'lcmv'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.lcmv.fixedori = <span style="color: #a020f0">'yes'</span>;</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Andale Mono; min-height: 14.0px"> </p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.vol <span class="Apple-tab-span" style="white-space:pre"> </span>= dataHead;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.grid.pos <span class="Apple-tab-span" style="white-space:pre"> </span>= gridposition;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.lambda <span class="Apple-tab-span" style="white-space:pre"> </span>= <span style="color: #a020f0">'5%'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.projectnoise <span class="Apple-tab-span" style="white-space:pre"> </span>= <span style="color: #a020f0">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.keepfilter <span class="Apple-tab-span" style="white-space:pre"> </span>= <span style="color: #a020f0">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">cfg.keeptrials <span class="Apple-tab-span" style="white-space:pre"> </span>= <span style="color: #a020f0">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); "> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">[dataVc] = ft_sourceanalysis(cfg,dataCov);</div><div><br></div><div>%---------------------------------------------------------------</div><div>%reconstructing source data</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">trialN = size(dataSensor.trial,2);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">[sensN tN] = size(dataSensor.trial{1});</div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; ">srcN <span class="Apple-tab-span" style="white-space:pre"> </span> = length(dataVc.inside);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; min-height: 14px; "><br></div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "><span style="color: #0000ff">for</span> i=1:srcN,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "> m = dataVc.inside(i);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "> <span style="color: #0000ff">if</span> ~isempty(dataVc.avg.filter{m}),</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(160, 32, 240); "><span style="color: #000000"> fprintf(</span>'beamforming source %d/%d\n'<span style="color: #000000">,i,srcN);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); "><font class="Apple-style-span" color="#000000"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(34, 139, 34); "><span style="color: #000000"> </span>%beamforming</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "> <span style="color: #0000ff">for</span> j = 1:trialN, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "> dataVc.trial(j).mom{m} =... <span class="Apple-tab-span" style="white-space:pre"> </span>dataVc.avg.filter{m}*dataSensor.trial{j};</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Andale Mono; color: #228b22; min-height: 14.0px"> <span style="color: #0000ff">end</span> </p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Andale Mono; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; "> <span style="color: #0000ff">end</span> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal 'Andale Mono'; color: rgb(0, 0, 255); ">end</div></div><div><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;"><font class="Apple-style-span" color="#000000" face="'Andale Mono'"><br></font></span></font></div></div></div></span></div><div apple-content-edited="true"> </div><br></body></html>