Hi all,
I need to reproduce the power spectrum as plotted using pwelch inside brainstorm but outside using only matlab.
So far, I have been unsuccessful.
Where is the place in the code pwelch is called?
I would like to see how this is done so I can reproduce it.
In the repository, I can only see pwelch called here:
ImaGIN_spm_eeg_tf(S)
But this doesn't seem right.
Thanks,
-Tom.
Brainstorm does not use the pwelch
function from Matlab.
The process process_psd.m
calls bst_psd.m
, through process_timefreq.m
and bst_timefreq.m
.
To explore how this is called from the interface: Put a breakpoint in bst_psd.m, then start the execution. When the debugger stops, explore the contents of the variables and the call stack.
function [TF, FreqVector, Nwin, Messages] = bst_psd( F, sfreq, WinLength, WinOverlap, BadSegments, ImagingKernel, isVariance, PowerUnits )
% BST_PSD: Compute the PSD of a set of signals using Welch method
% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brainstorm
%
% Copyright (c) University of Southern California & McGill University
% This software is distributed under the terms of the GNU General Public License
% as published by the Free Software Foundation. Further details on the GPLv3
% license can be found at http://www.gnu.org/copyleft/gpl.html.
%
% FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
% UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
% WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY
% LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE.
%
% For more information type "brainstorm license" at command prompt.
% =============================================================================@
This file has been truncated. show original
Thank you very much Francoise.