<div dir="ltr">Dear Erick,<div><br></div><div>Yes I remember I was overwhelmed. It's not still clear to me; not even clear to me if there is a problem. Let me assume that there is no problem and give you the following explanation.</div><div><br></div><div>> whether I should be using the FFT or PSD<br><div><br></div><div>std_spec can use matlab FFT. You can find it in std_spec() line 319.</div></div><div><br></div><div><div><font color="#990000">else % fft mode</font></div><div><font color="#990000">    if oritrials == 1 || strcmpi(g.continuous, 'on')</font></div><div><font color="#990000">        X = bsxfun(@times, X, hamming(size(X,2))');</font></div><div><font color="#990000">    end;</font></div><div><font color="#990000">    if all([ EEG.trials ] == 1) && ~isempty(boundaries), disp('Warning: fft does not take into account boundaries in continuous data'); end;</font></div><div><font color="#990000">    tmp   = fft(X, g.nfft, 2);</font></div><div><font color="#990000">    f     = linspace(0, EEG(1).srate/2, floor(size(tmp,2)/2));</font></div><div><font color="#990000">    f     = f(2:end); % remove DC (match the output of PSD)</font></div><div><font color="#990000">    tmp   = tmp(:,2:floor(size(tmp,2)/2),:);</font></div><div><font color="#990000">    X     = tmp.*conj(tmp);</font></div><div><font color="#990000">    if strcmpi(g.logtrials, 'on'),  X = 10*log10(X); end;</font></div><div><font color="#990000">    if strcmpi(g.savetrials, 'off'), X = mean(X,3); end;</font></div><div><font color="#990000">    if strcmpi(g.logtrials, 'off'),  X = 10*log10(X); end;</font></div><div><font color="#990000">end;</font></div></div><div><br></div><div>PSD uses pwelch. spectopo() line 898</div><div><br></div><div><div><font color="#990000">if usepwelch</font></div><div><font color="#990000"> [tmpspec,freqs] = pwelch(matsel(tmpdata,frames,0,1,e),...</font></div><div><font color="#990000">                                         winlength,g.overlap,fftlength,srate);</font></div></div><div><font color="#990000"><br></font></div><div><font color="#000000">It's up to you whether you want to use FFT or PSD. The difference of the results from the two methods should derive from the difference from matlab FFT vs. pwelch (apart from windowing & overlapping issue...) Am I wrong, experts?</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Makoto</font></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 13, 2015 at 5:07 PM, Erickson <span dir="ltr"><<a href="mailto:ericksonb.eng@gmail.com" target="_blank">ericksonb.eng@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all,<div>When using Spectopo, I was confused about the overlap used by default. I did some digging and developed a summary that I think may be useful to others, as well as some questions for the listserv.</div><div><br></div><div>There are two functions one could use to extract power spectra information.</div><div><br></div><div>One is Spectopo, which by default calculates the Power Spectral Density (PSD). When no "overlap" value is given, the default is [0] in timepoints. This could be confusing, since the default of the underlying function pwelch() is 50% overlap. However, this is only when pwelch is called directly. Overlap must be manually specified when called from spectopo(). Spectopo() is the function called when using plot->channel spectra and maps.</div><div><br></div><div>The other is std_spec(). When called with the "PSD" option, std_spec() calls spectopo with no overlap value. (it will always default to [0] and there is no way to specify an overlap.) I am not aware of where this std_spec() function is called in the GUI. Can anyone comment on this? Is it only available from the "Study" function? </div><div><br></div><div>std_spec() can also be called in FFT mode, in which case it defaults - on continuous data only - to 1s epochs with .5s overlap. These variables can be set by two options specifying the epoch length and epoch "recurrence".</div><div><br></div><div>This general information was previously covered (<a href="http://sccn.ucsd.edu/pipermail/eeglablist/2013/006174.html" target="_blank">http://sccn.ucsd.edu/pipermail/eeglablist/2013/006174.html</a>) but the discussion was difficult to follow. Correction of any errors I've made is appreciated.</div><div><br></div><div>Technical concerns aside, more opaque is the difference between these two options - Power Spectral Density vs. FFT.</div><div><br></div><div>In a previous topic I posted, PSD and FFT have been described as both essentially equivalent and different by various experts, and the discussion was left unresolved: see <a href="http://sccn.ucsd.edu/pipermail/eeglablist/2014/008224.html" target="_blank">http://sccn.ucsd.edu/pipermail/eeglablist/2014/008224.html</a></div><div><br></div><div>I am confused, when reporting mean power values across time periods, whether I should be using the FFT or PSD options and what the essential differences between these frequency domain transformation methods are. I think this is a quite essential topic as band power within a time window is a core method for reporting condition differences in EEG. Would anyone comment on the contrast between PSD and FFT and in which situations either should be reported / analyzed?</div><div><br></div><div>Best,</div><div>Brian Erickson</div><div><br></div><div>Creativity Research Laboratory</div><div>Applied Brain and Cognitive Sciences Program</div><div>Drexel University, Department of Psychology</div><div>College of Arts and Sciences</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>







<p><br></p></div><div><br></div></div>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div></div>